Jun 13, 2012

Conversion of IDOC to XML format


By Suresh Parvathaneni and Narasimha Motupalli

This Tutorial details about the step by step in conversion of IDOCs to XML format for further use in XI or any other application. It is assumed that the reader of this Tutorial has some knowledge in ALE, IDOCs and Change Pointers.

Scenario
Conversion of the Material IDOC (Message type: MATMAS) to XML format and store the same in the application server of SAP®.

Approach
Change pointers are used for sending IDOCs for master data like Material Master. To work with Change pointers, following two steps have to be performed:
  • Turn on change pointer update generally
  • Providing the message types to be included for change pointer updation.
 To do the above configurations:
TCode: SALE --> IDOC Interface / Application Link Enabling (SALE) --> Modeling and implementing Business Processes --> Master Data Distribution  --> Replication of Master Data
ALE Configuration Steps:
  1. Creation of logical system for the sender system.
  2. Assignment of logical system to the client.
  3. Create a logical system for the recipient
  4. Creation of RFC destination (Connection type:TCP/IP)
  
  1.  Creation of Model View (TCode: BD64).
  1. Save the Model View and Generate Partner Profiles.
  2. There might be a problem with the automatic Port creation. Creation of the port has to be done manually.
  3. Create an XML Port from the transaction WE21 (Port type: XML File).
Here directory is the path on the application server. The Function Module is used for file naming conventions. Any of the SAP® provided function modules could be used for this (Use F4 help to check on this) or create any custom function module for any other naming conventions.
In the outbound trigger tab, mention the RFC destination created earlier.
  
  1. Make an entry in the partner profile generated earlier for message type MATMAS.
  1. A background job need to be scheduled, for a periodic run (interval as required) for the program RBDMIDOC with the message type MATMAS.
  2. Depending on the settings in the partner profiles, it may be necessary to send IDocs directly by executing the program RSEOUT00 (if the setting is to “Collect IDocs”)
Test the above scenario by creating a material using MM01. An XML file would have been created in the directory specified in the XML port. The file could be downloaded onto the front-end system using the transaction CG3Y.



No comments :