Application Development 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: 

Idoc creation and destruction at runtime

former_member235056
Active Contributor
0 Kudos

Hi All,

Can anyone explain me how to go ahead with code for idoc creation and destruction at runtime.

Regards,

Ameet Jassani

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

Former Member
0 Kudos

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