cancel
Showing results for 
Search instead for 
Did you mean: 

insert new segment in Outbound IDOC

Former Member
0 Kudos

I try to insert new i segment in oubound idoc but the problem that the segment is not insered under his father segment also its insered more then one time .

I use a user exit to do that and this is a part of code.

IF idoc_data-segnam = 'E1ADRM1'.

IF sid <> ' '.

DATA i1 TYPE i.

i1 = 0.

LOOP AT idoc_data WHERE segnam = 'E1EDL55'.

i1 = i1 + 1.

ENDLOOP.

IF i1 = 0.

CLEAR l_e1edl55.

CLEAR wa_idoc_data.

MOVE sy-tabix TO l_idx1.

MOVE idoc_data TO wa_idoc_data.

l_e1edl55-qualf = 'ZSD'.

l_e1edl55-refnr = sid.

wa_idoc_data-segnam = 'E1EDL55'.

wa_idoc_data-sdata = l_e1edl55.

wa_idoc_data-hlevel = 24.

wa_idoc_data-psgnum = 24.

APPEND wa_idoc_data TO idoc_data.

INSERT wa_idoc_data INTO idoc_data INDEX l_idx1.

ENDIF.

ENDIF.

ENDIF.

Edited by: Ghanem BEN ALI on Feb 18, 2010 10:39 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I think it would be a better idea to to create a segment via we31 and then extend the Idoc via we30. In the extended idoc you can insert the new segment.

You may also check the following link:

http://wiki.sdn.sap.com/wiki/display/ABAP/ALEandIDocs

Thanks.

Former Member
0 Kudos

thanks for reply

but the segment is alredy existing in the idoc structer we30 but when i wont to insert ie in my Idoc this is the problem

Former Member
0 Kudos

have you tried using WE19 to edit your IDOC?

Former Member
0 Kudos

YES

Former Member
0 Kudos

A segment is visible in Idoc only if it has any data. If there is no data in the segment, you will not see the segment. Please use a proper user exit to populate the relevant data in segment.

Please check the following link for list of user exits for idoc

http://www.erpgenie.com/abaptips/index2.php?option=com_content&do_pdf=1&id=302

Thanks.