‎2006 Nov 22 10:41 AM
Hi,
I am working on ALE/IDOC's .Please let me know how can i develope SE38 program for creating an IDOC (both in Sender and Receiver ) .I know how to create Segments ,IDOC Msg Type . I need only SE38 Program . And My Internal Table Consist of only 5 fields .
‎2006 Nov 22 10:58 AM
Hi Pavan,
First u declare two internal tables of structure
1>EDIDD 2>EDIDC as(i_edidd,i_edidc)
Then get all the data from data base table ans place it into another internal table.
suppose the internal table whcih contains data is ITAB.
create a work area like the segment(wa_segment type ZSEGMENT)
Loop at ITAB INTO WA_ITAB.
Move : wa_itab-field1 to wa_segment-zfield1
wa_itab2-field2 to wa_segment-zfield2.
move : <Give the segment name for example ZSEGMENT> to wa_edidd-segnam,
wa_segment to wa_edidd-sdata.
append wa_edidd to i_edidd.
endloop.
now fill the control record.
wa_edidc-rcvpor = <give receiver port>
wa_edidc-rcvprt = <give receiver partner (LS)
wa_edidc-rcvprn = <give receiver partner number>
wa_edidc-direct = 1.
wa_edidc-msetyp = <give the message type>
wa_edidc-idoctp = <give the basic type>
append i_edidc from wa_edidc.
now call the FM
MASTER_IDOC_DISTRIBUTE
EXPORTING
MASTER_IDOC_CONTROL = WA_EDIDC.
TABLES
COMMUNICATION_IDOC_CONTROL = I_EDIDC
MASTER IDOCDATA = I_EDIDD
Thats all
Regards,
nagaraj
‎2006 Nov 22 10:58 AM
Hi Pavan,
First u declare two internal tables of structure
1>EDIDD 2>EDIDC as(i_edidd,i_edidc)
Then get all the data from data base table ans place it into another internal table.
suppose the internal table whcih contains data is ITAB.
create a work area like the segment(wa_segment type ZSEGMENT)
Loop at ITAB INTO WA_ITAB.
Move : wa_itab-field1 to wa_segment-zfield1
wa_itab2-field2 to wa_segment-zfield2.
move : <Give the segment name for example ZSEGMENT> to wa_edidd-segnam,
wa_segment to wa_edidd-sdata.
append wa_edidd to i_edidd.
endloop.
now fill the control record.
wa_edidc-rcvpor = <give receiver port>
wa_edidc-rcvprt = <give receiver partner (LS)
wa_edidc-rcvprn = <give receiver partner number>
wa_edidc-direct = 1.
wa_edidc-msetyp = <give the message type>
wa_edidc-idoctp = <give the basic type>
append i_edidc from wa_edidc.
now call the FM
MASTER_IDOC_DISTRIBUTE
EXPORTING
MASTER_IDOC_CONTROL = WA_EDIDC.
TABLES
COMMUNICATION_IDOC_CONTROL = I_EDIDC
MASTER IDOCDATA = I_EDIDD
Thats all
Regards,
nagaraj