<?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 iDoc in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587139#M863682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     I was new to iDoc..Can any one tell me the step by step to do the iDoc..How to customize the iDoc and use the inbuilt iDoc..Any inbuilt idoc there means plz tell the name and where we will see it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2008 06:09:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-25T06:09:11Z</dc:date>
    <item>
      <title>iDoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587139#M863682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     I was new to iDoc..Can any one tell me the step by step to do the iDoc..How to customize the iDoc and use the inbuilt iDoc..Any inbuilt idoc there means plz tell the name and where we will see it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 06:09:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587139#M863682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T06:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: iDoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587140#M863683</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;This material for ALE/IDOC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is ALE?&lt;/P&gt;&lt;P&gt;ALE stands for Application Link Enabling and is a remote connection technology allowing the decentralization of business processes by connecting decentralized systems together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using ALE, it is fairly easy to synchronize several SAP systems so that they contain the same data objects at anytime. These objects may be master data (customers, vendors, GL accounts, cost centers, ...) or transaction data (FI documents, purchase orders, ...). To enable the synchronization, ALE supports not only mass transfer of data between systems but also selective data transfers of objects changed since the last transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does it work?&lt;/P&gt;&lt;P&gt;Viewed from a high level perspective, the process is straight and simple: a sender system selects the data that needs to be distributed, packs it in a standard format and sends it to one or several receiving systems. When a receiving system gets the data, it unpacks the standard format and records the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, 3 layers are involved in this process: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An application layer which selects and records data in R/3. &lt;/P&gt;&lt;P&gt;A distribution layer which filters and converts data. &lt;/P&gt;&lt;P&gt;A communication layer which ensures the actual communication of records generated in a standard format. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The senders and receivers are determined thanks to a so-called distribution model which defines the transfer rules (who sends what to who?). The definition of the distribution model must be known by all systems involved (either as sender or receiver) and must consequently exist on all those systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Intermediate Document (IDoc)&lt;/P&gt;&lt;P&gt;The data transferred using ALE must have a SAP standard format to be understood from all partners in the communication. This format is the Intermediate Document (IDoc) which represents an intermediary structure between raw SAP data and EDI formats. This structure is not constant, it depends on the data to be transferred and SAP provides the structures for most SAP standard objects such as customers master data, sales orders, ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An IDoc with a specific structure is said to have a specific type. The IDoc type is nothing more than a version of a specific IDoc structure designed to contain data for a specific object type. For example, the IDoc type DEBMAS05 is the fifth version of a structure that represents a customer master data. The management of versions for IDocs structures is necessary because the objects evolve with time and tend to become more and more complex with new data fields or tables being added regularly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The conversion of raw data forth (for the sender system) and back (for the receiver system) to the IDoc format is also ensured by SAP standard function modules as long as you transfer standard objects. For non standard objects (enhancements), you must define your own IDoc structure and write your own conversion function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RFC connections&lt;/P&gt;&lt;P&gt;The data communication between the SAP servers may be done by several ways. The 2 most common ways are the transactional RFC and the file. The RFC connection is used to make a direct connection between servers while the file interface speaks for itself, it uses a file containing the IDocs from the sender system as input in the receiver(s) system(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The selection of a communication method is made though the ports configuration as we will see in the next section. For the purpose of this article, we are going to choose the most efficient method: the transactional RFC method. To set it up, we first need to define the RFC destinations of the partner systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An RFC destination may be seen as a set of settings necessary to connect to a system using the RFC protocol. These settings include the address and type of the partner system along with connection information such as the user ID and password to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The RFC destinations of all partners systems must be defined on all systems to include in the distribution model. The transaction to use for this purpose is SM59.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definition of the communication ports&lt;/P&gt;&lt;P&gt;The communication ports determine the type of data communication that must occur between systems. When the communication is to use the RFC protocol, transactional RFC ports must be created specifying the RFC destinations of the partner systems. Use transaction WE21 for this purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Partners profiles&lt;/P&gt;&lt;P&gt;In SAP, all partners systems involved in a distribution model have a profile. There exist several profile types such as customers profiles, vendors profiles, ... but this distinction between profiles is generally not necessary and you will create in most cases your partners profiles using a generic Logical System type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before entering the settings of the logical systems partners, you have to create them in customizing. Also, each system in the distribution model must be assigned in its own system its own logical system that represents it. This assignment is done at client level and not at system level. This is not easy to explain nor to understand so let's take a simple example. Let's consider we have a simple distribution model made up of a sender system (S01) and a receiver system (R01). We need to transfer data from S01 / client 100 to R01 / client 200. In both the systems, we will define the logical systems S01_100 and R01_200. But in sender system S01, the logical system S01_100 will be assigned to the client 100 while in the receiver system R01, it will be R01_200 that will be assigned to client 200. With such a configuration you see it is even possible to transfer data between two clients from the same system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A partner profile is used to determine a lot of important settings that will be involved in the data transfer. These settings vary depending on the role of the partner system (sender / receiver) and are defined per message type. A message type is more or less a version independent IDoc type. It is mainly a convenient way of defining settings and identifying IDocs using a criterium independent of the partner system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a sender partner system (inbound parameters are filled in), following important settings are set per message type in the partner profile:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A process code used to indicate which function module will be used to convert the IDoc data to SAP data. &lt;/P&gt;&lt;P&gt;The time of input of the IDoc: as soon as the IDoc is created in the system or on request (using program RBDAPP01). &lt;/P&gt;&lt;P&gt;The post processing agent who will have to treat the data input errors if need be. The post processing agent may be either a user or any other HR organizational unit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a receiver partner system (outbound parameters are filled in), following settings are specified in the partner profile:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The receiver port to which the data will be sent. &lt;/P&gt;&lt;P&gt;The sending method: one IDoc at a time or by packets. &lt;/P&gt;&lt;P&gt;The IDoc type that will be sent to that partner. For a given message type, the IDoc type sent may vary depending on the receiver system. Indeed you may have different versions of SAP in your system landscape. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definition of the distribution model and data filtering&lt;/P&gt;&lt;P&gt;We have already seen that the distribution model is used to decide who sends what to who. But, as you guessed, there is a little bit more to be said about it and the way to manage it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The distribution model is maintained in a central transaction (BD64) which lets you access the most useful environmental settings necessary to set up the model. Before creating the model, you must first decide on which system you are going to create it. Indeed the model must exist in all partners systems and two possibilities exist to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either you create the model on each system manually (with the same model technical name), which is feasible only with few systems and/or simple models. Either you create it in a specific system (usually the source system) and distribute it to the other systems thanks to the distribution command in the BD64 transaction menu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we want to copy the customers master data from the production system to the other systems in the maintenance line for example, we may create the distribution model on the production system and distribute it to all partners systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual creation of the model requests that you mention a technical name for the model (unique identifier in the systems landscape), a sender system, a receiver system and message types to exchange between those systems. You may afterwards add more sending and receiving systems in the model as well as more message types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each message type defined between a sender and a receiver, you may set filters on specific fields of the message type so that IDocs be generated only when these specific values are matched. For example, you may decide to send only customers of a specific account group. These filters are set by selecting the 'no filter set' text under message types in BD64.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There exists also another kind of filters which are segments filters. They do not filter IDocs creation based on values like we have just seen but filter unconditionally segments of created IDocs which must be excluded from the transfer (transaction BD56).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;This article will help you understand the basics of ALE and IDocs via a simple do-it-yourself example. We will create a custom IDoc in one SAP system and then post some business data through it to another SAP system. Business data will be picked up from custom data dictionary tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALE &amp;#150; Application Link Enabling is a mechanism by which SAP systems communicate with each other and with non-SAP EDI subsystems. Thus it helps integration of distributed systems. It supports fail-safe delivery which implies that sender system does not have to worry about message not reaching the source due to unavoidable situations. ALE can be used for migration and maintenance of master data as well as for exchanging transactional data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The messages that are exchanged are in the form of IDocs or Intermediate Documents. IDocs act like a container or envelope for the application data. An IDOC is created as a result of execution of an Outbound ALE. In an Inbound ALE an IDOC serves as an input to create application document. In the SAP system IDocs are stored in the database tables. They can be used for SAP to SAP and SAP to non-SAP process communication as long as the participating processes can understand the syntax and semantics of the data. Complete documentation on IDOC is obtained by using transaction WE60.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every IDoc has exactly one control record along with a number of data records and status records. Control record has the details of sender/receiver and other control information. Data records contain the actual business data to be exchanged while the status records are attached to IDoc throughout the process as the IDoc moves from one step to other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, let us understand the ALE Configuration by means of an example scenario below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Scenario&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data from custom tables (created in customer namespace) is to be formatted into an IDoc and sent from one SAP R/3 system to another using ALE service. We need to have two instances of SAP R/3 systems or we can simulate this on two clients of the same SAP R/3 system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create three tables as shown 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;Creating Custom IDoc type and Message type&lt;/P&gt;&lt;P&gt;All the objects created should be present on both source as well as target system(s). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create segments &amp;#150; Transaction WE31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a segment ZRZSEG1 &lt;/P&gt;&lt;P&gt;Add all fields of table ZCUSTOMERS to it &lt;/P&gt;&lt;P&gt;Save the segment &lt;/P&gt;&lt;P&gt;Release it using the menu path Edit -&amp;gt; Set Release &lt;/P&gt;&lt;P&gt;Similarly create two more segments given below &lt;/P&gt;&lt;P&gt;Seg. ZRZSEG2 &amp;#150; to hold all fields of table ZSOHEADERS &lt;/P&gt;&lt;P&gt;Seg. ZRZSEG3 &amp;#150; to hold all fields of table ZSOITEMS &lt;/P&gt;&lt;P&gt;2. Create Basic IDoc type &amp;#150; Transaction WE30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a Basic type ZRZORDER &lt;/P&gt;&lt;P&gt;Add the created segments in the hierarchy shown &lt;/P&gt;&lt;P&gt;Maintain attributes for each of the segments &lt;/P&gt;&lt;P&gt;Save the object and go back &lt;/P&gt;&lt;P&gt;Release the object using the menu path Edit -&amp;gt; Set Release &lt;/P&gt;&lt;P&gt;3. Create/Assign Message type &amp;#150; Transactions WE81/WE82&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to WE81 &lt;/P&gt;&lt;P&gt;Create a new Message type ZRZSO_MT &lt;/P&gt;&lt;P&gt;Save the object &lt;/P&gt;&lt;P&gt;Go to WE82 and create new entry &lt;/P&gt;&lt;P&gt;Assign the message type ZRZSO_MT to the basic type ZRZORDER &lt;/P&gt;&lt;P&gt;Also specify the Release Version &lt;/P&gt;&lt;P&gt;Save the object &lt;/P&gt;&lt;P&gt;Thus we have defined the IDoc structure which will hold the data to be transferred. In the [1] next part of the article we will understand the outbound settings, i.e. the settings to be done in the source system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outbound Settings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define Logical Systems and Assign Client to Logical System &amp;#150; Transaction SALE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to Define Logical System (See the figure) &lt;/P&gt;&lt;P&gt;Define a new logical system to identify the local system and save it &lt;/P&gt;&lt;P&gt;Now, go to Assign Client to Logical System (See the figure) &lt;/P&gt;&lt;P&gt;Add a new entry &lt;/P&gt;&lt;P&gt;Specify the client, previously created logical system and other attributes &lt;/P&gt;&lt;P&gt;Save the entry &lt;/P&gt;&lt;P&gt;Define a new logical system to identify the partner system and save it &lt;/P&gt;&lt;P&gt;Maintain RFC Destinations &amp;#150; Transaction SM59&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new RFC destination for R/3 type connection &lt;/P&gt;&lt;P&gt;Specify the target host on Technical settings tab &lt;/P&gt;&lt;P&gt;Provide the Logon credentials on the Logon/Security tab &lt;/P&gt;&lt;P&gt;Save the settings &lt;/P&gt;&lt;P&gt;To verify the settings, Click on Test connection or Remote logon &lt;/P&gt;&lt;P&gt;Define Ports &amp;#150; Transaction WE21&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to define a tRFC port for the partner system &lt;/P&gt;&lt;P&gt;Click on Transactional RFC node &lt;/P&gt;&lt;P&gt;Create a new port &lt;/P&gt;&lt;P&gt;Provide a description &lt;/P&gt;&lt;P&gt;Specify the name of the target RFC destination &lt;/P&gt;&lt;P&gt;Save the object &lt;/P&gt;&lt;P&gt;Maintain Distribution Model &amp;#150; Transaction BD64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on Change &lt;/P&gt;&lt;P&gt;Create a new model view &lt;/P&gt;&lt;P&gt;Provide a Short text and Technical name to the model view &lt;/P&gt;&lt;P&gt;Add message type &lt;/P&gt;&lt;P&gt;Specify sender and receiver systems &lt;/P&gt;&lt;P&gt;Also, specify the message type that we created previously &lt;/P&gt;&lt;P&gt;Save the Distribution model &lt;/P&gt;&lt;P&gt;Generate/Create Partner Profile &amp;#150; Transactions BD82/WE20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To generate Partner profiles automatically you may use BD82 or go to BD64 and use the menu path Environment -&amp;gt; Generate partner profiles &lt;/P&gt;&lt;P&gt;Otherwise, you may use transaction WE20 to create a partner profile &lt;/P&gt;&lt;P&gt;On selection screen, specify the model view, target system and execute &lt;/P&gt;&lt;P&gt;The result log will be displayed on the next screen &lt;/P&gt;&lt;P&gt;To verify the partner profile go to WE20 &lt;/P&gt;&lt;P&gt;Check the partner profile for the target system &lt;/P&gt;&lt;P&gt;Distribute Model View &amp;#150; Transaction BD64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the Model View &lt;/P&gt;&lt;P&gt;Go to menu path Edit -&amp;gt; Model View -&amp;gt; Distribute &lt;/P&gt;&lt;P&gt;Result log will be displayed on the next screen &lt;/P&gt;&lt;P&gt;Outbound IDoc Generation Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an executable program ZRZ_ORDER_IDOC in SE38. Below, I have described the program logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fetch the data from the DDic tables ZCUSTOMERS, ZSOHEADERS and ZSOITEMS as per the selection criteria &lt;/P&gt;&lt;P&gt;Fill the control record structure of type EDIDC &lt;/P&gt;&lt;P&gt;Specify message type, Basic IDoc type, tRFC Port, Partner number and Partner type of the receiver &lt;/P&gt;&lt;P&gt;Fill the data records &lt;/P&gt;&lt;P&gt;Define structures like the IDoc segments &lt;/P&gt;&lt;P&gt;Fill the structures with fetched data &lt;/P&gt;&lt;P&gt;Pass the segment name and the above structure to the appropriate fields of EDIDD type structure &lt;/P&gt;&lt;P&gt;Append the EDIDD structure to the EDIDD type internal table &lt;/P&gt;&lt;P&gt;Now, call the function module MASTER_IDOC_DISTRIBUTE and pass the IDoc control record structure and data record table &lt;/P&gt;&lt;P&gt;Commit work if return code is zero &lt;/P&gt;&lt;P&gt;Function module returns a table of type EDIDC to provide the details about generated IDoc &lt;/P&gt;&lt;P&gt;Display appropriate log &lt;/P&gt;&lt;P&gt;You can [2] download sample code for the above program here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus we have completed sender side configuration required for ALE. In the [3] next part we will see how to configure the receiving system to be able to receive and post the inbound IDoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inbound IDoc Posting Function Module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the receiving system, create a function module Z_IDOC_INPUT_ZRZSO_MT using SE37. Below, I have described the logic for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add Include MBDCONWF. This include contains predefined ALE constants.&lt;/P&gt;&lt;P&gt;Loop at EDIDC table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check if the message type is ZRZORDER. Otherwise raise WRONG_FUNCTION_CALLED exception &lt;/P&gt;&lt;P&gt;Loop at EDIDD table &lt;/P&gt;&lt;P&gt;Append data from the segments to appropriate internal tables &lt;/P&gt;&lt;P&gt;For example: append data from ZRZSEG1 segment to the internal table of type ZCUSTOMERS &lt;/P&gt;&lt;P&gt;Update the DDic tables from internal tables &lt;/P&gt;&lt;P&gt;Depending on the result of the update, fill the IDoc status record (type BDIDOCSTAT) and append it to the corresponding table. &lt;/P&gt;&lt;P&gt;Status 53 =&amp;gt; Success &lt;/P&gt;&lt;P&gt;Status 51 =&amp;gt; Error &lt;/P&gt;&lt;P&gt;You can [3] download the sample ABAP code for the above function module here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inbound Settings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define Logical Systems &amp;#150; Transaction SALE (Please refer to Outbound Settings discussed in [4] previous part) &lt;/P&gt;&lt;P&gt;Assign Client to Logical System &amp;#150; Transaction SALE (Please refer to Outbound Settings discussed in [5] previous part) &lt;/P&gt;&lt;P&gt;Maintain RFC Destinations &amp;#150; Transaction SM59 (Please refer to Outbound Settings discussed in [6] previous part) &lt;/P&gt;&lt;P&gt;Define Ports &amp;#150; Transaction WE21 (Please refer to Outbound Settings discussed in [7] previous part) &lt;/P&gt;&lt;P&gt;Generate/Create Partner Profile &amp;#150; Transactions BD82/WE20 (Please refer to Outbound Settings discussed in [8] previous part) &lt;/P&gt;&lt;P&gt;Assign Function Module to Logical message &amp;#150; Transaction WE57 &lt;/P&gt;&lt;P&gt;Create a new entry &lt;/P&gt;&lt;P&gt;Specify name of the Function Module as Z_IDOC_INPUT_ZRZSO_MT &lt;/P&gt;&lt;P&gt;Also, specify Type as F, Basic IDoc type as ZRZORDER, Message type as ZRZSO_MT and Direction as 2 (Inbound) &lt;/P&gt;&lt;P&gt;Save the entry &lt;/P&gt;&lt;P&gt;Define Input method for Inbound Function Module &amp;#150; Transaction BD51 &lt;/P&gt;&lt;P&gt;Create a new entry &lt;/P&gt;&lt;P&gt;Provide Function Module name as Z_IDOC_INPUT_ZRZSO_MT &lt;/P&gt;&lt;P&gt;Specify the Input method as 2 &lt;/P&gt;&lt;P&gt;Save the entry &lt;/P&gt;&lt;P&gt;Create a Process Code &amp;#150; Transaction WE42 &lt;/P&gt;&lt;P&gt;Create a new Process Code ZPCRZ &lt;/P&gt;&lt;P&gt;Select Processing with ALE Service &lt;/P&gt;&lt;P&gt;Choose Processing type as Processing by function module &lt;/P&gt;&lt;P&gt;Save the entry &lt;/P&gt;&lt;P&gt;On the next screen, select your function module from the list &lt;/P&gt;&lt;P&gt;Save the changes &lt;/P&gt;&lt;P&gt;Now you will be taken to the next screen &lt;/P&gt;&lt;P&gt;Double-click on Logical message &lt;/P&gt;&lt;P&gt;In the Assignment to logical message, specify the message type ZRZSO_MT &lt;/P&gt;&lt;P&gt;Save the changes &lt;/P&gt;&lt;P&gt;Send and receive data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the sender system, execute the IDoc Generation Program. Check the status of IDoc using transaction WE02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the status of the IDoc in the receiver system using transaction WE02. You can also check the contents of DDic tables to make sure that the records have been created in the receiver system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZRZ_ORDER_IDOC                                              *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZRZ_ORDER_IDOC                          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PURPOSE OF REPORT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Generats an Idoc for Customer Master, Sales Master&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and Sales item table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : ZCUSTOMERS, "Cutomer Header&lt;/P&gt;&lt;P&gt;         ZSOHEADERS, "Sales Header&lt;/P&gt;&lt;P&gt;         ZSOITEMS. "Sales Items&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : S_CTRL_REC LIKE EDIDC, "Idoc Control Record&lt;/P&gt;&lt;P&gt;       S_ZRZSEG1 LIKE ZRZSEG1, "CUSTOMER Header Data&lt;/P&gt;&lt;P&gt;       S_ZRZSEG2 LIKE ZRZSEG2, "SALES HEADER Data&lt;/P&gt;&lt;P&gt;       S_ZRZSEG3 LIKE ZRZSEG3. "SALES Detail Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : T_ZCUSTOMERS LIKE ZCUSTOMERS OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : T_ZSOHEADERS LIKE ZSOHEADERS OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : T_ZSOITEMS LIKE ZSOITEMS OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE."Data Records&lt;/P&gt;&lt;P&gt;DATA : T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;"Generated Communication IDOc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS :&lt;/P&gt;&lt;P&gt;C_ZRZSEG1 LIKE EDIDD-SEGNAM VALUE 'ZRZSEG1',&lt;/P&gt;&lt;P&gt;C_ZRZSEG2 LIKE EDIDD-SEGNAM VALUE 'ZRZSEG2',&lt;/P&gt;&lt;P&gt;C_ZRZSEG3 LIKE EDIDD-SEGNAM VALUE 'ZRZSEG3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: C_IDOCTP LIKE EDIDC-IDOCTP VALUE 'ZRZORDER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Selection Screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;SELECT-OPTIONS : S_KUNNR FOR ZCUSTOMERS-KUNNR OBLIGATORY,&lt;/P&gt;&lt;P&gt;                 S_VBELN FOR ZSOHEADERS-VBELN.&lt;/P&gt;&lt;P&gt;PARAMETERS :  C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZRZSO_MT',&lt;/P&gt;&lt;P&gt;              "Message Type&lt;/P&gt;&lt;P&gt;              C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS',&lt;/P&gt;&lt;P&gt;              "Partner type of receiver&lt;/P&gt;&lt;P&gt;              C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'Y901',&lt;/P&gt;&lt;P&gt;              C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'A000000226',&lt;/P&gt;&lt;P&gt;              C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'LSSENDS',&lt;/P&gt;&lt;P&gt;              C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'.&lt;/P&gt;&lt;P&gt;"Destination System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***START-OF-SELECTION&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  PERFORM GENERATE_DATA_RECORDS.&lt;/P&gt;&lt;P&gt;  PERFORM GENERATE_CONTROL_RECORD.&lt;/P&gt;&lt;P&gt;  PERFORM SEND_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;***********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  generate_data_records&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GENERATE_DATA_RECORDS .&lt;/P&gt;&lt;P&gt;  PERFORM FETCH_ZCUSTOMERS.&lt;/P&gt;&lt;P&gt;  PERFORM FETCH_ZSOHEADERS.&lt;/P&gt;&lt;P&gt;  PERFORM FETCH_ZSOITEMS.&lt;/P&gt;&lt;P&gt;  PERFORM ARRANGE_DATA_RECORDS.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " generate_data_records&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;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  fetch_zcustomers&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FETCH_ZCUSTOMERS.&lt;/P&gt;&lt;P&gt;  SELECT *&lt;/P&gt;&lt;P&gt;  FROM ZCUSTOMERS&lt;/P&gt;&lt;P&gt;  INTO TABLE T_ZCUSTOMERS&lt;/P&gt;&lt;P&gt;  WHERE KUNNR IN S_KUNNR.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE E398(00) WITH 'No Customers Found'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " fetch_zcustomers&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;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  fetch_zsoheaders&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FETCH_ZSOHEADERS.&lt;/P&gt;&lt;P&gt;  SELECT *&lt;/P&gt;&lt;P&gt;  FROM ZSOHEADERS&lt;/P&gt;&lt;P&gt;  INTO TABLE T_ZSOHEADERS&lt;/P&gt;&lt;P&gt;  WHERE VBELN IN S_VBELN&lt;/P&gt;&lt;P&gt;    AND KUNNR IN S_KUNNR.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE I398(00) WITH 'No Sales orders found'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " fetch_zsoheaders&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;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  fetch_zsoitems&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FETCH_ZSOITEMS.&lt;/P&gt;&lt;P&gt;  IF NOT T_ZSOHEADERS[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT *&lt;/P&gt;&lt;P&gt;    FROM ZSOITEMS&lt;/P&gt;&lt;P&gt;    INTO TABLE T_ZSOITEMS&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN T_ZSOHEADERS&lt;/P&gt;&lt;P&gt;    WHERE VBELN = T_ZSOHEADERS-VBELN.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;      MESSAGE I398(00) WITH 'No Sales order items found'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " fetch_zsoitems&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;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  generate_control_record&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GENERATE_CONTROL_RECORD .&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-MESTYP = C_MESTYP. "Message type&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type&lt;/P&gt;&lt;P&gt;  S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number&lt;/P&gt;&lt;P&gt;ENDFORM.                    " generate_control_record&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;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  send_idoc&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM SEND_IDOC.&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            = S_CTRL_REC&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      COMMUNICATION_IDOC_CONTROL     = T_COMM_IDOC&lt;/P&gt;&lt;P&gt;      MASTER_IDOC_DATA               = T_EDIDD&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;  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;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    COMMIT WORK.&lt;/P&gt;&lt;P&gt;    LOOP AT T_COMM_IDOC.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " send_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;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  arrange_data_records&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM ARRANGE_DATA_RECORDS .&lt;/P&gt;&lt;P&gt;  DATA: W_INDEX1 LIKE SY-TABIX,&lt;/P&gt;&lt;P&gt;        W_INDEX2 LIKE SY-TABIX.&lt;/P&gt;&lt;P&gt;  SORT T_ZCUSTOMERS BY KUNNR.&lt;/P&gt;&lt;P&gt;  SORT T_ZSOHEADERS BY KUNNR VBELN.&lt;/P&gt;&lt;P&gt;  SORT T_ZSOITEMS BY VBELN POSNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT T_ZCUSTOMERS.&lt;/P&gt;&lt;P&gt;    S_ZRZSEG1-KUNNR = T_ZCUSTOMERS-KUNNR.&lt;/P&gt;&lt;P&gt;    S_ZRZSEG1-NAME1 = T_ZCUSTOMERS-NAME1.&lt;/P&gt;&lt;P&gt;    S_ZRZSEG1-ORT01 = T_ZCUSTOMERS-ORT01.&lt;/P&gt;&lt;P&gt;    S_ZRZSEG1-LAND1 = T_ZCUSTOMERS-LAND1.&lt;/P&gt;&lt;P&gt;    T_EDIDD-SEGNAM = C_ZRZSEG1.&lt;/P&gt;&lt;P&gt;    T_EDIDD-SDATA = S_ZRZSEG1.&lt;/P&gt;&lt;P&gt;    APPEND T_EDIDD.&lt;/P&gt;&lt;P&gt;    CLEAR T_EDIDD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR W_INDEX1.&lt;/P&gt;&lt;P&gt;    READ TABLE T_ZSOHEADERS WITH KEY KUNNR = T_ZCUSTOMERS-KUNNR BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      W_INDEX1 = SY-TABIX.&lt;/P&gt;&lt;P&gt;      LOOP AT T_ZSOHEADERS FROM W_INDEX1.&lt;/P&gt;&lt;P&gt;        IF T_ZSOHEADERS-KUNNR NE T_ZCUSTOMERS-KUNNR.&lt;/P&gt;&lt;P&gt;          EXIT.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;        S_ZRZSEG2-VBELN = T_ZSOHEADERS-VBELN.&lt;/P&gt;&lt;P&gt;        S_ZRZSEG2-KUNNR = T_ZSOHEADERS-KUNNR.&lt;/P&gt;&lt;P&gt;        T_EDIDD-SEGNAM = C_ZRZSEG2.&lt;/P&gt;&lt;P&gt;        T_EDIDD-SDATA = S_ZRZSEG2.&lt;/P&gt;&lt;P&gt;        APPEND T_EDIDD.&lt;/P&gt;&lt;P&gt;        CLEAR T_EDIDD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CLEAR W_INDEX2.&lt;/P&gt;&lt;P&gt;        READ TABLE T_ZSOITEMS WITH KEY VBELN = T_ZSOHEADERS-VBELN BINARY SEARCH.&lt;/P&gt;&lt;P&gt;        IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;          W_INDEX2 = SY-TABIX.&lt;/P&gt;&lt;P&gt;          LOOP AT T_ZSOITEMS FROM SY-TABIX.&lt;/P&gt;&lt;P&gt;            IF T_ZSOITEMS-VBELN NE T_ZSOHEADERS-VBELN.&lt;/P&gt;&lt;P&gt;              EXIT.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;            S_ZRZSEG3-VBELN = T_ZSOITEMS-VBELN.&lt;/P&gt;&lt;P&gt;            S_ZRZSEG3-POSNR = T_ZSOITEMS-POSNR.&lt;/P&gt;&lt;P&gt;            S_ZRZSEG3-MATNR = T_ZSOITEMS-MATNR.&lt;/P&gt;&lt;P&gt;            S_ZRZSEG3-NETWR = T_ZSOITEMS-NETWR.&lt;/P&gt;&lt;P&gt;            S_ZRZSEG3-ZMENG = T_ZSOITEMS-ZMENG.&lt;/P&gt;&lt;P&gt;            T_EDIDD-SEGNAM = C_ZRZSEG3.&lt;/P&gt;&lt;P&gt;            T_EDIDD-SDATA = S_ZRZSEG3.&lt;/P&gt;&lt;P&gt;            APPEND T_EDIDD.&lt;/P&gt;&lt;P&gt;            CLEAR T_EDIDD.&lt;/P&gt;&lt;P&gt;          ENDLOOP.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " arrange_data_records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;S.Nehru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 06:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587140#M863683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T06:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: iDoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587141#M863684</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;See the scenario -Masterdata transfer :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;P&gt;MASTER DATA TRANSFERMATION BETWEEN 2 DIFF CLIENTS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	For this scenario Client 800 is the Sender and 810 is the receiving system&lt;/P&gt;&lt;P&gt;1. Creating Logical Systems&lt;/P&gt;&lt;P&gt;o	Login using 800 client&lt;/P&gt;&lt;P&gt;o	Go to T. Code SALE&lt;/P&gt;&lt;P&gt;o	Expand Sending and Receiving Systems&lt;/P&gt;&lt;P&gt;o	Expand Logical Systems&lt;/P&gt;&lt;P&gt;o	Click on Define Logical System&lt;/P&gt;&lt;P&gt;o	Click on New Entries&lt;/P&gt;&lt;P&gt;o	Create STUD_S, STUD_R Logical Systems&lt;/P&gt;&lt;P&gt;o	Save and come back&lt;/P&gt;&lt;P&gt;o	Assign the STUD_S Logical System to client 800&lt;/P&gt;&lt;P&gt;o	Assign the STUD_R Logical System to client 810&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Creating the RFCs&lt;/P&gt;&lt;P&gt;o	Go to T. Code SM59&lt;/P&gt;&lt;P&gt;o	Expand R/3 Connections&lt;/P&gt;&lt;P&gt;o	Enter RFC Name as STUD_S&lt;/P&gt;&lt;P&gt;o	Connection Type as 3&lt;/P&gt;&lt;P&gt;o	Language as EN&lt;/P&gt;&lt;P&gt;o	Client as 800&lt;/P&gt;&lt;P&gt;o	User as  SAPUSER&lt;/P&gt;&lt;P&gt;o	PWD as abap&lt;/P&gt;&lt;P&gt;o	Target host as sap&lt;/P&gt;&lt;P&gt;o	Click on Remote logon button to test the RFC&lt;/P&gt;&lt;P&gt;o	Enter RFC Name as STUD_R&lt;/P&gt;&lt;P&gt;o	Connection Type as 3&lt;/P&gt;&lt;P&gt;o	Language as EN&lt;/P&gt;&lt;P&gt;o	Client as 800&lt;/P&gt;&lt;P&gt;o	User as  SATISH&lt;/P&gt;&lt;P&gt;o	PWD as abap&lt;/P&gt;&lt;P&gt;o	Target host as sap&lt;/P&gt;&lt;P&gt;o	Click on Remote logon button to test the RFC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Creating the Message Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE81&lt;/P&gt;&lt;P&gt;o	Click on change, continue&lt;/P&gt;&lt;P&gt;o	Click on New Entries button&lt;/P&gt;&lt;P&gt;o	Give message type as ZBAPI_STUD_MAS and description&lt;/P&gt;&lt;P&gt;o	Save and back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Creating the Segment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE31&lt;/P&gt;&lt;P&gt;o	Give segment name as ZBAPI_STUD_SEG&lt;/P&gt;&lt;P&gt;o	Enter Short Text&lt;/P&gt;&lt;P&gt;o	Enter the Field Name and Data Element in the text boxes&lt;/P&gt;&lt;P&gt;o	Save, continue,&lt;/P&gt;&lt;P&gt;o	Click on Edit -&amp;gt; Set Release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Creating the Basic IDOC Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. code WE30&lt;/P&gt;&lt;P&gt;o	Give obj. name as ZBAPI_STUD_IDOC&lt;/P&gt;&lt;P&gt;o	Click on create&lt;/P&gt;&lt;P&gt;o	Select create new radio button, give description and continue&lt;/P&gt;&lt;P&gt;o	Select the IDOC obj name and click on create button&lt;/P&gt;&lt;P&gt;o	Enter the segment name which is create earlier&lt;/P&gt;&lt;P&gt;o	Select the check box if you want to make the segment mandatory&lt;/P&gt;&lt;P&gt;o	Enter 1 in minimum number 99999 in maximum number, continue&lt;/P&gt;&lt;P&gt;o	Save and back&lt;/P&gt;&lt;P&gt;o	Click on Edit -&amp;gt; Set Release&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. Creating Customer Distribution Model&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code BD64&lt;/P&gt;&lt;P&gt;o	Click on change and Create model view button&lt;/P&gt;&lt;P&gt;o	Enter the short text and Technical name as ZSTUDENT&lt;/P&gt;&lt;P&gt;o	Select the model and click on Add Message Type Button &lt;/P&gt;&lt;P&gt;o	Give the Sender as STUD_S, &lt;/P&gt;&lt;P&gt;o	               Receiver as STUD_R, &lt;/P&gt;&lt;P&gt;o	               Message Type as ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;o	Select the model view &amp;amp; click on Environment -&amp;gt; Generate Partner Profiles&lt;/P&gt;&lt;P&gt;o	Select Transfer IDOC Immediately and Trigger Immediately radio buttons&lt;/P&gt;&lt;P&gt;o	Click on Execute&lt;/P&gt;&lt;P&gt;o	You should get a list in green color which means it executed successfully.&lt;/P&gt;&lt;P&gt;o	Back to main screen, select the model view&lt;/P&gt;&lt;P&gt;o	Click Edit-&amp;gt;Model view-&amp;gt;Distribute&lt;/P&gt;&lt;P&gt;o	Click on continue&lt;/P&gt;&lt;P&gt;o	You should get a list saying model view is distributed successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. Checking the Port&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE21&lt;/P&gt;&lt;P&gt;o	Expand Transactional RFC&lt;/P&gt;&lt;P&gt;o	Find the port from the list which is created using BD64 for STUD_R (Receiving system) RFC Destination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. Checking the Partner Profiles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE20&lt;/P&gt;&lt;P&gt;o	Expand Partner Type LS&lt;/P&gt;&lt;P&gt;o	Select the Partner profile STUD_R&lt;/P&gt;&lt;P&gt;o	Double click on Message Type ZBAPI_STUD_MAS in Outbound parmtrs.&lt;/P&gt;&lt;P&gt;o	Check Receiver Port is assigned correctly&lt;/P&gt;&lt;P&gt;o	Check the Basic type as your Basic IDOC object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9. Assigning the Message Type to Basic IDOC Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE82&lt;/P&gt;&lt;P&gt;o	Click on Change &amp;amp; continue, New Entries button&lt;/P&gt;&lt;P&gt;o	Give the Message type as ZBAPI_STUD_MAS &lt;/P&gt;&lt;P&gt;o	Give Basic Type as ZBAPI_STUD_IDOC&lt;/P&gt;&lt;P&gt;o	Release as 46C&lt;/P&gt;&lt;P&gt;o	Save and back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10. Creating Inbound Function Module (Posting Program)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code SE37&lt;/P&gt;&lt;P&gt;o	Create a function Module IDOC_INPUT_ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;o	Set the Processing type as Remote Enabled Module and mode as start immed, in Attributes Tab.&lt;/P&gt;&lt;P&gt;o	Import Parameters&lt;/P&gt;&lt;P&gt;INPUT_METHOD	            LIKE	BDWFAP_PAR-INPUTMETHD&lt;/P&gt;&lt;P&gt;MASS_PROCESSING	LIKE	BDWFAP_PAR-MASS_PROC&lt;/P&gt;&lt;P&gt;NO_APPLICATION_LOG	LIKE	SY-DATAR&lt;/P&gt;&lt;P&gt;MASSSAVEINFOS	            LIKE	MASSSAVINF &lt;/P&gt;&lt;P&gt;o	Export Parameters&lt;/P&gt;&lt;P&gt;WORKFLOW_RESULT		LIKE	BDWF_PARAM-RESULT&lt;/P&gt;&lt;P&gt;APPLICATION_VARIABLE	LIKE	BDWF_PARAM-APPL_VAR&lt;/P&gt;&lt;P&gt;IN_UPDATE_TASK		LIKE	BDWFAP_PAR-UPDATETASK&lt;/P&gt;&lt;P&gt;CALL_TRANSACTION_DONE  LIKE	BDWFAP_PAR-CALLTRANS&lt;/P&gt;&lt;P&gt;o	Tables&lt;/P&gt;&lt;P&gt;IDOC_CONTRL	LIKE	EDIDC&lt;/P&gt;&lt;P&gt;IDOC_DATA		LIKE	EDIDD&lt;/P&gt;&lt;P&gt;IDOC_STATUS	LIKE	BDIDOCSTAT&lt;/P&gt;&lt;P&gt;RETURN_VARIABLES	LIKE	BDWFRETVAR&lt;/P&gt;&lt;P&gt;SERIALIZATION_INFO	LIKE	BDI_SER&lt;/P&gt;&lt;P&gt;o	Exceptions&lt;/P&gt;&lt;P&gt;WRONG_FUNCTION_CALLED&lt;/P&gt;&lt;P&gt;o	Source Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: FIRST_TRANC LIKE MARA_UEB-TRANC,&lt;/P&gt;&lt;P&gt;      ZBAPI_STUD_SEG like zbapi_stud.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ZBAPI_STUD LIKE ZBAPI_STUD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: I_ZBAPI_STUD LIKE ZBAPI_STUD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: C_TRUE                         VALUE 'X'.&lt;/P&gt;&lt;P&gt;  DATA: C_FALSE                        VALUE ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF T_IDOC_ROLLNO OCCURS 0,&lt;/P&gt;&lt;P&gt;        DOCNUM LIKE EDIDC-DOCNUM,&lt;/P&gt;&lt;P&gt;        ROLLNO LIKE ZBAPI_STUD-ROLLNO,&lt;/P&gt;&lt;P&gt;      END   OF T_IDOC_ROLLNO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DEFINE APPEND_RESFIELDS.&lt;/P&gt;&lt;P&gt;    PERFORM APPEND_RES_FIELDS TABLES T_MFIELDRES&lt;/P&gt;&lt;P&gt;                                     T_RES_FIELDS&lt;/P&gt;&lt;P&gt;                              USING  &amp;amp;1&lt;/P&gt;&lt;P&gt;                                     COUNTER-D_IND.&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: I_MARA_UEB LIKE MARA_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_ZSTUD_UEB LIKE ZBAPI_STUD.&lt;/P&gt;&lt;P&gt;  DATA: I_MAKT_UEB LIKE MAKT_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MARC_UEB LIKE MARC_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MARD_UEB LIKE MARD_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MFHM_UEB LIKE MFHM_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MARM_UEB LIKE MARM_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MEAN_UEB LIKE MEA1_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MBEW_UEB LIKE MBEW_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_STEU_UEB LIKE STEU_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_STEUMM_UEB LIKE STEUMM_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MLGN_UEB LIKE MLGN_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MLGT_UEB LIKE MLGT_UEB.      " //br010797 neu zu 4.0&lt;/P&gt;&lt;P&gt;  DATA: I_MPGD_UEB LIKE MPGD_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MPOP_UEB LIKE MPOP_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MVEG_UEB LIKE MVEG_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MVEU_UEB LIKE MVEU_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MVKE_UEB LIKE MVKE_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_MPRW_UEB LIKE MPRW_UEB.&lt;/P&gt;&lt;P&gt;  DATA: I_LTX1_UEB LIKE LTX1_UEB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: HELP_MARC_UEB LIKE MARC_UEB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: T_MARA_UEB LIKE MARA_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MAKT_UEB LIKE MAKT_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MARC_UEB LIKE MARC_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MARD_UEB LIKE MARD_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MFHM_UEB LIKE MFHM_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MARM_UEB LIKE MARM_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MEAN_UEB LIKE MEA1_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MBEW_UEB LIKE MBEW_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_STEU_UEB LIKE STEU_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_STEUMM_UEB LIKE STEUMM_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MLGN_UEB LIKE MLGN_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MLGT_UEB LIKE MLGT_UEB OCCURS 0.    " //br010797 neu zu 4.0&lt;/P&gt;&lt;P&gt;  DATA: T_MPGD_UEB LIKE MPGD_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MPOP_UEB LIKE MPOP_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MVEG_UEB LIKE MVEG_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MVEU_UEB LIKE MVEU_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MVKE_UEB LIKE MVKE_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MPRW_UEB LIKE MPRW_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_LTX1_UEB LIKE LTX1_UEB OCCURS 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal fields/ tables&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA: FLAG_ERROR_HAPPENED.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA: flag_material_exists. "//br210397 zu 4.0 keine Verwendung mehr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: FLAG_EXIT_TO_BE_DONE.&lt;/P&gt;&lt;P&gt;  DATA: HELP_TABIX LIKE SY-TABIX.&lt;/P&gt;&lt;P&gt;  DATA: HELP_TRANC LIKE MARA_UEB-TRANC.&lt;/P&gt;&lt;P&gt;  DATA: HELP_ALAND LIKE STEU_UEB-ALAND.&lt;/P&gt;&lt;P&gt;  DATA: HELP_VKORG LIKE MVKE-VKORG.&lt;/P&gt;&lt;P&gt;  DATA: HELP_WERKS LIKE T001W-WERKS.&lt;/P&gt;&lt;P&gt;  DATA: HELP_LFDNR LIKE STEU_UEB-LFDNR.&lt;/P&gt;&lt;P&gt;  DATA: LAST_MARC_TRANC LIKE MARA_UEB-TRANC.&lt;/P&gt;&lt;P&gt;  DATA: LAST_MLGN_TRANC LIKE MARA_UEB-TRANC.    " //br010797 neu zu 4.0&lt;/P&gt;&lt;P&gt;  DATA: LAST_TEXT_TRANC LIKE MARA_UEB-TRANC.&lt;/P&gt;&lt;P&gt;  DATA: CURRENT_TABIX LIKE SY-TABIX.&lt;/P&gt;&lt;P&gt;  DATA: GENERAL_SUBRC LIKE SY-SUBRC.&lt;/P&gt;&lt;P&gt;  DATA: HELP_FACTOR TYPE P DECIMALS 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: USER_SEGMENTS LIKE EDIDD OCCURS 0 WITH HEADER LINE.  " insert&lt;/P&gt;&lt;P&gt;  DATA: CUST_SEGMENT LIKE EDIDD.&lt;/P&gt;&lt;P&gt;  DATA: I_MFIELDRES LIKE MFIELDRES.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA: I_MERRDAT LIKE MERRDAT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: I_EDIDD LIKE EDIDD.&lt;/P&gt;&lt;P&gt;                                       " //br neu zu 3.1g&lt;/P&gt;&lt;P&gt;  DATA: T_RES_FIELDS LIKE DELFIELDS OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: T_MFIELDRES LIKE MFIELDRES OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_MERRDAT LIKE MERRDAT OCCURS 0.&lt;/P&gt;&lt;P&gt;  DATA: T_EDIDD LIKE EDIDD OCCURS 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA: BEGIN OF t_matnr OCCURS 0, "//br210397 zu 4.0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        matnr LIKE mara-matnr,   " wird nicht mehr verwendet&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      END OF t_matnr.            "&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: BEGIN OF COUNTER,&lt;/P&gt;&lt;P&gt;          TRANC LIKE MARA_UEB-TRANC,&lt;/P&gt;&lt;P&gt;          D_IND LIKE MARA_UEB-D_IND,&lt;/P&gt;&lt;P&gt;        END OF COUNTER.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA: BEGIN OF t_idoc_tranc OCCURS 0,                          " 4.0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        docnum LIKE edidc-docnum,                              "&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        tranc  LIKE mara_ueb-tranc,                            "&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      END OF t_idoc_tranc.                                     "&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA T_IDOC_TRANC LIKE MATIDOCTRANC OCCURS 0 WITH HEADER LINE."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: FLAG_FITS.&lt;/P&gt;&lt;P&gt;  DATA: APPLICATION_SUBRC LIKE SY-SUBRC.&lt;/P&gt;&lt;P&gt;  DATA FLAG_MUSS_PRUEFEN LIKE SY-DATAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA MAX_ERRORS LIKE T130S-ANZUM.    " 4.0&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;note 419281&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA : FLG_MASS.&lt;/P&gt;&lt;P&gt;  CLEAR : FLG_MASS.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: .            " 4.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ALE-distribution unity : IDOC status set by locking      "note0361838&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data:                                                     "note0361838&lt;/P&gt;&lt;P&gt;    it_dsp_idocstat like bdidocstat                         "note0361838&lt;/P&gt;&lt;P&gt;      occurs 0 with header line.                            "note0361838&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Initialize data - general&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  REFRESH T_MFIELDRES.&lt;/P&gt;&lt;P&gt;  REFRESH T_IDOC_TRANC.&lt;/P&gt;&lt;P&gt;  REFRESH T_IDOC_TRANC.                "JH/02.02.98/4.0C  KPr100004993&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REFRESH t_idoc_tranc_segment.   " //br 40 : unnötig&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REFRESH matnr_tranc.            "    -"-&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REFRESH t_matnr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  COUNTER-TRANC = 1.&lt;/P&gt;&lt;P&gt;  COUNTER-D_IND = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  REFRESH T_MARA_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MAKT_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MARC_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MARD_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MFHM_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MARM_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MEAN_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MBEW_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_STEU_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_STEUMM_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MLGN_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MLGT_UEB.                  " //br010797 neu zu 4.0&lt;/P&gt;&lt;P&gt;  REFRESH T_MPGD_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MPOP_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MVEG_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MVEU_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MVKE_UEB.&lt;/P&gt;&lt;P&gt;  REFRESH T_MPRW_UEB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; REFRESH VKORG_ALAND.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; REFRESH WERKS_ALAND.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR APPLICATION_SUBRC.&lt;/P&gt;&lt;P&gt;  REFRESH T_MERRDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if right function is called&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE IDOC_CONTRL INDEX 1.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    IF  IDOC_CONTRL-IDOCTP &amp;lt;&amp;gt; 'ZBAPI_STUD_IDOC'.&lt;/P&gt;&lt;P&gt;      RAISE WRONG_FUNCTION_CALLED.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  LOOP AT IDOC_CONTRL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Initialize data - per IDOC&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  t_idoc_tranc-docnum = counter-tranc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    T_IDOC_TRANC-DOCNUM = IDOC_CONTRL-DOCNUM.&lt;/P&gt;&lt;P&gt;    T_IDOC_TRANC-FIRST_TRANC_IDOC = COUNTER-TRANC + 2.&lt;/P&gt;&lt;P&gt;    APPEND T_IDOC_TRANC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Select segments which belong to IDOC&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    REFRESH T_EDIDD.&lt;/P&gt;&lt;P&gt;    LOOP AT IDOC_DATA WHERE DOCNUM = IDOC_CONTRL-DOCNUM.&lt;/P&gt;&lt;P&gt;      APPEND IDOC_DATA TO T_EDIDD.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   BUSINESS TRANSACTION EVENT (header / data)         "note0388000&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     call function 'OPEN_FI_PERFORM_MGV00200_E'         "note0388000&lt;/P&gt;&lt;P&gt;          exporting                                     "note0388000&lt;/P&gt;&lt;P&gt;              idoc_header       = idoc_contrl           "note0388000&lt;/P&gt;&lt;P&gt;              FLG_APPEND_STATUS = 'X'                   "note0388000&lt;/P&gt;&lt;P&gt;          tables                                        "note0388000&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;(DEL)       idoc_data         = idoc_data "note0388000 note0418561&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              idoc_data         = t_edidd               "note0418561&lt;/P&gt;&lt;P&gt;              idoc_status       = idoc_status           "note0388000&lt;/P&gt;&lt;P&gt;          exceptions                                    "note0388000&lt;/P&gt;&lt;P&gt;              others       = 1.                         "note0388000&lt;/P&gt;&lt;P&gt;     if sy-subrc = 1.                                   "note0388000&lt;/P&gt;&lt;P&gt;        continue.                                       "note0388000&lt;/P&gt;&lt;P&gt;     endif.                                             "note0388000&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Within one IDOC: loop through data segments:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Prepare internal tables for the current material&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT T_EDIDD INTO IDOC_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Transform from CoreData to Normal Data if necesary&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CASE IDOC_DATA-SEGNAM.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       WHEN 'E1MARAC'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*--COMMENTED BY SATISH&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       WHEN 'E1MAKTC'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         PERFORM MOVE_E1MAKTC_TO_E1MAKTM USING IDOC_DATA.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*--COMMENTES ENDED BY SATISH&lt;/P&gt;&lt;P&gt;         WHEN 'ZBAPI_STUD_SEG'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            CLEAR I_ZBAPI_STUD.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Second: Move E1MARAC into E1MARAM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            I_ZBAPI_STUD = IDOC_DATA-SDATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Third: Move E1MARAM back into IDOC-line&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            IDOC_DATA-SDATA =  I_ZBAPI_STUD.&lt;/P&gt;&lt;P&gt;            IDOC_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.&lt;/P&gt;&lt;P&gt;      ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CURRENT_TABIX = SY-TABIX.&lt;/P&gt;&lt;P&gt;      COUNTER-D_IND = COUNTER-D_IND + 1.&lt;/P&gt;&lt;P&gt;      COUNTER-TRANC = COUNTER-TRANC + 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CASE IDOC_DATA-SEGNAM.&lt;/P&gt;&lt;P&gt;         WHEN 'ZBAPI_STUD_SEG'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Initialize data - per material&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          COUNTER-D_IND = 1.&lt;/P&gt;&lt;P&gt;          FIRST_TRANC = COUNTER-TRANC.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        interpret segment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          ZBAPI_STUD_SEG = IDOC_DATA-SDATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          MOVE-CORRESPONDING ZBAPI_STUD TO I_ZSTUD_UEB.&lt;/P&gt;&lt;P&gt;          T_IDOC_ROLLNO-DOCNUM  = IDOC_CONTRL-DOCNUM.&lt;/P&gt;&lt;P&gt;          T_IDOC_ROLLNO-ROLLNO  = I_ZSTUD_UEB-ROLLNO.&lt;/P&gt;&lt;P&gt;          APPEND T_IDOC_ROLLNO.&lt;/P&gt;&lt;P&gt;       ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            if not ZBAPI_STUD_SEG is initial.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             ZBAPI_STUD-MANDT  = ZBAPI_STUD_SEG-MANDT.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             ZBAPI_STUD-ROLLNO = ZBAPI_STUD_SEG-ROLLNO.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             ZBAPI_STUD-FNAME  = ZBAPI_STUD_SEG-FNAME.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             ZBAPI_STUD-LNAME  = ZBAPI_STUD_SEG-LNAME.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              INSERT ZBAPI_STUD FROM ZBAPI_STUD_SEG.&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;*-- ALE ditribution unity : update IDOC status                "note03618&lt;/P&gt;&lt;P&gt;      LOOP AT it_dsp_idocstat.                                  "note036&lt;/P&gt;&lt;P&gt;         LOOP AT IDOC_STATUS WHERE DOCNUM = it_dsp_idocstat.    "note036&lt;/P&gt;&lt;P&gt;            DELETE idoc_status INDEX sy-tabix.                  "note036&lt;/P&gt;&lt;P&gt;         ENDLOOP.                                               "note036&lt;/P&gt;&lt;P&gt;         APPEND it_dsp_idocstat TO idoc_status.                 "note036&lt;/P&gt;&lt;P&gt;      ENDLOOP.                                                  "note036&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--GENERATING THE IDOC STATUS&lt;/P&gt;&lt;P&gt;  PERFORM HANDLE_ERROR_EXT             " //br40&lt;/P&gt;&lt;P&gt;              TABLES                                        "&lt;/P&gt;&lt;P&gt;                 IDOC_CONTRL                                "&lt;/P&gt;&lt;P&gt;                 IDOC_STATUS                                "&lt;/P&gt;&lt;P&gt;                 RETURN_VARIABLES                           "&lt;/P&gt;&lt;P&gt;                 T_MERRDAT                                  "&lt;/P&gt;&lt;P&gt;                 T_IDOC_TRANC                               "&lt;/P&gt;&lt;P&gt;                 T_IDOC_ROLLNO          "JH/4.0C/KPr100004993&lt;/P&gt;&lt;P&gt;              USING                                         "&lt;/P&gt;&lt;P&gt;                 GENERAL_SUBRC                              "&lt;/P&gt;&lt;P&gt;                 NO_APPLICATION_LOG                         "&lt;/P&gt;&lt;P&gt;                 MASSSAVEINFOS         "wk/40c&lt;/P&gt;&lt;P&gt;              CHANGING                                      "&lt;/P&gt;&lt;P&gt;                 WORKFLOW_RESULT.                           "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              PERFORM HANDLE_ERROR&lt;/P&gt;&lt;P&gt;                          TABLES&lt;/P&gt;&lt;P&gt;                             IDOC_CONTRL&lt;/P&gt;&lt;P&gt;                             IDOC_STATUS&lt;/P&gt;&lt;P&gt;                             RETURN_VARIABLES&lt;/P&gt;&lt;P&gt;                             T_MERRDAT&lt;/P&gt;&lt;P&gt;                             T_IDOC_ROLLNO     "JH/4.0C/KPr100004993&lt;/P&gt;&lt;P&gt;                          USING&lt;/P&gt;&lt;P&gt;                             APPLICATION_SUBRC&lt;/P&gt;&lt;P&gt;                          CHANGING&lt;/P&gt;&lt;P&gt;                             WORKFLOW_RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT T_IDOC_ROLLNO BY ROLLNO. "note 315124&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;React on general error&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: I_MERRDAT LIKE MERRDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF GENERAL_SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGTY = 'E'.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGID = SY-MSGID.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGNO = SY-MSGNO.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGV1 = SY-MSGV1.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGV2 = SY-MSGV2.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGV3 = SY-MSGV3.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGV4 = SY-MSGV4.&lt;/P&gt;&lt;P&gt;    APPEND I_MERRDAT TO T_MERRDAT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT T_MERRDAT INTO  I_MERRDAT&lt;/P&gt;&lt;P&gt;                    WHERE MSGTY = 'S'  "success&lt;/P&gt;&lt;P&gt;                    OR    MSGTY = 'D'  "dummy&lt;/P&gt;&lt;P&gt;                    OR    MSGTY = 'I'  "Information " //br011097 zu 3.1I&lt;/P&gt;&lt;P&gt;                    OR    MSGTY = 'H'  "dummy       " 4.0&lt;/P&gt;&lt;P&gt;                    OR    MSGTY = 'W'. "warning&lt;/P&gt;&lt;P&gt;    DELETE T_MERRDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&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;      Form  handle_error_ext&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM HANDLE_ERROR_EXT&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;           IDOC_CONTRL                   STRUCTURE EDIDC&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;           T_MERRDAT                     STRUCTURE MERRDAT&lt;/P&gt;&lt;P&gt;           IDOC_TRANC                    STRUCTURE MATIDOCTRANC&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;JH/02.02.98/4.0C  KPr100004993 (Anfang)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           T_IDOC_ROLLNO                 STRUCTURE T_IDOC_ROLLNO&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;JH/02.02.98/4.0C  KPr100004993 (Ende)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        USING&lt;/P&gt;&lt;P&gt;           GENERAL_SUBRC                 LIKE SY-SUBRC&lt;/P&gt;&lt;P&gt;           NO_APPLICATION_LOG            LIKE SY-DATAR&lt;/P&gt;&lt;P&gt;           MASSSAVEINFOS                 LIKE MASSSAVINF&lt;/P&gt;&lt;P&gt;        CHANGING&lt;/P&gt;&lt;P&gt;           WORKFLOW_RESULT               LIKE BDWF_PARAM-RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA FLAG_ERROR_HAPPENED.&lt;/P&gt;&lt;P&gt;  DATA I_MERRDAT LIKE MERRDAT.&lt;/P&gt;&lt;P&gt;  DATA IDOC_INDEX_2_SUBRC LIKE SY-SUBRC.&lt;/P&gt;&lt;P&gt;  DATA AL_HANDLES TYPE BAL_T_LOGH. "//br99&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT T_IDOC_ROLLNO BY ROLLNO.                        "note 315124&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;React on general error&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF GENERAL_SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    REFRESH T_MERRDAT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  i_merrdat-tranc = 0.                              " //br261197&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    READ TABLE IDOC_TRANC INDEX 1.     " zu 40b&lt;/P&gt;&lt;P&gt;    I_MERRDAT-TRANC = IDOC_TRANC-FIRST_TRANC_IDOC.          "&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGTY = 'E'.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGID = SY-MSGID.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGNO = SY-MSGNO.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGV1 = SY-MSGV1. I_MERRDAT-MSGV2 = SY-MSGV2.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGV3 = SY-MSGV3. I_MERRDAT-MSGV4 = SY-MSGV4.&lt;/P&gt;&lt;P&gt;    APPEND I_MERRDAT TO T_MERRDAT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: C_TRUE,&lt;/P&gt;&lt;P&gt;      C_FALSE VALUE 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If error happened ==&amp;gt; Rollback whole work....&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY NA 'SDHWI'.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    FLAG_ERROR_HAPPENED = C_TRUE.&lt;/P&gt;&lt;P&gt;    ROLLBACK WORK.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    FLAG_ERROR_HAPPENED = C_FALSE.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;----------------------------------------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set IDOC status&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;two cases:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;single IDOC-processing: ==&amp;gt; error can be written in IDOC status&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;package processing ==&amp;gt; anononymous "package error" for all IDOCs&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;----------------------------------------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE IDOC_CONTRL INDEX 2.&lt;/P&gt;&lt;P&gt;  IDOC_INDEX_2_SUBRC = SY-SUBRC.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    IF 1 = 2.                          "//br40&lt;/P&gt;&lt;P&gt;      MESSAGE E051(B1).                                     "&lt;/P&gt;&lt;P&gt;    ENDIF.                                                  "&lt;/P&gt;&lt;P&gt;    CLEAR I_MERRDAT.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGID = 'B1'.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGTY = 'E'.&lt;/P&gt;&lt;P&gt;    I_MERRDAT-MSGNO = '051'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF IDOC_INDEX_2_SUBRC NE 0 OR FLAG_ERROR_HAPPENED = C_FALSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Nur in diesen Fällen wird Application Log geschrieben&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Delete all Successes and Dummy records from t_merrdat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DELETE t_merrdat WHERE msgty = 'S'  "success         " testweise&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                   OR    msgty = 'D'. "dummy           "&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY = 'D'.     "&lt;/P&gt;&lt;P&gt;      I_MERRDAT-MSGTY = 'S'.                                "&lt;/P&gt;&lt;P&gt;      MODIFY T_MERRDAT FROM I_MERRDAT.                      "&lt;/P&gt;&lt;P&gt;    ENDLOOP.                                                "&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WORKFLOW_RESULT = 0.&lt;/P&gt;&lt;P&gt;  LOOP AT IDOC_CONTRL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set IDOC status&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLEAR IDOC_STATUS.&lt;/P&gt;&lt;P&gt;    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.&lt;/P&gt;&lt;P&gt;    IF FLAG_ERROR_HAPPENED = C_FALSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Application log&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC&lt;/P&gt;&lt;P&gt;                                    T_MERRDAT&lt;/P&gt;&lt;P&gt;                                    IDOC_STATUS&lt;/P&gt;&lt;P&gt;                             USING  IDOC_CONTRL&lt;/P&gt;&lt;P&gt;                                    FLAG_ERROR_HAPPENED&lt;/P&gt;&lt;P&gt;                                    NO_APPLICATION_LOG&lt;/P&gt;&lt;P&gt;                                    MASSSAVEINFOS&lt;/P&gt;&lt;P&gt;                                    AL_HANDLES.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    idoc_status-status = '53'.       "OK!&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    APPEND idoc_status.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;JH/02.02.98/4.0C  KPr100004993 (Anfang)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Fill Return variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CLEAR RETURN_VARIABLES.&lt;/P&gt;&lt;P&gt;      RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.&lt;/P&gt;&lt;P&gt;      RETURN_VARIABLES-WF_PARAM = 'Processed_IDOCs'.&lt;/P&gt;&lt;P&gt;      APPEND RETURN_VARIABLES.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Verknüpfungseintrag anlegen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ TABLE T_IDOC_ROLLNO WITH KEY ROLLNO = IDOC_CONTRL-DOCNUM&lt;/P&gt;&lt;P&gt;                              BINARY SEARCH.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        RETURN_VARIABLES-DOC_NUMBER = T_IDOC_ROLLNO-ROLLNO.&lt;/P&gt;&lt;P&gt;        RETURN_VARIABLES-WF_PARAM = 'Appl_Objects'.&lt;/P&gt;&lt;P&gt;        APPEND RETURN_VARIABLES.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;JH/02.02.98/4.0C  KPr100004993 (Ende)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      IF IDOC_INDEX_2_SUBRC NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Application Log&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC&lt;/P&gt;&lt;P&gt;                                      T_MERRDAT&lt;/P&gt;&lt;P&gt;                                      IDOC_STATUS&lt;/P&gt;&lt;P&gt;                               USING  IDOC_CONTRL&lt;/P&gt;&lt;P&gt;                                      FLAG_ERROR_HAPPENED&lt;/P&gt;&lt;P&gt;                                      NO_APPLICATION_LOG&lt;/P&gt;&lt;P&gt;                                      MASSSAVEINFOS&lt;/P&gt;&lt;P&gt;                                      AL_HANDLES.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGID = I_MERRDAT-MSGID.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGTY = I_MERRDAT-MSGTY.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGNO = I_MERRDAT-MSGNO.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGV1 = I_MERRDAT-MSGV1.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGV2 = I_MERRDAT-MSGV2.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGV3 = I_MERRDAT-MSGV3.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-MSGV4 = I_MERRDAT-MSGV4.&lt;/P&gt;&lt;P&gt;        IDOC_STATUS-STATUS = '51'.     "ERROR!&lt;/P&gt;&lt;P&gt;        APPEND IDOC_STATUS.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Fill Return variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CLEAR RETURN_VARIABLES.&lt;/P&gt;&lt;P&gt;      RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    return_variables-wf_param = c_wf_par_processed_idocs.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      RETURN_VARIABLES-WF_PARAM = 'Error_IDOCs'.&lt;/P&gt;&lt;P&gt;      APPEND RETURN_VARIABLES.&lt;/P&gt;&lt;P&gt;      WORKFLOW_RESULT = 99999.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  APPEND idoc_status.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NO_APPLICATION_LOG IS INITIAL.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAL_DB_SAVE'                           "//br99&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              I_IN_UPDATE_TASK = ' '&lt;/P&gt;&lt;P&gt;              I_SAVE_ALL       = ' '&lt;/P&gt;&lt;P&gt;              I_T_LOG_HANDLE   = AL_HANDLES.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            LOG_NOT_FOUND    = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            SAVE_NOT_ALLOWED = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            NUMBERING_ERROR  = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            OTHERS           = 4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAL_GLB_MEMORY_REFRESH'                "//br99&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            I_AUTHORIZATION          =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              I_REFRESH_ALL            = ' '&lt;/P&gt;&lt;P&gt;              I_T_LOGS_TO_BE_REFRESHED = AL_HANDLES.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            NOT_AUTHORIZED           = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            OTHERS                   = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                               " handle_error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save, check and activate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11. Assigning the Inbound Function Module to Basic Type &amp;amp; Message Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE57&lt;/P&gt;&lt;P&gt;o	Click on change, continue, continue and New Entries Button&lt;/P&gt;&lt;P&gt;o	Enter the Module as IDOC_INPUT_ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;o	Type as &amp;#147;F&amp;#148;&lt;/P&gt;&lt;P&gt;o	Basic Type as ZBAPI_STUD_IDOC&lt;/P&gt;&lt;P&gt;o	Message Type as ZBAPI_STUD_MAS.&lt;/P&gt;&lt;P&gt;o	Direction as 2&lt;/P&gt;&lt;P&gt;o	Save and back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Login in 810 client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12. Assigning the Inbound Function Module in ALE Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code BD51&lt;/P&gt;&lt;P&gt;o	Click on continue, New Entries button&lt;/P&gt;&lt;P&gt;o	Give the Inbound Function Module IDOC_INPUT_ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;o	Give Input t. as 0 (zero)&lt;/P&gt;&lt;P&gt;o	Save and back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13. Creating Process Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE42&lt;/P&gt;&lt;P&gt;o	Click on Change, New Entries Button&lt;/P&gt;&lt;P&gt;o	Give Process Code name as ZSTUD, give Description &amp;amp; Save&lt;/P&gt;&lt;P&gt;o	Select Processing with ALE Services Radio button&lt;/P&gt;&lt;P&gt;o	Select Processing by Function Module Radio button&lt;/P&gt;&lt;P&gt;o	Click the ALE Table (arrow Icon) in Identification&lt;/P&gt;&lt;P&gt;o	Give the Function Module Name ZIDOC_INPUT_ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;o	Give maximum number of repeats 0&lt;/P&gt;&lt;P&gt;o	Save and back, back&lt;/P&gt;&lt;P&gt;o	Select the process code from the list &amp;amp; click on Logical Messages Icon&lt;/P&gt;&lt;P&gt;o	Give the Message Type as ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;o	Save &amp;amp; Back, Save &amp;amp; Back, Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14. Changing the Customer Distribution model in Receiving system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code BD64&lt;/P&gt;&lt;P&gt;o	Click on change and Create model view button&lt;/P&gt;&lt;P&gt;o	Select the model view &amp;amp; click on Environment -&amp;gt; Generate Partner Profiles&lt;/P&gt;&lt;P&gt;o	Select Transfer IDOC Immediately and Trigger Immediately radio buttons&lt;/P&gt;&lt;P&gt;o	Click on Execute&lt;/P&gt;&lt;P&gt;o	You should get a list in green color which means it executed successfully.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;15. Assigning the Process Code to Message Type in Receiving System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o	Go to T. Code WE20&lt;/P&gt;&lt;P&gt;o	Expand Partner Type LS&lt;/P&gt;&lt;P&gt;o	Select the Partner Profile STUD_S&lt;/P&gt;&lt;P&gt;o	Double click on Message Type ZBAPI_STUD_MAS in Inbound parmtrs.&lt;/P&gt;&lt;P&gt;o	Give the Process Code as ZSTUD&lt;/P&gt;&lt;P&gt;o	Click on Trigger Immediately Radio button&lt;/P&gt;&lt;P&gt;o	Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;o	Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16. Creating the Selection Program (Outbound Program)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	Login in client 800.&lt;/P&gt;&lt;P&gt;&amp;#149;	Go to T. Code SE38&lt;/P&gt;&lt;P&gt;&amp;#149;	Create a Report Program as   ZSTUD_SEND with the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZSTUD_SEND&lt;/P&gt;&lt;P&gt;       NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: ZBAPI_STUD.&lt;/P&gt;&lt;P&gt;DATA: IT_STUD LIKE ZBAPI_STUD OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: S_ROLLNO FOR ZBAPI_STUD-ROLLNO.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN SKIP.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN:BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-H02.&lt;/P&gt;&lt;P&gt;PARAMETERS:  P_MESTYP LIKE EDIDC-MESTYP,&lt;/P&gt;&lt;P&gt;             P_RCVPRN LIKE TBDLST-LOGSYS.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN:END OF BLOCK B2.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN:END OF BLOCK B1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  PERFORM CREATE_STUDENT.&lt;/P&gt;&lt;P&gt;  PERFORM CREATE_IDOC.&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;      Form  CREATE_STUDENT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      sending student&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM CREATE_STUDENT.&lt;/P&gt;&lt;P&gt;SELECT * FROM ZBAPI_STUD&lt;/P&gt;&lt;P&gt;   INTO TABLE IT_STUD&lt;/P&gt;&lt;P&gt;   WHERE ROLLNO IN S_ROLLNO.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " CREATE_STUDENT&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;      Form  CREATE_IDOC&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      IDOC Creation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM CREATE_IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : IMAS_DATA LIKE EDIDD OCCURS 10 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       IMAS_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       ICOM_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMAS_CON-RCVPRT = 'LS'.&lt;/P&gt;&lt;P&gt;IMAS_CON-RCVPRN = P_RCVPRN.&lt;/P&gt;&lt;P&gt;IMAS_CON-IDOCTP = 'ZBAPI_STUD_IDOC'.&lt;/P&gt;&lt;P&gt;IMAS_CON-MESTYP = P_MESTYP.&lt;/P&gt;&lt;P&gt;IMAS_CON-DIRECT = 1.&lt;/P&gt;&lt;P&gt;APPEND IMAS_CON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_STUD.&lt;/P&gt;&lt;P&gt;  IMAS_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.&lt;/P&gt;&lt;P&gt;  IMAS_DATA-SDATA = IT_STUD.&lt;/P&gt;&lt;P&gt;  APPEND IMAS_DATA.&lt;/P&gt;&lt;P&gt;ENDLOOP.&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            = IMAS_CON&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     = ICOM_CON&lt;/P&gt;&lt;P&gt;          MASTER_IDOC_DATA               = IMAS_DATA&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        ERROR_IN_IDOC_CONTROL          = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        ERROR_WRITING_IDOC_STATUS      = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        ERROR_IN_IDOC_DATA             = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        SENDING_LOGICAL_SYSTEM_UNKNOWN = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        OTHERS                         = 5&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT  ICOM_CON.&lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'IDOC: ', ICOM_CON-DOCNUM, 'CREATED SUCCESSFULLY'.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " CREATE_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;17. Transferring the student records from 800 to 810 client &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	Execute Report Program   ZSTUD_SEND&lt;/P&gt;&lt;P&gt;&amp;#149;	Give the Range of Roll Nos to Transfer&lt;/P&gt;&lt;P&gt;&amp;#149;	Give Message Type as    ZBAPI_STUD_MAS&lt;/P&gt;&lt;P&gt;&amp;#149;	Give Receiver Logical system as   STUD_R&lt;/P&gt;&lt;P&gt;&amp;#149;	Execute&lt;/P&gt;&lt;P&gt;&amp;#149;	You should get the IDOC Number&lt;/P&gt;&lt;P&gt;&amp;#149;	Take the IDOC Number and go to T. Code WE05 &amp;amp; Execute&lt;/P&gt;&lt;P&gt;&amp;#149;	In Outbox you can see the IDOC Status&lt;/P&gt;&lt;P&gt;&amp;#149;	Select the status record in left side window&lt;/P&gt;&lt;P&gt;&amp;#149;	Double click on the Status record in right side window&lt;/P&gt;&lt;P&gt;&amp;#149;	You can see the Control Record, Data Record and Status Records for that IDOC&lt;/P&gt;&lt;P&gt;&amp;#149;	If the ICON is green and the status code is 3, it means the IDOC is passed to PORT Successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Login in 810 client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	Go to T. Code WE05 &amp;amp; Execute&lt;/P&gt;&lt;P&gt;&amp;#149;	You can see the status record in left side window&lt;/P&gt;&lt;P&gt;&amp;#149;	If the status no is 53 and color is green, it means the IDOC is Posted to Application successfully.&lt;/P&gt;&lt;P&gt;&amp;#149;	You can see the Log Information by double clicking on the status record in right side window.&lt;/P&gt;&lt;P&gt;&amp;#149;	Now in left side window, you can see the Control Record, Data Record &amp;amp; Status Record of the IDOC&lt;/P&gt;&lt;P&gt;&amp;#149;	Now go to T. Code SE16&lt;/P&gt;&lt;P&gt;&amp;#149;	Give the table name ZBAPI_STUD &amp;amp; press F7&lt;/P&gt;&lt;P&gt;&amp;#149;	See the contents of the table&lt;/P&gt;&lt;P&gt;&amp;#149;	The table is updated with the students records transferred from 800 client with our selection program.&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 useful &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jagadeesh.G&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 06:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3587141#M863684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T06:15:45Z</dc:date>
    </item>
  </channel>
</rss>

