10-15-2008 8:14 AM
Hi All,
Can anyone explain me how to go ahead with code for idoc creation and destruction at runtime.
Regards,
Ameet Jassani
10-15-2008 9:08 AM
Did you mean IDoc creation and distribution ?
If yes then you can use MASTER_IDOC_DISTRIBUTE, where you need to pass the parameters
MASTER_IDOC_CONTROL
COMMUNICATION_IDOC_CONTROL
MASTER_IDOC_DATA
To dynamically determine the sender and receiver system for the control record, maintain the distribution model for the message type in BD64 transaction and then call the function ALE_MESTYPE_GET_RECEIVER by passing the Message type. this will return the receivers for the message type.
Hope this helps.
regards,
Advait
10-15-2008 9:01 AM
Hello,
Check the below Sample Code so that you can get an Idea.
wa_data1-lgort = wa_output-lgort.
wa_data1-psmng = wa_output-psmng.
wa_edidd1-segnam = c_seg1.
wa_edidd1-sdata = wa_data1.
APPEND wa_edidd1 TO i_edidd1 .
wa_data2-arbpl = wa_output-arbpl.
wa_edidd1-segnam = c_seg2.
wa_edidd1-sdata = wa_data2.
APPEND wa_edidd1 TO i_edidd1 .
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = wa_edidc
TABLES
communication_idoc_control = i_edidc
master_idoc_data = i_edidd1
EXCEPTIONS
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
OTHERS = 5.
Thanks and Regards,
Venkat Phani Prasad Konduri
10-15-2008 9:08 AM
Did you mean IDoc creation and distribution ?
If yes then you can use MASTER_IDOC_DISTRIBUTE, where you need to pass the parameters
MASTER_IDOC_CONTROL
COMMUNICATION_IDOC_CONTROL
MASTER_IDOC_DATA
To dynamically determine the sender and receiver system for the control record, maintain the distribution model for the message type in BD64 transaction and then call the function ALE_MESTYPE_GET_RECEIVER by passing the Message type. this will return the receivers for the message type.
Hope this helps.
regards,
Advait