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

how to write code for multiple custom segment in outbound idoc

Former Member
0 Likes
580

Hi Experts,

My piece of code -

CASE int_edidd-segnam.

WHEN c_E1EDK01.

IF xekpo-loekz = c_loekz.

CLEAR xekpo-brgew.

ENDIF.

wa_idoc_data-segnam = 'ZE1EDK01'.

wa_idoc_data-psgnum = int_edidd-segnum.

CLEAR : lv_menge.

  • For sum the quantity on header

LOOP AT xekpo INTO wa_ekpo WHERE loekz <> c_loekz.

lv_menge = lv_menge + wa_ekpo-menge.

ENDLOOP.

wa_data_header-menge = lv_menge.

wa_idoc_data-sdata = wa_data_header .

APPEND wa_idoc_data TO int_edidd.

CLEAR :wa_idoc_data.

*ENDIF.

when 'E1EDKA1'.

wa_idoc_data-segnam = 'ZE1EDKA2'.

wa_idoc_data-psgnum = int_edidd-segnum.

*For Container number

wa_data-zcontainer = dekko-zzconnum.

wa_idoc_data-sdata = wa_data .

APPEND wa_idoc_data TO int_edidd.

CLEAR :wa_idoc_data.

ENDCASE.

I have check at debugging and found that int_edidd-segnam does not change that is the reason that 'E1EDKA1' segment does not get triggered.

Please give your valuable suggestion <priority reduced by moderator>.

Thanks,

Sahil

Edited by: Thomas Zloch on Jan 5, 2011 12:56 PM

2 REPLIES 2
Read only

Former Member
0 Likes
486

Hi,

I hope your code is in loop on int_edidd internal table.

Regards,

Himanshu

Read only

Former Member
0 Likes
486

Hi,

check the EDIDC table DOCTY,CIMTYP...

when ever the CIMTYP(idoc Extension comes ) read the segment and write your code...

example code..

loop at int_edidd where segnam = 'E1EDKA1'.

if control_record_out-cimtyp eq 'ZORDSCH5'. "Extension idoc

"Modify or Append new record..

endif.

endloop.

Prabhudas