Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IDOC

Former Member
0 Likes
454

With the USER <b>EXIT EXIT_SAPLVEDF_002</b> I want to add 2 fields to a <b>Segment</b>.Can someone tell e how to do that??

2 REPLIES 2
Read only

ferry_lianto
Active Contributor
0 Likes
412

Hi,

Please check this sample codes from other thread.


*----------------------------------------------------------------------*
* INCLUDE ZXEDFU02 *
*----------------------------------------------------------------------*
data: ls_ka1 like e1edka1,
ls_edidd like edidd,
l_lines type i.

describe table int_edidd lines l_lines.

check l_lines ne 0.

read table int_edidd into ls_edidd index l_lines.

check ls_edidd-segnam eq 'E1EDKA1' and
ls_edidd-sdata(2) eq 'RS'.

ls_ka1-parvw = 'ZC'.

case xvbdkr-bukrs.
when '1000'.
ls_ka1-lifnr = '41010005823845840'.
when others.

exit.
endcase.

ls_edidd-sdata = ls_ka1.
append ls_edidd to int_edidd. 

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
412

supriya,

To get custom fields on IDOC you need to add custom segment on IDOC and for that you have to create a extension IDOC with reference to Basic IDOC.

You can do that as explain below.

Here for example you have basic idoc ORDERS05 and you want to add additional segments at header level - ZE1EDK01 and line item level ZE1EDP01

1. TCode - WE31 : Create custom segments ZE1EDK01 and ZE1EDP01 with the fields you want and release these segments.

2. TCode - WE30 : Create extension IDOC

- In WE20 enter extension IDOC name - ZORDERS05, select "Extension" option and hit "create" button. When it gives pop-up, select "create new" and enterd linked basis type as "ORDERS05". Enter proper description and save.

3. On the next screen of WE30, select the segment under which you want to add your additional segment. Save everything.

4. TCode - WE82. Here you link extension idoc to basic idoc and message type.

- Go into change mode. Hit "New entries button" Enter Message type = "ORDERS", basic type = "ORDERS05" and extension type = "ZORDERS05".

You can populate this segment and fields you want using the user-exit available in that perticular IDOC processing.

Some common user-exits are:

1. Purchase Order IDOC: ORDERS05

Enhancement: MM06E001 - User exits for EDI inbound and outbound purchasing documents

2. Quotation IDOC: ORDERS05

Enhancement: VEDE0001 - SD EDI Outbound quotation (customer enhancement)

3. Invoice IDOC ( bill. doc): INVOIC02

Enhancement: LVEDF001 - User exit for IDOC_OUTPUT_INVOICE

Let me know what message type, process code, idoc type you are using and i will tell you what user-exit you can use for your requirement.

~~Guduri