Beginner’s Guide to ALE and IDocs – Part III

7 篇文章 0 订阅

Beginner’s Guide to ALE and IDocs – Part III


In the previous parts we learned how to create a custom IDoc and set up the source system to send an outbound IDoc. In this part we will learn how to configure the receiving SAP R/3 system to be able to receive and post the inbound IDoc.

Inbound IDoc Posting Function Module

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.

Inbound Settings

  • Define Logical Systems – Transaction SALE (Please refer to Outbound Settings discussed in previous part)
  • Assign Client to Logical System – Transaction SALE (Please refer to Outbound Settings discussed inprevious part)
  • Maintain RFC Destinations – Transaction SM59 (Please refer to Outbound Settings discussed inprevious part)
  • Define Ports – Transaction WE21 (Please refer to Outbound Settings discussed in previous part)
  • Generate/Create Partner Profile – Transactions BD82/WE20 (Please refer to Outbound Settings discussed in previous part)
  • 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
    • Now you will be taken to the next screen
    • Double-click on Logical message
    • In the Assignment to logical message, specify the message type ZRZSO_MT
    • Save the changes

Send and receive data

On the sender system, execute the IDoc Generation Program. Check the status of IDoc using transaction WE02.

IDoc Generation Program

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.

Transaction WE02

Thus to summarize we have learned how to:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值