Ale Idoc Edi Slide Show
Ale Idoc Edi Slide Show
Ale Idoc Edi Slide Show
March, 2006
Topics to cover
What is ALE?
Components of ALE.
Anatomy of an IDoc.
ALE Processing
Transactions For Monitoring and Processing IDocs.
Questions
ALE Terminology
ALE Objective
ALE!! What is it ??
It is a set of
Tools,
programs and
data definitions
Transaction Data
–SD, MM, FI, CO, etc.
Master Data
–Material, Customer, Vendor, etc.
Control Data
–Organizational Reference Information
•Plants, Sales Orgs, etc.
Reliable communication
ALE Scenario
Document
IDoc
SAP System R/3 SAP System R/3
IDoc IDoc
Topics to cover
What is ALE ?
Components of ALE.
Anatomy of an IDoc.
ALE Processing
Transactions For Monitoring and Processing IDocs.
Trouble Shooting
Questions
Components of ALE
Services:
Application Services
Distribution Services
Communication Services
Tools:
Customizing Tools
Development Tools
Application Services
Services:
Application Services
This is where the SAP
Distribution Services
applications ( SD, FI,
Communication Services
MM etc. ) generate
their data and
Tools: documents
Customizing Tools
Development Tools
Distribution Services
Services:
Application Services Recipients
Distribution Services Formats and
Communication Services
Filters the data
Creates IDocs
Tools:
Customizing Tools ( Intermediate
Development Tools Documents
Communication Services
Services:
Application Services
Distribution Services
Communication Services •TCP/IP
•RFC
Tools:
•tRFC
Customizing Tools
Development Tools • etc
Development Tools
Model Maintenance Tool.
(for configuring the flow of data
between systems )
Services: Shared Master Data(SMD)tools
Application Services (for distributing master data )
Distribution Services Customization parameters
Communication Services
(within SAP for IDoc filtering and
conversion. )
Tools:
Customizing Tools
Development Tools
Customizing Tools
Services:
Application Services
Distribution Services
Communication Services
Tools:
Customizing Tools
Development Tools
Tools for creating
and modifying
IDocs
In a Nut Shell
Master
Application
Application IDOC Determine
Determine Filter/Convert
Filter/Convert Comm.
Receipients
Receipients Data,
Data, Create
Create IDOC
IDOC IDOC
Carrier
Carrier
Application
Data Application
Application Filter/Convert
Filter/Convert Comm.
Functions
Functions Data
Data IDOC
Topics to cover
What is ALE ?
Components of ALE.
Anatomy of an IDoc.
ALE Processing
Transactions For Monitoring and Processing IDocs.
Trouble Shooting
Questions
IDoc Concept
System 1 System 2
SAP
Document
IDoc
IDoc Structure
Control record
Data Record
Status Record
IDOC
“Intermediate
Document”
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. The control record goes to
table EDIDC
Message Type
Data Record All records in the IDoc, which come after the
control record, are the IDoc data. They are all
structured alike, with a segment information part
and a data part, which is 1000 character in
length, filling the rest of the line. Data &
Segment info is stored in EDID4 for release 4.x
and EDID3 for release 2.x and 3.x.
Status of IDOC
Idoc Segments
TCODE:
WE31
Idoc Types
TCODE:
WE30
Message Types
WE81
WE82
Valid combination of Message type and IDOC type are stored in table
EDIMSG
Combination of message type and IDOC type determine the
processing algorithm. This is usually a function module and is set up in
table EDIFCT.
Topics to cover
What is ALE ?
Components of ALE.
Anatomy of an IDoc.
ALE Processing.
i.Outbound Processing
ii.Inbound Processing
Outbound Processing
Need to Customer
create IDOC? Distribution Model
asynch. RFC
Create master or
M Receiver determination
IDOC EDI
Segment filter
Need to -Customer
ALE supplies APIs (function modules) to
create IDOC? Distribution Model to query the model
allow applications
Is anybody interested in my message type?
Optional: what filter objects are theyasynch. RFC
Create master interested in? or
M Receiver determination
IDOC EDI RFC
asynch.
Segment filter or
EDI
Field value conversion
Application document
posted simultaneously Version change
with IDocs
Dispatch
Links
C control
Database C
Need to Customer
create IDOC? Distribution
- Model creates the IDOC
The application
- Technically it is stored as an
internal table
asynch. RFC
Create master - Passed to ALE via an API
or
M Receiver determination
IDOC (function module) EDI
Segment filter
Receiver determination
Need to Customer
create IDOC? Distribution Model - If the application has no specified
recipients
asynch. RFC
ALE refers to the customer
Create master or to determine
distribution model
M Receiver determination
IDOC them asynch. EDI RFC
Segment filter or to receiver
Data not relevant
(according toEDI
model) is removed
in ALE layer.
Field value conversion
Application document
posted simultaneously Version change
with IDocs
Dispatch
Links
C control C
Database
Segment filter
Need to Customer
create IDOC? Distribution Model
-
asynch. RFC
The filter is data-independent
Create master -
or
IDOC segments that are not
M Receiver determination
IDOC required asynch.
can beEDI RFC
removed
Segment filter - or
The filter is message and receiver-
specific EDI
Field value conversion
Application document
posted simultaneously Version change
with IDocs
Dispatch
Links
C control C
Database
Need to Customer
create IDOC? Distribution Model
asynch. RFC
- The contents of individual
Create master or
M Receiver determination fields can be
IDOC EDI RFC
asynch.
translated to new values
Segment filter or
suppressed
EDI
- The filter is message and
Field value conversion
receiver-specific
Application document
posted simultaneously Version change
with IDocs
Dispatch
Links
C control C
Database
Version change
Need to Customer
create IDOC? Distribution Model
asynch. RFC
Create master or
M Receiver determination
IDOC - IDOCs can EDI RFCto older
asynch.
be changed
versions or
Segment filter
- Systems with different release
EDI
levels can communicate
Field value conversion without additional application
Application document logic
posted simultaneously Version change
with IDocs
Dispatch
Links
C control C
Database
Make Links
Need to Customer
create IDOC? Distribution Model
asynch. RFC
Create master or
M Receiver determination
IDOC EDI
Segment filter
Dispatch control
Need to Customer
create IDOC? Distribution Model
asynch. RFC
Create master or
M Receiver determination
IDOC EDI RFC
asynch.
- Technical comms parameters are
Segment filter defined
or
- EDI or aRFCEDI
(asynch. remote
Field value conversion function call)
- Send immediately or cumulate
Application document
Version change and send via batch job
posted simultaneously
If batch, packet size is
with IDocs
determined
Dispatch
Links
C control C
Database
Scenario analysis
• Program logic
– “How is the IDOC being created ?”
• Triggering
– “How is the IDOC creation kicked off ?”
Program logic
IDOC program
• Select data from application tables
• Fill data into IDOC
• Pass IDOC to ALE layer
(Call function MASTER_IDOC_DISTRIBUTE)
• Commit Work
MASTER_IDOC_DISTRIBUTE
• Receiver determination
• Segment filtering
• Version Control
• Dispatch Control
ALE layer
MASTER_IDOC_DISTRIBUTE
Left-justified Filling
Non-character fields:
‘Condense’ statement must be used
Check IDOC documentation to find out which fields
require a ‘condense’
All types unequal to ‘char’, ‘cuky’, ‘clnt’, ‘accp’, ‘numc’,
‘dats’, ‘tims’ or ‘unit’ require a condense
Code Conversions
Logical System
TCODE:
BD54; Stored in
table T000
TCODE:
SCC4
Number Ranges
TCODE:
SM59
TCODE:
WE21
Partner Profiles
TCODE:
WE20
Partner Profiles-Outbound
Partner Profiles-Inbound
Distribution Model
TCODE:
BD64
Transfer of data
Filter Objects
BD95
BD59
Master
data ?
Change Pointer
based Program
Transaction
Data ?
Ensure trans- N
actional
See Master data
Integrity?
Output User-Exit N
Determinat N hard coded ALE
available?
ion layer
available ? Modification
y Y
Change Pointers
Application Posting
Batch Program
• Post Application document Master data (RBDMIDOC)
• Determine IDOC module
• Create Change Document • Call IDOC module
ALE configuration
• Are changes ALE relevant ?
• ALE relevant Fields IDOC Module
•Write Change Pointers (Masteridoc_Create_
SMD_<MSGTYPE>)
ALE layer
Master_IDOC_DISTRIBUTE
Change Pointers
BD61
BD50
BD52
BD60
IDOC module
IDOC module has to be implemented as function module
Naming Convention: MASTERIDOC_CREATE_SMD_<msgtype>
Function module reads change pointers information to get data that
needs to go into IDOC
Function module logic:
Read change pointers
Fill IDOC structure
Call ALE layer
Update Change Pointer status
Commit Work
NACE
Inbound Processing
Inbound Processing.
Input
control A
A Serialization Process IDOC
Simultaneously update
IDOC's status
Post application
Database document
Input Control
Simultaneously update
IDOC's status
Post application
Database document
Application Input
- Input
Inbound IDOCs are passed to
the application via a control A
standardized function
A Serialization Process IDOC
interface
Simultaneously update
IDOC's status
Post application
Database document
Serialization
TCODE:
WE57
Process Codes
WE41
WE42
TCODE:
WE64
TCODE:
BD67
If ERROR, trigger
Workflow Task
ALE layer
Execute Workitem
input Finished
Workitem completed
Necessary Steps:
Create new object type in Business Object Repository for IDOC;
object is child of IDOCAPPL
Create new customer task
Create event-couplings linking
Event ‘inputErrorOccured’ linked to standard task
Event ‘inputFinished’ to function module
To support mass processing:
Create new object type as child of IDOCPACKET
Maintain process code to refer the above objects and events
• Data consistency
• Serialization
Data Consistency
• Problem:
– Ensure transactional integrity
• Don’t process and IDOC twice
• Allow for IDOC reprocessing after rollback of
application document posting
• Solution:
– Application document must be posted in the same
LUW as the IDOC status records
– IDOC function module must not use a ‘Commit Work’
Data Consistency
Lock IDoc(s)
Read IDoc(s)
Commit Work
Serialization
2 2
1 !?
!?
Serialization
Mass Processing
Processing more than one IDOC can improve
throughput:
more than one IDOC is processed per Commit Work
the function can be coded to add multiple entries to a table
with one update command (‘array insert’)
Call Transaction
Pros:
Error reprocessing in foreground
Easy to program
Cons:
Call Transaction has significant performance overhead
Automatic Commit work, no data consistency
Recommendation:
Try to use function modules that update database directly
If you want to use ‘Call transaction’, they have been ‘ALE-
enabled’ to guarantee data concistency
Topics to cover
What is ALE ?
Components of ALE.
Anatomy of an IDoc.
ALE Processing
Transactions For Monitoring and Processing IDocs.
Questions
Monitoring IDocs
Questions