How to add an user-defined segment to an IDoc
source link: https://blogs.sap.com/2023/06/05/how-to-add-an-user-defined-segment-to-an-idoc-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to add an user-defined segment to an IDoc
Description:
This document will show you how to create a new Segment and append it to a NEW IDoc type.
Scenario:
You have to transfer some custom data via IDoc ZPINVOICBE for Invoice. You need to implement the below steps to achieve it:
1. Create a new Zsegment
2. Add segment for an Idoc type
3. Maintain Output Types and Assignment to IDoc Types in WE82
4. Maintain Partner Profile in WE20
5. Write the code in USER EXIT
1. Create a new Z-Segment (Tcode WE31)
Then set it released by press F3, Go to Menu->Edit->Set Release
2. Copy Basic Type INVOIC02 (Tcode WE30) to ZPINVOICBE and add new segment
3. Maintain Output Types and Assignment to IDoc Types in WE82 (Tcode WE82)
WE81
4.Maintain Partner Profile in WE20 (Tcode WE20)
5.Write the code in USER EXIT LXEDFU01 User_Exit Control Data IDoc_Output_Invoic
VAT Registration Number / VAT TEXT
CLEAR : LS_EDIDD, LV_STCEG_L, LV_LAND1, LS_ZE1EDK29.
READ TABLE CT_INT_EDIDD INTO LS_EDIDD WITH KEY SEGNAM = ‘ZE1EDK29’.
IF SY-SUBRC NE 0.
READ TABLE CT_INT_EDIDD INTO LS_EDIDD WITH KEY SEGNAM = ‘E1EDK01’.
CLEAR LS_E1EDK01.
LS_E1EDK01 = LS_EDIDD-SDATA.
SELECT SINGLE STCEG_L LAND1 FROM VBRK INTO (LV_STCEG_L, LV_LAND1)
WHERE VBELN = LS_E1EDK01-BELNR.
IF LV_STCEG_L = ‘BE’.
LS_EDIDD-SEGNAM = ‘ZE1EDK29’.
LS_ZE1EDK29-STCEG = TEXT-004.
CASE LV_LAND1.
WHEN ‘LU’.
LS_ZE1EDK29-BEZEI100 = TEXT-001.
WHEN ‘BE’.
LS_ZE1EDK29-BEZEI100 = TEXT-002.
WHEN OTHERS.
LS_ZE1EDK29-BEZEI100 = TEXT-003.
ENDCASE.
LS_EDIDD-SDATA = LS_ZE1EDK29.
APPEND LS_EDIDD TO CT_INT_EDIDD.
ENDIF.
ENDIF. Then we check the Zsegment is existing or not and Append or Insert corresponding.
TEST
VF02
Finally, the values of Zsegment will come through into IDoc.
WE05
Recommend
-
5
Technical Articles
-
2
作为一名开发者,每个人都要写代码。工作中,几乎每一位开发者都要写文档。因为工作是人和人的协作,产品要写需求文档,开发要写详细设计文档,接口文档。可是,作为一个懒人,平时最讨厌的一件事情就是写文档。写文档最令我不爽的...
-
3
Ryan Crosby May 4, 2022 8 minute read ...
-
7
Ryan Crosby May 22, 2022 8 minute read ...
-
3
When using Segment, a source is a website or application you wish to receive data or information from. This blog post will go over how to create a source in the Segment console for each website or application you want to track using Analytic...
-
5
Sachin T 17 minutes ago BKPF: Mapping of Ref.key(head) 1 & Ref.key 2 with IDOC Segment for Header 4 Views
-
6
Jigang Zhang 张吉刚 November 28, 2022 1 minute r...
-
5
Search Questions and Answers
-
4
Benedikt Bogar March 3, 2023 3 minute read...
-
6
IDOC for transaction CRMD_ORDER Service Order in S4 Skip to Content...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK