Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
mickaelquesnot
Active Participant
0 Kudos
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

We82

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

VF31

Finally, the values of Zsegment will come through into IDoc.
WE05

BD87


 



 


 



 


 

2 Comments