Skip to Content
0
Mar 29, 2008 at 01:00 AM

Inbound IDOC

24 Views

Hi

We are receiving an Inbound IDOC and the data is getting updated into a custom table.

When single record is there its working fine when I receive multiple records then the last record is getting updated ,Please let me know how to update all the records into the custom table.

Below is my code

LOOP AT idoc_contrl.

LOOP AT idoc_data

WHERE docnum = idoc_contrl-docnum.

CASE idoc_data-segnam.

WHEN 'E1MARAM'.

MOVE idoc_data-sdata TO wa_mara.

WHEN 'E1MAKTM'.

MOVE idoc_data-sdata TO wa_makt.

WHEN 'E1MVKEM'.

MOVE idoc_data-sdata TO wa_mvke.

WHEN 'Z1ZMAVL'.

MOVE idoc_data-sdata TO wa_zmavl1.

ENDCASE.

ENDLOOP.

MOVE: wa_mara-matnr TO wa_zmavl-matnr,

wa_mara-pstat TO wa_zmavl-zqspec_rev,

wa_mara-ersda TO wa_zmavl-zdate,

wa_mara-aeszn TO wa_zmavl-ztime,

wa_mara-aenam TO wa_zmavl-zshelf_life,

wa_mara-matkl TO wa_zmavl-matkl,

wa_mvke-pmatn_guid TO wa_zmavl-wgbez,

wa_makt-maktx TO wa_zmavl-maktx,

wa_mara-vpsta TO wa_zmavl-zcust_rev,

wa_mara-mbrsh TO wa_zmavl-zrind,

wa_zmavl1-zmanuf_name TO wa_zmavl-zmanuf_name,

wa_zmavl1-zmanuf_pn TO wa_zmavl-zmanuf_pn,

wa_mara-lvorm TO wa_zmavl-zuse_code,

wa_mara-blatt TO wa_zmavl-zmoist,

wa_mara-bwscl TO wa_zmavl-zccind,

wa_mvke-pmatn_external TO wa_zmavl-zcceff,

wa_mara-mstde TO wa_zmavl-zccdat.

  • building internal table for the existing FM

APPEND wa_zmavl TO i_zmavl.

ENDLOOP.