<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IDOC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521223#M1068941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        If you are developing a Custom Program and the details are known apart from the IDoc Type and the Message Type, then you can go ahead and hard code them in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      See the below Code for your understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH i_edidc.&lt;/P&gt;&lt;P&gt;  CLEAR wa_edidc.&lt;/P&gt;&lt;P&gt;  CLEAR wa_edidd1.&lt;/P&gt;&lt;P&gt;  wa_edidc-doctyp = c_idoc1.&lt;/P&gt;&lt;P&gt;  wa_edidc-mestyp = c_messtyp1.&lt;/P&gt;&lt;P&gt;  wa_edidc-rcvprt = c_rcvprt.&lt;/P&gt;&lt;P&gt;  wa_edidc-rcvpor = c_rcvpor. &lt;/P&gt;&lt;P&gt;  wa_edidc-rcvprn = c_rcvprn.&lt;/P&gt;&lt;P&gt;  APPEND wa_edidc TO i_edidc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      master_idoc_control            = wa_edidc&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      communication_idoc_control     = i_edidc&lt;/P&gt;&lt;P&gt;      master_idoc_data               = i_edidd1&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      error_in_idoc_control          = 1&lt;/P&gt;&lt;P&gt;      error_writing_idoc_status      = 2&lt;/P&gt;&lt;P&gt;      error_in_idoc_data             = 3&lt;/P&gt;&lt;P&gt;      sending_logical_system_unknown = 4&lt;/P&gt;&lt;P&gt;      OTHERS                         = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Venkat Phani Prasad Konduri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2008 12:20:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-01T12:20:13Z</dc:date>
    <item>
      <title>IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521221#M1068939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;         My scenario is like,&lt;/P&gt;&lt;P&gt;i had decleared workarea wa_idoc for EDIDC.Now I have to call the messagetype,idoc type,senport,recport and etc...&lt;/P&gt;&lt;P&gt; and this is wa is passed in fm "master_idoc_distribute".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is that how can call the parameters that are present in the EDIDC into hte work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swathi.k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 10:34:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521221#M1068939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T10:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521222#M1068940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to fill the work area with the control record for e.g &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  idoc_control-doctyp = str_edp13-idoctyp.&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;and then assign the work area to MASTER_IDOC*&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;          master_idoc_control            = idoc_control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and clear the work area after the function call&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;chetanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 10:41:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521222#M1068940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T10:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521223#M1068941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        If you are developing a Custom Program and the details are known apart from the IDoc Type and the Message Type, then you can go ahead and hard code them in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      See the below Code for your understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH i_edidc.&lt;/P&gt;&lt;P&gt;  CLEAR wa_edidc.&lt;/P&gt;&lt;P&gt;  CLEAR wa_edidd1.&lt;/P&gt;&lt;P&gt;  wa_edidc-doctyp = c_idoc1.&lt;/P&gt;&lt;P&gt;  wa_edidc-mestyp = c_messtyp1.&lt;/P&gt;&lt;P&gt;  wa_edidc-rcvprt = c_rcvprt.&lt;/P&gt;&lt;P&gt;  wa_edidc-rcvpor = c_rcvpor. &lt;/P&gt;&lt;P&gt;  wa_edidc-rcvprn = c_rcvprn.&lt;/P&gt;&lt;P&gt;  APPEND wa_edidc TO i_edidc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      master_idoc_control            = wa_edidc&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      communication_idoc_control     = i_edidc&lt;/P&gt;&lt;P&gt;      master_idoc_data               = i_edidd1&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      error_in_idoc_control          = 1&lt;/P&gt;&lt;P&gt;      error_writing_idoc_status      = 2&lt;/P&gt;&lt;P&gt;      error_in_idoc_data             = 3&lt;/P&gt;&lt;P&gt;      sending_logical_system_unknown = 4&lt;/P&gt;&lt;P&gt;      OTHERS                         = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Venkat Phani Prasad Konduri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 12:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521223#M1068941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T12:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521224#M1068942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do like this,&lt;/P&gt;&lt;P&gt;If you want to keep the sender and receiver of the message dynamic, create a distribution model ( t-code BD64 ) for the message type and code the filling of control record as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM fill_control_record  TABLES  p_ctrl_rec STRUCTURE edidc.

  DATA : i_model_data LIKE bdi_model OCCURS 0 WITH HEADER LINE.
  DATA : mess_type TYPE bdmsgtyp-mestyp.

  mess_type = 'XXXXXXX'.  "Give your message type here
  

  CALL FUNCTION 'ALE_MODEL_INFO_GET'
    EXPORTING
      message_type                 = mess_type
*   RECEIVING_SYSTEM             = ' '
*   SENDING_SYSTEM               = ' '
*   VALIDDATE                    = SY-DATUM
   TABLES
     model_data                   = i_model_data
 EXCEPTIONS
   no_model_info_found          = 1
   own_system_not_defined       = 2
   OTHERS                       = 3
            .
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  LOOP AT i_model_data.
*    -fill the control record
*-------------------------------------------------
    p_ctrl_rec-rcvprt ='LS'.
    p_ctrl_rec-mestyp = mess_type.
    p_ctrl_rec-idoctp = 'XXXXXXXXXX'.    "Give your IDoc type here
    p_ctrl_rec-rcvprn = i_model_data-rcvsystem.
    p_ctrl_rec-rcvpfc = 'LS'.
    APPEND p_ctrl_rec.
  ENDLOOP.

ENDFORM.                    " fill_control_record
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note :&lt;/STRONG&gt;  &lt;EM&gt;&lt;STRONG&gt;This avoid hard coding any values in the program.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Advait Gode on Oct 1, 2008 2:35 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 12:35:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/4521224#M1068942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T12:35:23Z</dc:date>
    </item>
  </channel>
</rss>

