Beruflich Dokumente
Kultur Dokumente
March, 2006
Topics to cover
What is ALE? Components of ALE. Anatomy of an IDoc. ALE Processing Transactions For Monitoring and Processing IDocs. Questions
Slide 2
ALE Terminology
ALE - Application Linking & Enabling IDoc - Intermediate Document EDI - Electronic Data Interchange
Slide 3
ALE Objective
Slide 4
ALE!! What is it ??
It is a set of
Tools, programs and data definitions
that provides the mechanism for distributing functionality and data across multiple system.
Slide 5
Transaction Data
Data Material, Customer, Vendor, etc. Data Organizational Reference Information Plants, Sales Orgs, etc.
Control
Data
required to enable tightly coupled, distributed applications Separate HR, Separate Treasury, etc.
Slide 6
Based on Application-to-Application integration using Message Architecture Reliable communication Data is exchanged using IDocs Support both R/2, R/3 and External system If network problem, message is buffered support backward compatibility ensure that , data is transferred only once
ALE ALE
Slide 7
ALE Scenario
Document
IDoc
EDI Subsystem
EDI Subsystem
Slide 8
Topics to cover
What is ALE ? Components of ALE. Anatomy of an IDoc. ALE Processing Transactions For Monitoring and Processing IDocs. Trouble Shooting Questions
Slide 9
Components of ALE
Services: Application Services Distribution Services Communication Services
Slide 10
Application Services
This is where the SAP applications ( SD, FI, MM etc. ) generate their data and documents
Slide 11
Distribution Services
Services: Application Services Distribution Services Communication Services
Recipients Formats and Filters the data Creates IDocs ( Intermediate Documents
Slide 12
Communication Services
TCP/IP RFC
tRFC etc
Slide 13
Development Tools
Slide 14
Customizing Tools
Slide 15
In a Nut Shell
Application Layer
Master IDOC
Communication Layer
Application
Determine Receipients
Comm. IDOC
Carrier
Application Data
Application Functions
Filter/Convert Data
Comm. IDOC
Slide 16
Topics to cover
What is ALE ? Components of ALE. Anatomy of an IDoc. ALE Processing Transactions For Monitoring and Processing IDocs. Trouble Shooting Questions
Slide 17
IDoc Concept
System 1
SAP Document
System 2 IDoc
R/3 System
Slide 18
IDoc Structure
Control Record
IDoc-ID Sender-ID Receiver-ID IDoc type and logical message External structure IDoc-ID Sequence/Hierarchy Format definition for Segment
header data item data
Data Record
Status Record
Slide 19
Slide 20
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
Slide 21
Message Type
Message Type indicates How to Know what the data Means Data Exchanged by IDOC and EDI is known as Messages Message of same kind belong to the same message type Message types are stored in table EDMSG
Slide 22
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.
Slide 23
Status Record
Information about the IDoc status like: IDoc identification number Status number - table verified IDoc type Direction Data and time stamp; Structure: EDIDS
Slide 24
Status of IDOC
A two-digit status is assigned to an IDoc to allow the processing to be monitored. The statuses for outbound IDocs are between '01' and '49', while the statuses for inbound IDocs begin with '50'. Status confirmation when using port type 'File': The external system writes the status records in a status file, which is read by the R/3 System. In this case, the confirmation always refers to outbound IDocs. Status confirmation using IDoc type SYSTAT01: The system sending the confirmation writes the status records as data records of IDoc type SYSTAT01. All port types and both directions can be entered.
Slide 25
Idoc Segments
TCODE: WE31
Slide 26
Idoc Types
TCODE: WE30
Slide 27
Slide 28
Message Types
WE81
WE82
Slide 29
Slide 30
Topics to cover
Slide 31
Outbound Processing
Slide 32
Comm. layer
Links
Slide 33
ALE layer
Customer ALE supplies APIs (function modules) to allow applic ations to query the model Distribution Model
-
Is anybody interested in my message type? asynch. Optional: w hat filter objects are they interested in? or
R FC
Links
Slide 34
ALE layer Customer Distribution M odel - The applic a tion creates the IDOC
Technically it is stored as an internal table - Passed to ALE via an API Receiver determin ation (function module)
-
Comm. layer
Segment filter Field value conversion Application document posted simultaneously with IDocs Database Version change Dispatch control
Links
Slide 35
Receiver determination
Application posting
Need to create IDOC?
Comm. layer
If the application has no specified recipients asynch. RFC ALE refers to the customer or to determine distribution model EDI them async h. R FC Data not relev ant to receiver or (according to model) is removed EDI in ALE layer.
Links
Slide 36
Segment filter
Application posting
Need to create IDOC?
Comm. layer
The filter is data a-independent or IDOC segments that are not EDI sync h . R FC required a ca n be removed The filter is mess orage and receiverspecific EDI
asynch. RFC
Links
Slide 37
Application posting
Need to create IDOC?
Comm. layer
The contents of individual or fields can be EDI async h. R FC translated to new values or suppressed EDI The filter is message and receiver-specific
asynch. RFC
Links
Slide 38
Version change
Application posting
Need to create IDOC?
Receiver determination
-
Segment filter
-
asynch. RFC or EDI IDOCs caa nsync be c ha h.nged RFCto older versions or Systems with different release EDI
levels can communicate without additional application logic
Field value conversion Application document posted simultaneously with IDocs Database Version change Dispatch control
Links
Slide 39
Make Links
Application posting
Need to create IDOC?
Comm. layer
Version change
Links
Links are written between IDOC and Application object contained in IDOC Communication-Layer's Dispatch "Transaction-ID" C control
-
Slide 40
Dispatch control
Application posting
Need to create IDOC?
Comm. layer
Receiver determination
-
Segment filter
-
asynch. RFC or EDI async h. R FC Technical comms parameters are or defined EDI EDI or aRFC (asynch. remote
function call) Send immediately or cumulate and send via batch job If batch, packet size is determined
Field value conversion Application document posted simultaneously with IDocs Database
-
Links
Slide 41
Scenario analysis
How does the IDOC look like ? How is data being sent ? How is the data being received ?
Slide 42
Program logic How is the IDOC being created ? Triggering How is the IDOC creation kicked off ?
Slide 43
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
Slide 44
MASTER_IDOC_DISTRIBUTE
Exporting
master_idoc_control:
IDOC control record returned information about the distribution IDOC data segments
Tables
communication_idoc_control: master_idoc_data:
Slide 45
EDIDD
SDATA (1000bytes)
Z1SEG
Field1 10
Field2 ABC
Field3
Field4
MOVE Z1SEG to EDIDD-SEGNAM MOVE 10 to Z1SEG-FIELD1 MOVE ABC to Z1SEG-FIELD2 MOVE Z1SEG to EDIDD-SDATA
Slide 46
Slide 47
Left-justified Filling
All fields must be left-justified
Character fields:
automatic
Non-character fields:
Condense statement must be used Check IDOC documentation to find out which fields
require a condense
Slide 48
Code Conversions
Replacing SAP codes with ISO codes
Currency keys: currency_code_sap_to_iso Country keys: country_code_sap_to_iso Units of measure: unit_of_measure_sap_to_iso Shipping instructions: sap_iso_package_type_code
Slide 49
Create and allocate Logical System Define Ranges (Idocs, Ports, etc ) Define RFC Destinations Define Ports Maintain Customer Model Create Partner Profiles
Slide 50
Logical System
Slide 51
TCODE: SCC4
SALE > BASIC SETTINGS > SET UP LOGICAL SYSTEM > ASSIGN LOGICAL SYSTEM TO THE CLIENT
Slide 52 ABAP | Confidential | ALE For ABAPers .ppt | 7/19/2011 Copyright IBM Corporation 2006
Number Ranges
Maintain number ranges for ports Maintain number ranges for IDocs Maintain number ranges for IDoc types and segment version Maintain number range for change pointers
Slide 53
TCODE: SM59
Slide 54
TCODE: WE21
A port is a logical representation of a communication channel in SAP with the data communicated being IDocs IDocs.
Slide 55
Partner Profiles
TCODE: WE20
Slide 56
Partner ProfilesProfiles-Outbound
Slide 57
Partner ProfilesProfiles-Inbound
Slide 58
Distribution Model
TCODE: BD64
Slide 59
Transfer of data
Transfer master data for material, customer, vendor to different client or system with BALE
Slide 60
Filter Objects
BD95
BD59
Slide 61
Slide 62
Transaction Data ? Y Ensure transactional Integrity? Y Output Determinat ion available ? y Output determination based Program
User-Exit available?
Slide 63
Change Pointers
Application Posting
Post Application document Master data
Batch Program
(RBDMIDOC) Determine IDOC module Call IDOC module
Create Change Document Are changes ALE relevant ? Write Change Pointers
ALE configuration
ALE relevant Fields IDOC Module
(Masteridoc_Create_ SMD_<MSGTYPE>) Change pointers Read Change Pointers Fill IDOC Call ALE layer Update Change Pointer ALE layer Master_IDOC_DISTRIBUTE
Commit Work
Slide 64
Change Pointers
BD61
BD50
Slide 65
BD52
BD60
Slide 66
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
Slide 67
Slide 68
NACE
Slide 69
Slide 70
Slide 71
Slide 72
Slide 73
Slide 74
Slide 75
Slide 76
Slide 77
Inbound Processing
Slide 78
Inbound Processing.
Comm. layer C
Version change
ALE layer
Application posting
A
Process IDOC
Serialization
Database
Slide 79
Input Control
Comm. layer C
Version change For each message type and sender one can define Segment filter h. wR hen to process async FC (immediate/batch) or w hether to call application Field value conversion EDI directly or start customer workflow Input w ho should get work items in control case of error Incoming IDOC packets are passed to A application Serialization
-
ALE layer
Application posting
A
Process IDOC
Database
Slide 80
Application Input
Comm. layer C
Version change
ALE layer
Application posting
Segment filter Field value conversion Input Inbound IDOCs are passed to control the application via a standardized function A Serialization interface
A
Process IDOC
Database
Slide 81
Serialization
Comm. layer C
Version change Segment filter asynch. RFC inbound IDOC, the aor pplication can call an ALE Field value conversion EDI API (function module) to
-
ALE layer
Application posting
check that the IDOC has not been overtaken If change No. 1 arrives after change No. 2, the IDOC containing it has been overtaken (by the IDOC containing the later change)
Input control
A
Process IDOC
Serialization
Database
Slide 82
TCODE: WE57
Slide 83
Process Codes
WE41
WE42
Slide 84
TCODE: WE64
Slide 85
TCODE: BD67
Slide 86
ALE configuration
Partner Profiles Process Code Function module attribute Function module registry
Slide 87
Workitem appears in user's Inbox Execute Workitem Display IDoc for user processing (IDoc method "InputForeground") Fix error and reprocess IDoc or Flag IDoc for deletion ALE triggers end event
input Finished
Workitem completed
Slide 88
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
Slide 89
Data consistency Serialization Individual vs. mass processing Call transaction function modules
Slide 90
Slide 91
Data Consistency
ayer lication f nction o le
oc IDoc(s) ead IDoc(s) oc application o jects ptional erialization chec rocess IDoc data Write application data to D Write IDoc(s) stat s Write lin s ptional Write serialization data ri er e ent(s)
Co
it Wor
Slide 92
Serialization
Sender Comm. Layer Receiver
Input from IDOC 1 must be prevented in order not to lose information from IDOC 2
2 1 !?
Slide 93
Serialization
Check, if IDOC has been overtaken
Use function module IDOC_SERIALIZATION_CHECK react to overtaken IDOCs according to your needs
Slide 94
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)
Function module has to be coded in a way that it supports mass processing Attribute of delivered function module specifies if mass processing is supported or not
Slide 95
Call Transaction
Pros:
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 w ant to use Call transaction, they have been ALEenabled to guarantee data concistency
ABAP | Confidential | ALE For ABAPers .ppt | 7/19/2011 Copyright IBM Corporation 2006
Slide 96
Topics to cover
What is ALE ? Components of ALE. Anatomy of an IDoc. ALE Processing Transactions For Monitoring and Processing IDocs. Questions
Slide 97
Monitoring IDocs
The IDoc interface offers 2 different approaches for tracking of data
load and data flow: Reports for monitoring Workflow for notifications
Slide 98
Slide 99
Slide 100
Slide 101
Slide 102
Slide 103
Slide 104
Slide 105
Questions
Slide 106
Slide 107