IDOC to File Beginner Guide 20090615

Embed Size (px)

Citation preview

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    1/16

    IDOC to FILE - Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 1

    IDOC to File Beginners Guide

    Applies to:

    SAP Exchange Infrastructure (PI)

    Summary

    SENDING A CUSTOM IDOC DEVELOPED IN SENDER R/3 SYSTEM TO RECEIVER SYSTEMVIA INTEGRATION SERVER.

    Author(s): Mandeep Virk

    Company: ArchitectSAP Solutions

    Created on: 24 December 2007

    Author Bio

    Hi I am Mandeep Singh Virk working with ArchitectSAP Solutions as a ProcessIntegration Consultant.

    Hi Folks,

    Although IDOC to File is a common yet pivotal scenario. It is very challenging to trigger an IDOC tointegration server , rest part is up to integration server. So here we are mainly concerned on thepart from R/3 to integration server. We will create a custom IDOC and trigger it to receiver systemvia integration server.

    So Here we go..

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    2/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 2

    Table of Contents

    Applies to: .......................................................................................................................1Summary.........................................................................................................................1Author Bio .......................................................................................................................1STEPS TO DEVELOP CUSTOM IDOC IN R/3 SYSTEM ................................................3STEPS TO ESTABLISH CONNECTION BETWEEN R/3 SYSTEM AND XI SERVER.....5TESTING ......................................................................................................................11MONITORING...............................................................................................................13XI OBJECTS DEFINITION............................................................................................14Integration Repository: Design ......................................................................................14Integration Directory: Configuration ...............................................................................15RESULT........................................................................................................................16

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    3/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 3

    STEPS TO DEVELOP CUSTOM IDOC IN R/3 SYSTEM

    Go to TC: WE31

    To Create IDOC Structure: Segments

    Enter the name of your segment type and click on Create button. Enter short text and Save

    it. Now go back. Go to Edit menu option Set Release.

    Fig No. 1

    Go to TC: WE30

    To Create IDOC Type: Basic.

    Enter the Object Name, Select Basic Type and click Create icon

    Fig No. 2

    Select the IDOC Name and click Create icon. The system prompt us to enter the segmentType and its attributes. Choose the appropriate values and press enter.

    Save it and go back

    Go to Edit Set Release

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    4/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 4

    Fig No. 3

    Go to TC: WE81

    To Create Message Type

    Change the details from Display mode to Change mode.

    System will give the message Caution: The Table is cross-client . Press Enter.

    Click New Entries to create new Message Type

    Fill Details. Save it and Go Back

    Fig No. 4

    Go to TC: WE82

    To Assign Message Type to IDOC Type

    Fig No. 5

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    5/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 5

    Go to TC: WE60

    To See IDOC Documentation. Here you can see Structure of your Basic Type IDOC in textformat.

    Fig No. 6

    STEPS TO ESTABLISH CONNECTION BETWEEN R/3 SYSTEM AND XI SERVER

    Go to TC: SM59

    To Configure RFC Connection for Receiver System

    Fig No. 7

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    6/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 6

    Define RFC Destination for Receiver system i.e. XI Server

    Fig No. 8

    Provide all Technical settings for your Receiver System. System Name for your XI Serveras Target Host and its System No .

    Move to Logon & Security Tab to provide Logon Details like Language, Client, User,Password.

    Go to TC: WE21

    To Configure Port in IDOC Processing for Receiver System .

    Choose tRFC as a Port for IDOC Processing and Choose Create New.

    Fig No. 9

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    7/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 7

    In a Pop up system will prompt you to choose options from Generate port name or Defineyour own port name. You can define port name of your choice.

    Fig No. 10

    Give a short description to your port and assign RFC Destination to this port which youhave created in previous steps.

    Fig No. 11

    Go to TC: BD54

    To Configure a Logical System as Receiver System .

    Change the details from Display mode to Change mode.

    System will give the message Caution: The Table is cross-client . Press Enter.

    Create New Entries. Give name to your Logical System and Description for the same.

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    8/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 8

    Fig No. 12

    Go to TC: WE20

    To Configure a Partner Profile for your Receiver System .

    Select Partner Type LS (Logical System). Choose Create New.

    Enter Logical System Name as Partner No. which you have created in previous step i.e.BD54. Partner Type should be LS.

    Fill all mandatory fields as per your system specifications. You can Choose F4 help.

    Add a new row in Outbound Parameters and select Message Type which you have createdin custom IDOC as shown in fig 13.

    Fig No. 13

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    9/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 9

    Message Type that you have defined in WE81

    Fig No. 14

    Assign Message Type and Basic Type to Outbound Parameters of Partner Profile.

    Specify Receiver Port which we had defined earlier.

    Make sure that Output mode should be Transfer IDOC immediately instead of CollectIDOC.

    Fig No. 15

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    10/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 10

    As this was the last step of our configuration part for RECEIVER SYSTEM on SenderSystem Side. We Developed a custom IDOC and Configured settings for the outboundprocessing through all these steps. Now what we have to do is to Test the outbound IDOCprocessing for the same.

    But before moving further with this step we have to do technical settings for SENDERSYSTEM that should be on XI Server .Now Logon to XI Server in your Landscape.

    Go to SM59.

    To Define RFC Destination for Sender System

    Maintain Technical Settings and Logon & Security Settings as per your systemspecifications.

    Fig No. 16

    Go to TC: IDX1.

    To maintain Port and Logical System for Sender System in IDOC Adapter

    Give RFC Destination as Defined in previous step.

    NOTE: Make sure that Port for sender system is of the format SAP. Where SID is yourthree digit System ID.

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    11/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 11

    Fig No. 17

    Now that is all from the configuration side of Ports and Logical Systems for both Senderand Receiver Systems

    TESTING

    To Test IDOCs outbound processing

    Go to TC: WE19

    To Test the IDOC processing

    Select Basic Type button and search for your developed Custom IDOC with F4 help.

    Fig No. 18

    Enter Data Records in segment type of your IDOC that you wish to send to other system.

    Here we are using some test data to test the processing for the same.

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    12/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 12

    Fig No. 19

    Now we will specify Technical settings in the header of IDOC i.e. in EDIDC field.

    Click on EDIDC and specify the technical details for both sender and receiver. Click Enter.

    Fig No. 20

    Select Standard Outbound Processing to trigger the IDOC for outbound Processing.

    You will get prompt as shown in case of successful triggering of IDOC else in case of failuresystem will display message IDOC was saved but cannot or should not besent.

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    13/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 13

    Fig No. 21

    Go to TC: WE02 / WE05.

    To check the status of triggered IDOC

    You can see your IDOC under the node of Outbound IDOCs

    Fig No. 22

    MONITORING

    Go to TC: SXMB_MONI

    To monitor IDOC received by integration server

    Fig No. 23

    NOTE: Here you can see the message flag along with red icon displaying statusAcknowledgement not possible. This is another most challenging area to deal with and fix theproblem. I will try to explain/troubleshoot this part in next article.

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    14/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 14

    XI OBJECTS DEFINITION

    Integration Repository: Design

    Define Data Type, Message Type and Interface Type Objects with a new messagestructure to handle incoming IDOC.

    Eg. MT_Materials and Message Interface as Inbound Asynchronous.

    Fig No. 24

    Import custom IDOC from SAP objects under Imported objects in a specific SWCV.

    Eg. ZMATERIAL_MESSAGE.ZMATERIAL

    Fig No. 24

    Define message mapping with custom idoc as sender interface and user defined messagestructure as receiver interface as shown :

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    15/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    2007 SAP AG 15

    Fig No. 25

    Integration Directory: Configuration

    Before moving with this step assign a Business System to existing/new Technical System.

    Now Import Business System assigned to Technical System from SLD to your integrationbuilder.

    Go to Integration Directory Objects Tab Service Without Party Business System

    Right Click Assign Business SystemSelect newly built BS and proceed further.

    Fig No. 26

  • 7/27/2019 IDOC to File Beginner Guide 20090615

    16/16

    IDOC to File Beginners Guide

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

    Define a Receiver Communication Channel as FILE Adapter and assign it to ReceiveService.

    Also Define all the configuration objects either manually or through wizard.

    Remember in this case sender should be Business System and there is no need definecommunication channel for the same. Use IDOC Adapter as sender adapter.

    Now you can test the idoc by triggering it from R/3 system form WE19.

    RESULT

    Received XML payload on receiver service

    Fig No. 27