• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

riyaz.net

Tech Tips and Tutorials for SAP Professionals and Bloggers

  • Home
  • WordPress
  • Tips & Tricks
  • Internet
  • SAP
    • SAP PI
    • SAP ABAP
  • Personal Finance
  • Health & Fitness
  • Travel & Leisure
You are here: Home / SAP / Beginner’s Guide to ALE and IDocs – Part II

Beginner’s Guide to ALE and IDocs – Part II

January 20, 2008 by Riyaz

In the previous part we created an IDoc structure which can carry our data from source system to target system(s). In this part we will understand how to setup the source system to be able to generate and send an outbound IDoc.

Outbound Settings

Define Logical Systems and Assign Client to Logical System – Transaction SALE

Transaction SALE

  • Go to Define Logical System (See the figure)
  • Define a new logical system to identify the local system and save it
  • Now, go to Assign Client to Logical System (See the figure)
  • Add a new entry
  • Specify the client, previously created logical system and other attributes
  • Save the entry
  • Define a new logical system to identify the partner system and save it

Maintain RFC Destinations – Transaction SM59

  • Create a new RFC destination for R/3 type connection
  • Specify the target host on Technical settings tab
  • Provide the Logon credentials on the Logon/Security tab
  • Save the settings
  • To verify the settings, Click on Test connection or Remote logon

Define Ports – Transaction WE21

  • We need to define a tRFC port for the partner system
  • Click on Transactional RFC node
  • Create a new port
  • Provide a description
  • Specify the name of the target RFC destination
  • Save the object

Maintain Distribution Model – Transaction BD64

  • Click on Change
  • Create a new model view
  • Provide a Short text and Technical name to the model view
  • Add message type
  • Specify sender and receiver systems
  • Also, specify the message type that we created previously
  • Save the Distribution model

Generate/Create Partner Profile – Transactions BD82/WE20

Transaction WE20

  • To generate Partner profiles automatically you may use BD82 or go to BD64 and use the menu path Environment -> Generate partner profiles
    • Otherwise, you may use transaction WE20 to create a partner profile
  • On selection screen, specify the model view, target system and execute
  • The result log will be displayed on the next screen
  • To verify the partner profile go to WE20
  • Check the partner profile for the target system

Distribute Model View – Transaction BD64

  • Select the Model View
  • Go to menu path Edit -> Model View -> Distribute
  • Result log will be displayed on the next screen

Outbound IDoc Generation Program

Create an executable program ZRZ_ORDER_IDOC in SE38. Below, I have described the program logic:

  • Fetch the data from the DDic tables ZCUSTOMERS, ZSOHEADERS and ZSOITEMS as per the selection criteria
  • Fill the control record structure of type EDIDC
    • Specify message type, Basic IDoc type, tRFC Port, Partner number and Partner type of the receiver
  • Fill the data records
    • Define structures like the IDoc segments
    • Fill the structures with fetched data
    • Pass the segment name and the above structure to the appropriate fields of EDIDD type structure
    • Append the EDIDD structure to the EDIDD type internal table
  • Now, call the function module MASTER_IDOC_DISTRIBUTE and pass the IDoc control record structure and data record table
  • Commit work if return code is zero
  • Function module returns a table of type EDIDC to provide the details about generated IDoc
  • Display appropriate log

You can download sample code for the above program here.

Thus we have completed sender side configuration required for ALE. In the next part we will see how to configure the receiving system to be able to receive and post the inbound IDoc.

Filed Under: SAP Tagged With: SAP ABAP

About Riyaz

Riyaz Sayyad is the founder of Riz Labs. Learn more about him here.

Primary Sidebar

Popular Guides

  • Dropbox Tutorial
  • CDN Setup Guide
  • Blog Design Tips
  • Optimize RSS Feed
  • Create Twitter App
  • Short URLs
  • Password Protect Folders
  • Time Management
  • ALE IDocs Tutorial
  • SAP PI Starter Kit
  • SAP PI Tips
  • Ergonomics

Popular Topics

  • Home
  • WordPress
  • Tips & Tricks
  • Internet
  • SAP
    • SAP PI
    • SAP ABAP
  • Personal Finance
  • Health & Fitness
  • Travel & Leisure

About Riyaz

riyaz.net is a popular technology site with how-to guides, tips and tutorials on personal technology, blogging, social media, web apps, personal finance and SAP.

riyaz.net was launched way back in 2005 by web designer, blogger and SAP Consultant Riyaz Sayyad from Pune, India. Over the years the site has grown into a full featured online community with thousands of visitors daily from around the world. Read more.

Copyright © 2025 · riyaz.net