<?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: problem in creating idocs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075023#M729107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;below is scenario for ALE/IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALE-IDOC Scenario using Custom IDOC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aim: Transfer the data from one system to another using user customized IDOC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sender System:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Server: 172.25.8.185 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client: 200 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data from Z table: zsach1  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ReceiverSystem: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Server: 172.25.9.198 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client: 800 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data from Z table: zsach1  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data is fetched from Z table on the sender system and inserted it in the Z table of Receiver system using ALE/IDOC.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Settings on the Sender End  &lt;/P&gt;&lt;P&gt;Table Creation T &amp;#150; Code SE11. The table contains data that is to be sent to Receiver.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALE Configuration  &lt;/P&gt;&lt;P&gt;T-Code &amp;#150; SALE  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Logical System  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;200 is our sender &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 is our receiver  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assigning Client to Logical System  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;200 is our sender &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 is our receiver  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Target System for RFC Calls (Tcode &amp;#150; SM59) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on R/3 Connections and then Create TAB  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and test the connection.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Port  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sender system is connected to the receiver system through this Port. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Partner Profiles  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The partner for client 200(Sender) is the client 800 (Receiver)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this is a sender we have to define only Outbound Parameters in this case. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can see the Message type is Z message type.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.                   Maintaining Distribution Model ( TCode BD64 )  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create new Distribution Model  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add Message Type  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Distribute this Model View   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Distribute it from Edit à Model View à Distribute&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining the Z Segment type &lt;/P&gt;&lt;P&gt;Tcode &amp;#150; WE31  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining the Basic Type &lt;/P&gt;&lt;P&gt;T Code WE30  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on New  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will take you to next screen as follows  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you have connected the basic type to the segment type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Enter again and this will take you to screen as follows   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shows the relation between the basic and the segment types.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next you need to make the entry of the segment in the system table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode : WE81  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next is the following entry which is required.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you are specifying the message type and the basic type and the release version.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is all about the configuration you need to do on the sender side. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now on the sender side you also need a program that will fetch the required data, couple it in the IDOC format and post it.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a small piece of code that could be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZSACH_CUST_IDOC                                             *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*report  zsach_cust_idoc                         .&lt;/P&gt;&lt;P&gt;parameters :            p_logsys like tbdlst-logsys.data : gen_segment like edidd-segnam value 'ZSACH'.data : control_dat like edidc,&lt;/P&gt;&lt;P&gt;      gen_data like z1hdr .tables :zsach1.data: begin of inttab occurs 0,&lt;/P&gt;&lt;P&gt;        lname type z1hdr-lname,&lt;/P&gt;&lt;P&gt;        fname type z1hdr-fname,&lt;/P&gt;&lt;P&gt;      end of inttab.&lt;/P&gt;&lt;P&gt;data :&lt;/P&gt;&lt;P&gt;      int_edidd like edidd occurs 0 with header line,&lt;/P&gt;&lt;P&gt;      int_edidc like edidc occurs 0 with header line.&lt;/P&gt;&lt;P&gt;select * from zsach1 into corresponding fields of table inttab.if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;  message 'no data' type 'I'.&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt;endif.control_dat-mestyp = 'ZSACH'.&lt;/P&gt;&lt;P&gt;control_dat-idoctp = 'ZSACH'.&lt;/P&gt;&lt;P&gt;control_dat-rcvprt = 'LS'.&lt;/P&gt;&lt;P&gt;control_dat-rcvprn =  p_logsys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at inttab.&lt;/P&gt;&lt;P&gt;  gen_data-lname = inttab-lname.&lt;/P&gt;&lt;P&gt;  gen_data-fname = inttab-fname.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; GEN_DATA-SSN = INTTAB-SSN.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; GEN_DATA-DOB = INTTAB-DOB.  int_edidd-segnam = gen_segment.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  int_edidd-sdata = gen_data.  append int_edidd.&lt;/P&gt;&lt;P&gt;endloop.call function 'MASTER_IDOC_DISTRIBUTE'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    master_idoc_control                  = control_dat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_TYPE                             = ''&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CHNUM                                = ''&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    communication_idoc_control           = int_edidc&lt;/P&gt;&lt;P&gt;    master_idoc_data                     = int_edidd 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;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  message id sy-msgid type sy-msgty number sy-msgno.&lt;/P&gt;&lt;P&gt;else.  loop at int_edidc.&lt;/P&gt;&lt;P&gt;    write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'IDOC GENERATED',int_edidc-docnum.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  commit work.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Settings on the receiver side.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ALE configuration is same as we did it on the sender side. Please refer to earlier pages.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The receiver specific differences are mentioned below.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T-Code &amp;#150; SALE  &lt;/P&gt;&lt;P&gt;200 is our sender &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 is our receiver  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps   &lt;/P&gt;&lt;P&gt;Defining Logical System (Same as sender) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assigning Client to Logical System (Same as sender) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Target System for RFC Calls (Tcode &amp;#150; SM59) (Same as sender) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Port(Same as sender)  &lt;/P&gt;&lt;P&gt;Defining Partner Profiles &amp;#150; Here we are accepting the data from Sender system. Hence we need to configure it as Inbound.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on the   sign above to go to next screen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the message type is to be created again as it was created on the sender side. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following steps are repeated, as done on the sender side, on the receiver end  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE30 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE31 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE82 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE81 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here on the receiver end, we need to specify a process code at the time of defining the partner profile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process code is something that has the logic defined about what to be done after receiving the IDOC.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our case, on receipt of the IDOC, we are updating the Z Table. i.e Inserting the data from the IDOC into the Z Table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating a Process Code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode &amp;#150; WE42   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic associated is coded in the Function Module which is specified in the Identification Field above.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the processing type is selected as Processing by Function Module as above.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function Module is specified in the following screen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To have your function Module in the above drop down list, the entry is to be made using the following transaction  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TCode &amp;#150; BD51  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the entry is done here, the function module appears in the drop down list in the previous stage. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also it is important to make the following entry &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE57  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Module will look something as below:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source Codefunction z_idoc_input_sach .&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD&lt;/P&gt;&lt;P&gt;*"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC&lt;/P&gt;&lt;P&gt;*"     VALUE(NO_APPLICATION_LOG) LIKE  SY-DATAR OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(MASSSAVEINFOS) LIKE  MASSSAVINF STRUCTURE  MASSSAVINF&lt;/P&gt;&lt;P&gt;*"       OPTIONAL&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT&lt;/P&gt;&lt;P&gt;*"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-APPL_VAR&lt;/P&gt;&lt;P&gt;*"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK&lt;/P&gt;&lt;P&gt;*"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      IDOC_CONTRL STRUCTURE  EDIDC&lt;/P&gt;&lt;P&gt;*"      IDOC_DATA STRUCTURE  EDIDD&lt;/P&gt;&lt;P&gt;*"      IDOC_STATUS STRUCTURE  BDIDOCSTAT&lt;/P&gt;&lt;P&gt;*"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR&lt;/P&gt;&lt;P&gt;*"      SERIALIZATION_INFO STRUCTURE  BDI_SER&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      WRONG_FUNCTION_CALLED&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;  include mbdconwf.&lt;/P&gt;&lt;P&gt;  data : it_emp_data like zsach1 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;  data : gen_data like zsach1 .&lt;/P&gt;&lt;P&gt;  workflow_result = c_wf_result_ok.&lt;/P&gt;&lt;P&gt;data : counter type int4.select count( * ) from zsach1 into counter.&lt;/P&gt;&lt;P&gt;counter = counter + 1.  loop at idoc_contrl.    if idoc_contrl-mestyp ne 'ZSACH'.&lt;/P&gt;&lt;P&gt;      raise wrong_function_called.&lt;/P&gt;&lt;P&gt;    endif.    clear gen_data.&lt;/P&gt;&lt;P&gt;    refresh it_emp_data.    loop at idoc_data where docnum eq idoc_contrl-docnum.      if idoc_data-segnam = 'ZSACH'.        gen_data = idoc_data-sdata.          it_emp_data-mandt = counter.&lt;/P&gt;&lt;P&gt;          it_emp_data-lname = gen_data-lname.&lt;/P&gt;&lt;P&gt;          it_emp_data-fname = gen_data-fname.          counter = counter + 1.        append it_emp_data.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        message 'ERROR' type 'I'.&lt;/P&gt;&lt;P&gt;      endif.    endloop.  endloop.insert zsach1 from table it_emp_data.&lt;/P&gt;&lt;P&gt;*****&lt;/P&gt;&lt;P&gt;call function 'EDI_DOCUMENT_OPEN_FOR_EDIT'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    document_number               = idoc_data-docnum&lt;/P&gt;&lt;P&gt;  importing&lt;/P&gt;&lt;P&gt;    idoc_control                  = idoc_contrl&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    idoc_data                     = idoc_data&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    document_foreign_lock         = 1&lt;/P&gt;&lt;P&gt;    document_not_exist            = 2&lt;/P&gt;&lt;P&gt;    document_not_open             = 3&lt;/P&gt;&lt;P&gt;    status_is_unable_for_changing = 4&lt;/P&gt;&lt;P&gt;    others                        = 5.call function 'EDI_CHANGE_DATA_SEGMENTS'&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    idoc_changed_data_range = idoc_data&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    idoc_not_open           = 1&lt;/P&gt;&lt;P&gt;    data_record_not_exist   = 2&lt;/P&gt;&lt;P&gt;    others                  = 3.&lt;/P&gt;&lt;P&gt;data t_itab_edids40 like edi_ds40 occurs 0 with header line.clear t_itab_edids40.&lt;/P&gt;&lt;P&gt;t_itab_edids40-docnum      = idoc_data-docnum.&lt;/P&gt;&lt;P&gt;t_itab_edids40-status      = '51'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-repid       = sy-repid.&lt;/P&gt;&lt;P&gt;t_itab_edids40-tabnam      = 'EDI_DS'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-mandt       = sy-mandt.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stamqu      = 'SAP'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stamid      = 'B1'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stamno      = '999'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stapa1      = 'Sold to changed to '.&lt;/P&gt;&lt;P&gt;*t_itab_edids40-stapa2      = t_new_kunnr.&lt;/P&gt;&lt;P&gt;t_itab_edids40-logdat      = sy-datum.&lt;/P&gt;&lt;P&gt;t_itab_edids40-logtim      = sy-uzeit.append t_itab_edids40.call function 'EDI_DOCUMENT_CLOSE_EDIT'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    document_number  = idoc_data-docnum&lt;/P&gt;&lt;P&gt;    do_commit        = 'X'&lt;/P&gt;&lt;P&gt;    do_update        = 'X'&lt;/P&gt;&lt;P&gt;    write_all_status = 'X'&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    status_records   = t_itab_edids40&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    idoc_not_open    = 1&lt;/P&gt;&lt;P&gt;    db_error         = 2&lt;/P&gt;&lt;P&gt;    others           = 3.endfunction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the Application  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sender system &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute the program we created earlier  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the IDOC  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T Code WE02  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the data on the Receiver end  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode: WE02  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IDOC has arrived here  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the Data   &lt;/P&gt;&lt;P&gt;Double click on the IDOC   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the Database  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, the data has come to the receiver end successfully.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF HELPFULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Nov 2007 07:46:19 GMT</pubDate>
    <dc:creator>mahaboob_pathan</dc:creator>
    <dc:date>2007-11-16T07:46:19Z</dc:date>
    <item>
      <title>problem in creating idocs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075021#M729105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;While creating idocs I created logical system using SPRO,then created RFC then Port but when i am creating partner profiles I am unable to get the destination system which I have created.Could any one guide me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 07:01:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075021#M729105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T07:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem in creating idocs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075022#M729106</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;Do like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GOTO WE20 TCODE-&amp;gt;then press on logical system,Press on create button and then give the logical system name of ur destination server and then press on save button..It will be created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 07:18:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075022#M729106</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-11-16T07:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem in creating idocs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075023#M729107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;below is scenario for ALE/IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALE-IDOC Scenario using Custom IDOC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aim: Transfer the data from one system to another using user customized IDOC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sender System:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Server: 172.25.8.185 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client: 200 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data from Z table: zsach1  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ReceiverSystem: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Server: 172.25.9.198 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client: 800 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data from Z table: zsach1  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data is fetched from Z table on the sender system and inserted it in the Z table of Receiver system using ALE/IDOC.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Settings on the Sender End  &lt;/P&gt;&lt;P&gt;Table Creation T &amp;#150; Code SE11. The table contains data that is to be sent to Receiver.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALE Configuration  &lt;/P&gt;&lt;P&gt;T-Code &amp;#150; SALE  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Logical System  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;200 is our sender &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 is our receiver  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assigning Client to Logical System  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;200 is our sender &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 is our receiver  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Target System for RFC Calls (Tcode &amp;#150; SM59) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on R/3 Connections and then Create TAB  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and test the connection.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Port  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sender system is connected to the receiver system through this Port. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Partner Profiles  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The partner for client 200(Sender) is the client 800 (Receiver)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this is a sender we have to define only Outbound Parameters in this case. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can see the Message type is Z message type.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.                   Maintaining Distribution Model ( TCode BD64 )  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create new Distribution Model  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add Message Type  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Distribute this Model View   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Distribute it from Edit à Model View à Distribute&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining the Z Segment type &lt;/P&gt;&lt;P&gt;Tcode &amp;#150; WE31  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining the Basic Type &lt;/P&gt;&lt;P&gt;T Code WE30  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on New  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will take you to next screen as follows  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you have connected the basic type to the segment type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Enter again and this will take you to screen as follows   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shows the relation between the basic and the segment types.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next you need to make the entry of the segment in the system table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode : WE81  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next is the following entry which is required.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you are specifying the message type and the basic type and the release version.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is all about the configuration you need to do on the sender side. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now on the sender side you also need a program that will fetch the required data, couple it in the IDOC format and post it.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a small piece of code that could be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZSACH_CUST_IDOC                                             *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*report  zsach_cust_idoc                         .&lt;/P&gt;&lt;P&gt;parameters :            p_logsys like tbdlst-logsys.data : gen_segment like edidd-segnam value 'ZSACH'.data : control_dat like edidc,&lt;/P&gt;&lt;P&gt;      gen_data like z1hdr .tables :zsach1.data: begin of inttab occurs 0,&lt;/P&gt;&lt;P&gt;        lname type z1hdr-lname,&lt;/P&gt;&lt;P&gt;        fname type z1hdr-fname,&lt;/P&gt;&lt;P&gt;      end of inttab.&lt;/P&gt;&lt;P&gt;data :&lt;/P&gt;&lt;P&gt;      int_edidd like edidd occurs 0 with header line,&lt;/P&gt;&lt;P&gt;      int_edidc like edidc occurs 0 with header line.&lt;/P&gt;&lt;P&gt;select * from zsach1 into corresponding fields of table inttab.if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;  message 'no data' type 'I'.&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt;endif.control_dat-mestyp = 'ZSACH'.&lt;/P&gt;&lt;P&gt;control_dat-idoctp = 'ZSACH'.&lt;/P&gt;&lt;P&gt;control_dat-rcvprt = 'LS'.&lt;/P&gt;&lt;P&gt;control_dat-rcvprn =  p_logsys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at inttab.&lt;/P&gt;&lt;P&gt;  gen_data-lname = inttab-lname.&lt;/P&gt;&lt;P&gt;  gen_data-fname = inttab-fname.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; GEN_DATA-SSN = INTTAB-SSN.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; GEN_DATA-DOB = INTTAB-DOB.  int_edidd-segnam = gen_segment.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  int_edidd-sdata = gen_data.  append int_edidd.&lt;/P&gt;&lt;P&gt;endloop.call function 'MASTER_IDOC_DISTRIBUTE'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    master_idoc_control                  = control_dat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_TYPE                             = ''&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CHNUM                                = ''&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    communication_idoc_control           = int_edidc&lt;/P&gt;&lt;P&gt;    master_idoc_data                     = int_edidd 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;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  message id sy-msgid type sy-msgty number sy-msgno.&lt;/P&gt;&lt;P&gt;else.  loop at int_edidc.&lt;/P&gt;&lt;P&gt;    write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'IDOC GENERATED',int_edidc-docnum.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  commit work.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Settings on the receiver side.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ALE configuration is same as we did it on the sender side. Please refer to earlier pages.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The receiver specific differences are mentioned below.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T-Code &amp;#150; SALE  &lt;/P&gt;&lt;P&gt;200 is our sender &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 is our receiver  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps   &lt;/P&gt;&lt;P&gt;Defining Logical System (Same as sender) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assigning Client to Logical System (Same as sender) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Target System for RFC Calls (Tcode &amp;#150; SM59) (Same as sender) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Port(Same as sender)  &lt;/P&gt;&lt;P&gt;Defining Partner Profiles &amp;#150; Here we are accepting the data from Sender system. Hence we need to configure it as Inbound.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on the   sign above to go to next screen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the message type is to be created again as it was created on the sender side. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following steps are repeated, as done on the sender side, on the receiver end  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE30 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE31 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE82 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE81 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here on the receiver end, we need to specify a process code at the time of defining the partner profile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process code is something that has the logic defined about what to be done after receiving the IDOC.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our case, on receipt of the IDOC, we are updating the Z Table. i.e Inserting the data from the IDOC into the Z Table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating a Process Code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode &amp;#150; WE42   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic associated is coded in the Function Module which is specified in the Identification Field above.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the processing type is selected as Processing by Function Module as above.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function Module is specified in the following screen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To have your function Module in the above drop down list, the entry is to be made using the following transaction  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TCode &amp;#150; BD51  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the entry is done here, the function module appears in the drop down list in the previous stage. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also it is important to make the following entry &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode WE57  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Module will look something as below:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source Codefunction z_idoc_input_sach .&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD&lt;/P&gt;&lt;P&gt;*"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC&lt;/P&gt;&lt;P&gt;*"     VALUE(NO_APPLICATION_LOG) LIKE  SY-DATAR OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(MASSSAVEINFOS) LIKE  MASSSAVINF STRUCTURE  MASSSAVINF&lt;/P&gt;&lt;P&gt;*"       OPTIONAL&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT&lt;/P&gt;&lt;P&gt;*"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-APPL_VAR&lt;/P&gt;&lt;P&gt;*"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK&lt;/P&gt;&lt;P&gt;*"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      IDOC_CONTRL STRUCTURE  EDIDC&lt;/P&gt;&lt;P&gt;*"      IDOC_DATA STRUCTURE  EDIDD&lt;/P&gt;&lt;P&gt;*"      IDOC_STATUS STRUCTURE  BDIDOCSTAT&lt;/P&gt;&lt;P&gt;*"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR&lt;/P&gt;&lt;P&gt;*"      SERIALIZATION_INFO STRUCTURE  BDI_SER&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      WRONG_FUNCTION_CALLED&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;  include mbdconwf.&lt;/P&gt;&lt;P&gt;  data : it_emp_data like zsach1 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;  data : gen_data like zsach1 .&lt;/P&gt;&lt;P&gt;  workflow_result = c_wf_result_ok.&lt;/P&gt;&lt;P&gt;data : counter type int4.select count( * ) from zsach1 into counter.&lt;/P&gt;&lt;P&gt;counter = counter + 1.  loop at idoc_contrl.    if idoc_contrl-mestyp ne 'ZSACH'.&lt;/P&gt;&lt;P&gt;      raise wrong_function_called.&lt;/P&gt;&lt;P&gt;    endif.    clear gen_data.&lt;/P&gt;&lt;P&gt;    refresh it_emp_data.    loop at idoc_data where docnum eq idoc_contrl-docnum.      if idoc_data-segnam = 'ZSACH'.        gen_data = idoc_data-sdata.          it_emp_data-mandt = counter.&lt;/P&gt;&lt;P&gt;          it_emp_data-lname = gen_data-lname.&lt;/P&gt;&lt;P&gt;          it_emp_data-fname = gen_data-fname.          counter = counter + 1.        append it_emp_data.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        message 'ERROR' type 'I'.&lt;/P&gt;&lt;P&gt;      endif.    endloop.  endloop.insert zsach1 from table it_emp_data.&lt;/P&gt;&lt;P&gt;*****&lt;/P&gt;&lt;P&gt;call function 'EDI_DOCUMENT_OPEN_FOR_EDIT'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    document_number               = idoc_data-docnum&lt;/P&gt;&lt;P&gt;  importing&lt;/P&gt;&lt;P&gt;    idoc_control                  = idoc_contrl&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    idoc_data                     = idoc_data&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    document_foreign_lock         = 1&lt;/P&gt;&lt;P&gt;    document_not_exist            = 2&lt;/P&gt;&lt;P&gt;    document_not_open             = 3&lt;/P&gt;&lt;P&gt;    status_is_unable_for_changing = 4&lt;/P&gt;&lt;P&gt;    others                        = 5.call function 'EDI_CHANGE_DATA_SEGMENTS'&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    idoc_changed_data_range = idoc_data&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    idoc_not_open           = 1&lt;/P&gt;&lt;P&gt;    data_record_not_exist   = 2&lt;/P&gt;&lt;P&gt;    others                  = 3.&lt;/P&gt;&lt;P&gt;data t_itab_edids40 like edi_ds40 occurs 0 with header line.clear t_itab_edids40.&lt;/P&gt;&lt;P&gt;t_itab_edids40-docnum      = idoc_data-docnum.&lt;/P&gt;&lt;P&gt;t_itab_edids40-status      = '51'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-repid       = sy-repid.&lt;/P&gt;&lt;P&gt;t_itab_edids40-tabnam      = 'EDI_DS'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-mandt       = sy-mandt.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stamqu      = 'SAP'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stamid      = 'B1'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stamno      = '999'.&lt;/P&gt;&lt;P&gt;t_itab_edids40-stapa1      = 'Sold to changed to '.&lt;/P&gt;&lt;P&gt;*t_itab_edids40-stapa2      = t_new_kunnr.&lt;/P&gt;&lt;P&gt;t_itab_edids40-logdat      = sy-datum.&lt;/P&gt;&lt;P&gt;t_itab_edids40-logtim      = sy-uzeit.append t_itab_edids40.call function 'EDI_DOCUMENT_CLOSE_EDIT'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    document_number  = idoc_data-docnum&lt;/P&gt;&lt;P&gt;    do_commit        = 'X'&lt;/P&gt;&lt;P&gt;    do_update        = 'X'&lt;/P&gt;&lt;P&gt;    write_all_status = 'X'&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    status_records   = t_itab_edids40&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    idoc_not_open    = 1&lt;/P&gt;&lt;P&gt;    db_error         = 2&lt;/P&gt;&lt;P&gt;    others           = 3.endfunction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the Application  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sender system &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute the program we created earlier  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the IDOC  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T Code WE02  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the data on the Receiver end  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tcode: WE02  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IDOC has arrived here  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the Data   &lt;/P&gt;&lt;P&gt;Double click on the IDOC   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the Database  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, the data has come to the receiver end successfully.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF HELPFULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 07:46:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-creating-idocs/m-p/3075023#M729107</guid>
      <dc:creator>mahaboob_pathan</dc:creator>
      <dc:date>2007-11-16T07:46:19Z</dc:date>
    </item>
  </channel>
</rss>

