IDoc to File Scenario

14
IDoc to File Scenario 1 General Requirement 1.1 Introd uction  This document describes IDoc to file scenario in which an IDoc from an SAP system is converted into a Flat File and routed to the FTP Server via Exchange Infrastructure.   A business system representing Sender SAP system sends the IDoc to XI; XI converts the IDoc to Flat File and sends it to the receiving business system (FTP Server) by using an inbound File adapter.  1.2 Prerequis ites:   One Business System representing the sending R/3 is required to be configured of type 3 rd  party in SLD (System Landscape Directory).  FTP configuration should be in place to transfer the output file to desired location. 2 Configurations at the Sender System (SAP R/3)  This section describes all the configurations needed in the Sender SAP System (R3X) for sending an IDoc to XIR. 2.1 Create RFC Destinatio  Use TCode SM59 to create RFC Destination in R3X to connect to XI (XIR) system. RFC Destination in R3X: R3X_TO_XIR 2.2 Maintain Po rts  

Transcript of IDoc to File Scenario

IDoc to File Scenario1 General Requirement1.1 IntroductionThis document describes IDoc to file scenario in which an IDoc from an SAP system is converted into a Flat File and routed to the FTP Server via Exchange Infrastructure.A business system representing Sender SAP system sends the IDoc to XI; XI converts the IDoc to Flat File and sends it to the receiving business system (FTP Server) by using an inbound File adapter.1.2 Prerequisites: One Business System representing the sending R/3 is required to be configured of type 3rdparty in SLD (System Landscape Directory). FTP configuration should be in place to transfer the output file to desiredlocation.2 Configurations at the Sender System (SAP R/3)This section describes all the configurations needed in the Sender SAP System (R3X) for sending an IDoc to XIR.2.1 Create RFC DestinationUse TCode SM59 to create RFC Destination in R3X to connect to XI (XIR) system.RFC Destination in R3X:R3X_TO_XIR2.2 Maintain PortsUse TCode WE21 to create a tRFC Port. The RFC Destination created in the previous step should be assigned to this port.Port in R3X:SAPXIR2.3 Maintain Partner ProfileCreate a Partner Profile for the Receiver System (XIRCLNT100) using the T-Code WE20, with the following outbound parameters.Message type: MATMASIDoc Type: MATMAS05Receiver port: SAPXIR2.4 Create Distribution Model (BD64)Create model view and add Message type with followingSender System R3XCLNT100Receiver System XIRCLNT100Message type - MATMASDistribute the Model view.3 Configurations in the Integration ServerThis section gives an overview of all the configurations required in the Integration server. These settings are required for the XI system to receive the IDoc sent by the Sender SAP system.3.1 Create RFC DestinationUse TCode SM59 to create an RFC Destination of Type 3 in order to establish communication with the Sender SAP system.Sender RFC Destination in XIR:R3XCLNT1003.2 Create PortOn the Integration Server, create a port for IDoc communication using transaction IDX1.Ideally, the port name should be of the format SAPxxx, where xxx is the system id of the SAP system. The created port has to be bind with the RFC Destination of the Sender SAP system configured in the Step 3.1 above.Sender Port in XIR:SAPR3X3.3 Transaction IDX2This configuration step is used to import the metadata of the IDoc using the corresponding Business systems port as below.

4 Design the Scenario in the Integration Repository4.1 Import IDocsImport the IDoc from the Sender SAP system. Enter the details of the sender system as shown below.In this scenario, MATMAS.MATMAS05 is the outbound message type.Select the IDocs which are to be imported

Thus, the IDoc MATMAS.MATMAS05 (sender message type) is imported.4.2 Define Data TypeDefine a Data type resembling the structure of the inbound message (file structure), Data type resembling outbound structure is not required as Imported IDoc cab be used as Data type, Message type and Message Interface.4.3 Define Message TypeDefine a Message Type for the Data type created in Section 4.2.4.4 Define Message InterfaceDefine Inbound Message Interface for the Message Type created in Section 4.3. as below.4.5 Create Message MappingCreate the Message Mapping with Source message as MATMAS.MATMAS05 (Imported from R3X), Target message as MT_IB_MATMAS (created in section 4.3)

4.6 Define Interface MappingDefine Interface Mapping for the Mapping created in Section 4.55 Configure the Scenario in Integration DirectoryFollowing objects should be configured in the Integration Directory:5.1 Assign Business SystemA Business System represents the Sender SAP System in the system landscape directory. Assign the Sender Business System defined in the System Landscape directory in the Integration Directory.

Choose Assign Business System.Select the Business System corresponding to the Sender SAP System as defined in the System Landscape Directory and Click Finish (In this scenario R3X is the Sender System and hence is the Business System).5.2 Create New Business ServiceIn this scenario the Receiver System is a FTP Server. A Business Service representing the Receiver system should be created. Choose New Business Service as shown in the screenshot below.Add the Inbound Message Interface to the Business Service created.Message interface:MI_IB_MATMAS5.3 Create Receiver Communication ChannelCreate a receiver communication channel (File Adapter) under the Receiver Business Service (File_service).5.4 Create Receiver DeterminationReceiver Determination defines the possible receivers for a sender and an outbound interface combination. In Conditional Receivers specify a conditional argument whose value will be used to route the inbound message to the respective Service. Based on the value of a certain field in the incoming IDoc the conditional argument is evaluated and thus the receiver is determined and message is routed accordingly at runtime.

5.5 Create Interface DeterminationProvide the details Sender Service, inbound interface and the Receiver Service while creating the interface determinations.5.6 Create Receiver AgreementReceiver Agreement defines to which receiver the message, has to be routed.6. Testing the ScenarioAt the Sender systemGo to Transaction BD10, to send the Material from R3X to XIR. An outbound Generic IDoc MATAMS05 is created in R3X as shown in the below screenshot.

As per the configuration this IDoc will be converted to a flat file and routed to the corresponding Receiver (/XI_Practice/ folder of the Receiver FTP Server in this case).At XI System:A message is created in XI, which indicates the message from R3X has reached XI Integration Server.Execute transaction SXI_MONITOR in the XI Integration Server as below.

The Processed Successfully Flag indicates that the outbound message (IDoc) has been successfully processed and it has reached the Receiver FTP system.At Receiver System (FTP Server):Log on to the FTP Server of the Host System, to verify the new file.