THIS BLOG IS TO WRITE REVIEWS AND NOTES ABOUT SAP FINANCE AND CONTROLLING (FI/CO) BOOKS, ARTICLES etc. THIS IS ONLY FOR EDUCATIVE PURPOSE. THIS BLOG IS REALLY HELPFUL FOR SAP PROFESSIONALS AND STUDENTS PREPARING FOR SAP FICO CERTIFICATIONS & TRAINING.
SAP Material List
- Transaction codes (30)
- Interview Questions (17)
- FI (15)
- FI - Basic Settings (7)
- SAP (7)
- FI - GL (5)
- Gaps (4)
- ALE IDOC (3)
- CO (3)
- SAP Testing (2)
- Tickets (2)
- ASAP (1)
- Accounting/ Accounts/ finance/ general concepts (1)
- Blueprints (1)
- CIN-Country version India (1)
- ERP (1)
- Integration (1)
- Issues (1)
- LSMW (1)
- SAP MODULES (1)
- SAP certification training centers in India (1)
Showing posts with label ALE IDOC. Show all posts
Showing posts with label ALE IDOC. Show all posts
ALE :: IDOC :: EDI
Overview of ALE/EDI/IDOCS
Electronic
Data Interchange (EDI)
Ø Electronic data exchange of business documents between the computer
systems of business partner using standard format over a communication network
EDI is also called as paperless exchange.
Application
Linking and Enabling (ALE)
Ø ALE stands for Application Linking and Enabling. As its name
indicates, it link two systems
Ø ALE is a technology that can enable exchange of data between two
different systems
(SAP to SAP OR SAP to NONSAP).
Ø It is a set of tools, programs and data definitions, provides
distribution model and technology that enables SAP customer to interconnect
programs across various platforms and systems.
Features
of ALE/IDOC
·
Distributed system yet
integrated with SAP R/3
·
Based on ‘Application to
Application integration using message architecture
·
Reliable communication
·
Data is exchanged using “IDCOS”
·
Support both R/2,R/3 and
external system
·
If network problem, message is
buffered
·
ALE support backward
compatibility
·
ALE ensures that, data is
transferred only once.
Components
of ALE
·
Application Services
·
Distribution Services
·
Communication Services
Application
Services:-
This is where the SAP applications (FI, SD
etc.) generate their data and document
Distribution
Services:-
Recipients, Formats and filters the data,
Create IDOCS (Intermediate documents)
Communication
Services:-
TCP/IP, RCF, TRFC. Etc….
Intermediate
Document (IDOC)
Ø An IDOC (Intermediate document) is a vehicle that is used to
transfer data from one system to another.
Ø IDOC is not a technology of
some sort, but it is just a container that holds the data.
Ø It holds the data in a structured format I.E. in the fields of the
segments.
IDOC
Structure: IDOC Structure contains three records
·
Control Record
·
Data Record
·
Status Record
Ø Control Record :-
The very first
record of an IDOC package is always a control record. The structure of this
control record of the structure EDIDC and describes the contents of the data
contained in the package. This control goes to EDIDC
Ø Data Record:-
All the records in the IDOC, which come
after the control record, are the IDOC data. They are all structured alike,
with segment information part and a data part, which is 1000 character in
length, filling the rest of the line. Data and segment info stored in EDID4 for
release 4.x and EDID3 for release 2.x and 3.x
Ø Status Record:-
Information about the IDOC status like:
·
IDOC identification number
·
IDOC type
·
Direction
·
Date and time stamp
Status
of IDOC
·
A two digit status is assigned to
an IDOC to allow the processing to be monitored
·
There are totally 75 IDCO
statuses
·
The statuses for outbound IDOCs
are between ‘01’ and ‘49’while the statuses for inbound IDOCS begins with ‘50’
I would like to
discuss few statuses here
A) 01 IDCO generated
B) 02 Error passing data port
C) 03 Data passed to port
D) 51 Application document not posted
E) 52 Application document not
fully posted
F) 53 Application document posted
IDOC
Type:
There are two different IDOC types
1) Basic type
2) Extension
T-code (WE30)
Message
Type:
There are two different message types
1) EDI logical (T-code WE81)
2) Output type and Assignment to IDOC type (T-code WE82)
Port:-
A port is a communication channel through
which the messages can be sent or received in SAP.
The sender and the receiver both specify
the port through which they will communicate.
ALE :: IDOC
ALE – Application Link Enabling is a
mechanism by which SAP systems communicate with each other and with non-SAP EDI
subsystems. Thus it helps integration of distributed systems. It supports
fail-safe delivery which implies that sender system does not have to worry
about message not reaching the source due to unavoidable situations. ALE can be
used for migration and maintenance of master data as well as for exchanging
transactional data.
The messages that are exchanged are in the
form of IDocs or Intermediate Documents. IDocs act like a container or envelope
for the application data. An IDOC is created as a result of execution of an
Outbound ALE. In an Inbound ALE an IDOC serves as an input to create
application document. In the SAP system IDocs are stored in the database
tables. They can be used for SAP to SAP and SAP to non-SAP process
communication as long as the participating processes can understand the syntax
and semantics of the data. Complete documentation on IDOC is obtained by using
transaction WE60.
Every IDoc has exactly one control record
along with a number of data records and status records. Control record has the
details of sender/receiver and other control information. Data records contain
the actual business data to be exchanged while the status records are attached
to IDoc throughout the process as the IDoc moves from one step to other.
Now, let us understand the ALE
Configuration by means of an example scenario below:
The
Scenario
SAP ALE Scenario
Data from custom tables (created in
customer namespace) is to be formatted into an IDoc and sent from one SAP R/3
system to another using ALE service. We need to have two instances of SAP R/3
systems or we can simulate this on two clients of the same SAP R/3 system.
DDIC Tables for IDoc
Creating
Custom IDoc type and Message type
All the objects created should be present on both source as well as target system(s).
All the objects created should be present on both source as well as target system(s).
1. Create segments – Transaction WE31
·
Create a segment ZRZSEG1
·
Add all fields of table ZCUSTOMERS to it
·
Save the segment
·
Release it using the menu path Edit ->
Set Release
·
Similarly create two more segments given
below
·
Seg. ZRZSEG2 – to hold all fields of table
ZSOHEADERS
·
Seg. ZRZSEG3 – to hold all fields of table
ZSOITEMS
2. Create Basic IDoc type – Transaction
WE30
·
Create a Basic type ZRZORDER
·
Add the created segments in the hierarchy
shown
·
Maintain attributes for each of the
segments
·
Save the object and go back
·
Release the object using the menu path Edit
-> Set Release
3.
Create/Assign Message type – Transactions WE81/WE82
·
Go to WE81
·
Create a new Message type ZRZSO_MT
·
Save the object
·
Go to WE82 and create new entry
·
Assign the message type ZRZSO_MT to the
basic type ZRZORDER
·
Also specify the Release Version
·
Save the object
Outbound Settings
Define Logical Systems and Assign Client to
Logical System – Transaction SALE
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
WE20
·
To generate Partner profiles automatically
you may use BD82 or go to BD64 and use the menu path Environment -> Generate
partner profiles
o 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
o Specify message type,
Basic IDoc type, tRFC Port, Partner number and Partner type of the receiver
·
Fill the data records
o Define structures like
the IDoc segments
o Fill the structures with
fetched data
o Pass the segment name and
the above structure to the appropriate fields of EDIDD type structure
o 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
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
Loop at EDIDC table
·
Check if the message type is ZRZORDER.
Otherwise raise WRONG_FUNCTION_CALLED exception
·
Loop at EDIDD table
o Append data from the
segments to appropriate internal tables
o 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.
o Status 53 => Success
o Status 51 => Error
Inbound
Settings
·
Define Logical Systems – Transaction SALE
(Please refer to Outbound Settings)
·
Assign Client to Logical System –
Transaction SALE (Please refer to Outbound Settings)
·
Maintain RFC Destinations – Transaction
SM59 (Please refer to Outbound Settings)
·
Define Ports – Transaction WE21 (Please
refer to Outbound Settings)
·
Generate/Create Partner Profile –
Transactions BD82/WE20 (Please refer to Outbound Settings)
·
Assign Function Module to Logical message –
Transaction WE57
o Create a new entry
o Specify name of the
Function Module as Z_IDOC_INPUT_ZRZSO_MT
o Also, specify Type as F,
Basic IDoc type as ZRZORDER, Message type as ZRZSO_MT and Direction as 2
(Inbound)
o Save the entry
·
Define Input method for Inbound Function
Module – Transaction BD51
o Create a new entry
o Provide Function Module
name as Z_IDOC_INPUT_ZRZSO_MT
o Specify the Input method
as 2
o Save the entry
·
Create a Process Code – Transaction WE42
o Create a new Process Code
ZPCRZ
o Select Processing with
ALE Service
o Choose Processing type as
Processing by function module
o Save the entry
o On the next screen,
select your function module from the list
o Save the changes
o Now you will be taken to
the next screen
o Double-click on Logical
message
o In the Assignment to
logical message, specify the message type ZRZSO_MT
o 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.
WE02
Outbound Settings
Define Logical Systems and Assign Client to Logical
System – 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
§ 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.
Subscribe to:
Posts (Atom)
Most Popular Posts
-
SAP certification training centers in India Here a list of SAP certification training centers in India, Please contact below SAP autho...
-
Financial Accounting Configuration in SAP FICO step by step Enterprise Structure Configuration Settings Enterprise Structure ...
-
SAP CO Profitability Analysis Transaction Codes KE30 Execute profitability report VALU Valuation Analysis KE21N CO-PA Line Ite...
-
FUNCTIONAL SPECIFICATION Functional Specifications is mainly prepared for the purpose of ...
-
Ticketing tool vary from client to client. SAP also provides SAP Solution Manager, which is also used as Ticketing Tool. General conce...
-
What are the benefits and disadvantages of implementing ERP software? Advantages: Integration Integration can be the highest benefit...









