研究、分享我学习零售业SAP的历程
------------打造中国第一个零售SAP博客

R3接收IDOC的定义,这种办法是一步一步手工创建,也可以通过Function Module直接创建Inbound /oubbound IDOC,

http://www.cnblogs.com/byfhd/archive/2008/05/10/1191063.html

 

In the previous posts, we have covered the XI specific aspects of creating your first XI scenario. Now, let us understand what settings are required so that the R/3 partner system is able to receive and post the IDoc data. Let us start by creating the inbound function module.

Create Inbound Function Module – Transaction SE37

In the receiving system, create a function module Z_IDOC_INPUT_ZRZSO_MT using SE37. Below, I have described the logic for the same:

Add Include MBDCONWF. This include contains predefined ALE constants
Loop at EDIDC table

  • Check if the message type is ZRZORDER. Otherwise raise WRONG_FUNCTION_CALLED exception
  • Loop at EDIDD table
    • Append data from the segments to appropriate internal tables
    • For example: append data from ZRZSEG1 segment to the internal table of type ZCUSTOMERS
  • Update the DDic tables from internal tables
  • Depending on the result of the update, fill the IDoc status record (type BDIDOCSTAT) and append it to the corresponding table.
    • Status 53 => Success
    • Status 51 => Error

You can download the sample ABAP code for the above function module here.

Assign Function Module to Logical message – Transaction WE57

  • Create a new entry
  • Specify name of the Function Module as Z_IDOC_INPUT_ZRZSO_MT
  • Also, specify Type as F, Basic IDoc type as ZRZORDER, Message type as ZRZSO_MT and Direction as 2 (Inbound)
  • Save the entry

Define Input method for Inbound Function Module – Transaction BD51

  • Create a new entry
  • Provide Function Module name as Z_IDOC_INPUT_ZRZSO_MT
  • Specify the Input method as 2
  • Save the entry

Create a Process code – Transaction WE42

  • Create a new Process Code ZPCRZ
  • Select Processing with ALE Service
  • Choose Processing type as Processing by function module
  • Save the entry
  • On the next screen, select your function module from the list
  • Save the changes
  • On the next screen, select your function module from the list
  • Save the changes

Define Logical system for the partner - Transaction SALE or BD54

  • Define a Logical system LOGSYS100 using transaction SALE or BD54 to identify the partner business system

Create a Partner profile – Transaction WE20

Partner Profiles - WE20

  • Go to transaction WE20 and create a partner profile corresponding to the logical system created above
  • Add the message type ZRZSO_MT and the previously created process code ZPCRZ in the inbound parameters of the partner profile
  • Save the profile

Send and Receive Data

  • Put the input XML file in the appropriate directory on the file system
  • Monitor the directory. After a few seconds, the file should get marked as read-only
  • Choose monitoring -> Integration Engine monitoring (transaction SXMB_MONI)
  • Choose ‘Monitor for Processed XML Messages’
  • Your message should appear with a checkered flag (processed successfully)
  • Check the IDoc status in target R/3 system using transaction WE02
  • You may also verify the data records in DDic tables using SE16

SAP Transaction WE02

Thus using a small example, we have learned how to integrate different systems so that they can communicate with each other using SAP Exchange Infrastructure. In further posts we shall discuss more XI concepts to give you better understanding of applying your XI knowledge.

转:http://www.riyaz.net/blog/xipi-settings-in-r3-partner-system-to-receive-idocs/

 

posted on 2008-09-15 22:58  会东  阅读(2371)  评论(1编辑  收藏  举报