Vous êtes sur la page 1sur 105

IBM Global Services

Overview of ALE / IDOCs

© Copyright IBM Corporation 2006


IBM Global Services

Topics to cover

 What is ALE?
 Components of ALE.
 Anatomy of an IDoc.
 ALE Processing
 Transactions For Monitoring and Processing IDocs.
 Questions

Slide 2 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE Terminology

•ALE - Application Linking & Enabling

•IDoc - Intermediate Document

•EDI - Electronic Data Interchange

Slide 3 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE Objective

Slide 4 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

What Data can be Exchanged ?

Transaction Data
–SD, MM, FI, CO, etc.

Master Data
–Material, Customer, Vendor, etc.

Control Data
–Organizational Reference Information
•Plants, Sales Orgs, etc.

Data required to enable tightly coupled,


distributed applications
–Separate HR, Separate Treasury, etc.

Slide 6 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Features –ALE / IDocs

 Distributed System yet integrated with SAP R/3

 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

 ALE support backward compatibility

 ALE ensure that , data is transferred only once

Slide 7 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE Scenario

Document

IDoc
SAP System R/3 SAP System R/3

IDoc IDoc

EDI Subsystem EDI Subsystem

Slide 8 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Components of ALE

Services:
Application Services
Distribution Services
Communication Services

Tools:
Customizing Tools
Development Tools

Slide 10 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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

Slide 11 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Distribution Services

Services:
Application Services  Recipients
Distribution Services  Formats and
Communication Services
Filters the data
 Creates IDocs
Tools:
Customizing Tools ( Intermediate
Development Tools Documents

Slide 12 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Communication Services

Services:
Application Services
Distribution Services
Communication Services •TCP/IP
•RFC
Tools:
•tRFC
Customizing Tools
Development Tools • etc

Slide 13 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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

Slide 14 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Customizing Tools

Services:
Application Services
Distribution Services
Communication Services

Tools:
Customizing Tools
Development Tools Tools for creating
and modifying
IDocs

Slide 15 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

In a Nut Shell

Application Distribution/ ALE Communication


Layer Layer Layer

Master
Application IDOC Determine Filter/Convert Comm.
Receipients Data, Create IDOC
IDOC

Carrier

Application
Data Application Filter/Convert Comm.
Functions Data IDOC

Slide 16 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

IDoc Concept

System 1 System 2

SAP
Document
IDoc

 R/3 System  EDI subsystem


 R/3 System
 R/2 System
 3rd party software

Slide 18 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

IDoc Structure

Control Record IDoc-ID


Sender-ID
Receiver-ID
IDoc type and logical message
External structure

Data Record IDoc-ID


Sequence/Hierarchy
Segment Format definition for
• header data
• item data

Status Record IDoc-ID


Status information

Slide 19 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Control record
Data Record
Status Record

IDOC
“Intermediate
Document”

Slide 20 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Information about the IDoc status like:


Status Record IDoc identification number
Status number - table verified
IDoc type
Direction
Data and time stamp; Structure:
EDIDS

Slide 24 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Idoc Segments

TCODE:
WE31

Slide 26 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Idoc Types

TCODE:
WE30

Slide 27 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

How to Attach Segments

Slide 28 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Message Types

WE81
WE82

Slide 29 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

IDOC Type/ Message Type/ Processing Function Module

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.

Slide 30 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Topics to cover

 What is ALE ?
 Components of ALE.
 Anatomy of an IDoc.
 ALE Processing.
i.Outbound Processing

ii.Inbound Processing

 Transactions For Monitoring and Processing IDocs.


 Trouble Shooting
 Questions

Slide 31 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Outbound Processing

Slide 32 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Outbound processing: direct

Application ALE layer Comm. layer


posting

Need to Customer
create IDOC? Distribution Model
asynch. RFC
Create master or
M Receiver determination
IDOC EDI
Segment filter

Field value conversion


Application document
posted simultaneously Version change
with IDOCs
Dispatch
Links
C control C
Database

Slide 33 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Querying the Model

Application ALE layer Comm. layer


Comm. layer
posting

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

Slide 34 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Handover IDoc to ALE

Application ALE layer Comm. layer


posting

Need to Customer
create IDOC? Distribution Modelcreates 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

Field value conversion


Application document
posted simultaneously Version change
with IDocs
Dispatch
Links
C control C
Database

Slide 35 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Receiver determination

Application ALE layer Comm. layer


posting

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  Data not relevant
or to receiver
(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

Slide 36 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Segment filter

Application ALE layer Comm. layer


posting

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

Slide 37 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Field value conversion

Application ALE layer Comm. layer


posting

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

Slide 38 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Version change

Application ALE layer Comm. layer


Comm. layer
posting

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
EDI release
levels can communicate
Field value conversion without additional application
Application document logic
posted simultaneously Version change
with IDocs
Dispatch
Links
C control C
Database

Slide 39 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Make Links

Application ALE layer Comm. layer


posting

Need to Customer
create IDOC? Distribution Model
asynch. RFC
Create master or
M Receiver determination
IDOC EDI
Segment filter

- Links are written between IDOC


Field value conversion
and
Application document
Version change  Application object contained
posted simultaneously
in IDOC
with IDocs
 Communication-Layer's
Dispatch
C "Transaction-ID"
Database Links control C

Slide 40 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Dispatch control

Application ALE layer Comm. layer


posting

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

Slide 41 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Scenario analysis

• How does the IDOC look like ?

• How is data being sent ?

• How is the data being received ?

Slide 42 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Outbound program development

• Program logic
– “How is the IDOC being created ?”

• Triggering
– “How is the IDOC creation kicked off ?”

Slide 43 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

MASTER_IDOC_DISTRIBUTE

Call function ‘MASTER_IDOC_DISTRIBUTE’


 Exporting
 master_idoc_control: IDOC control record
 Tables
 communication_idoc_control: returned information
about the distribution
 master_idoc_data: IDOC data segments

Slide 45 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Filling an EDIDD structure

Header (55bytes) SDATA (1000bytes)


EDIDD …. SEGNAM ….

Field1 Field2 Field3 Field4


Z1SEG
“10” “ABC”

MOVE “Z1SEG” to EDIDD-SEGNAM


MOVE “10” to Z1SEG-FIELD1
MOVE “ABC” to Z1SEG-FIELD2
MOVE Z1SEG to EDIDD-SDATA

Slide 46 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

General Programming rules


 Design Guidelines for creating IDOC data records:

• Left-justified filing of IDOC Fields

• Replacing SAP codes with ISO codes


 currency keys
 country keys
 unit of measure
 shipping instructions
• Converting Currency Amounts

Slide 47 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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’
 All types unequal to ‘char’, ‘cuky’, ‘clnt’, ‘accp’, ‘numc’,
‘dats’, ‘tims’ or ‘unit’ require a condense

Slide 48 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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’

• Conversion of currency amounts


– ‘currency_amount_sap_to_iso’

Slide 49 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Basic Configuration Elements

 Create and allocate Logical System


 Define Ranges (Idocs, Ports, etc )
 Define RFC Destinations
 Define Ports
 Maintain Customer Model
 Create Partner Profiles

Slide 50 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Logical System

TCODE:
BD54; Stored in
table T000

Slide 51 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Allocate Logical System to the client

TCODE:
SCC4

SALE > BASIC SETTINGS > SET UP


LOGICAL SYSTEM > ASSIGN LOGICAL
SYSTEM TO THE CLIENT
Slide 52 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Maintaining RFC Destinations

TCODE:
SM59

Slide 54 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Displaying and Maintaining Ports

TCODE:
WE21

A port is a logical representation of a


communication channel in SAP with
the data communicated being IDocs.

Slide 55 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Partner Profiles

TCODE:
WE20

Slide 56 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Partner Profiles-Outbound

Slide 57 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Partner Profiles-Inbound

Slide 58 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Distribution Model

TCODE:
BD64

Slide 59 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Transfer of data

Transfer master data for material, customer, vendor to different client


or system with BALE

Slide 60 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Filter Objects

BD95
BD59

Slide 61 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Sending Master Data Idocs

Master
data ?

Only send N Standalone program


objects that have with user-definable
changed ? selection criteria

Change Standalone with


Pointer N
custom logic to keep
available? track of changes

Change Pointer
based Program

Slide 62 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Sending Transactional Data Idocs

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

Output determination Hardcoded ALE layer


based Program no Modification

Slide 63 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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>)

• Commit Work • Read Change Pointers


Change pointers • Fill IDOC
• Call ALE layer
• Update Change Pointer

ALE layer
Master_IDOC_DISTRIBUTE

Slide 64 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

 Change Pointers

BD61
BD50

Slide 65 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

 Change Pointers… Continued

BD52
BD60

Slide 66 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE Configuration For Change Pointers

• Define change pointer creation


• Define which change document fields are to be logged

• Change pointer activation


• Activate generally
• Activate per message type

• “Publish” new function module


• Link message type to function module

Slide 68 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE For Transactional data ---- Output Determination

NACE

Slide 69 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Determination -- Access Sequence

Slide 70 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Determination -- Output Types

Slide 71 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Types -- Details

Slide 72 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Types -- Partner Functions

Slide 73 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Types -- Processing Routines

Slide 74 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Types -- Procedures

Slide 75 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Types -- Procedures Control

Slide 76 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Output Types -- Condition records

Slide 77 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Inbound Processing

Slide 78 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Inbound Processing.

Comm. layer ALE layer Application


posting
C
Version change

asynch. RFC Segment filter


or
EDI Field value conversion

Input
control A
A Serialization Process IDOC

Simultaneously update
IDOC's status
Post application
Database document

Slide 79 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Input Control

Comm. layer ALE layer Application


posting
C

For each message type and sender


-
Version change
one can define
 when
asynch. RFCto process Segment filter
(immediate/batch)
or
 whether to call application Field value conversion
EDIdirectly or start customer
workflow
 who should get work items in Input
case of error control A
- Incoming IDOC packets are passed to
application A Serialization Process IDOC

Simultaneously update
IDOC's status
Post application
Database document

Slide 80 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Application Input

Comm. layer ALE layer Application


posting
C
Version change

asynch. RFC Segment filter


or
EDI Field value conversion

- 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

Slide 81 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Serialization

Comm. layer ALE layer Application


posting
C
Version change

- When processing the Segment filter


asynch. RFC
inbound IDOC, the
or
application can call an ALE Field value conversion
EDI(function module) to
API
check that the IDOC has not
been overtaken Input
control A
 If change No. 1 arrives
after change No. 2, the A Serialization Process IDOC
IDOC containing it has
been overtaken (by the
Simultaneously update
IDOC containing the IDOC's status
later change) Post application
Database document

Slide 82 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

FM Assignment to Message Type and IDoc type

TCODE:
WE57

Slide 83 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Process Codes

WE41
WE42

Slide 84 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Process Codes in Inbound and Outbound

TCODE:
WE64

Slide 85 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

FM For Inbound EDI

TCODE:
BD67

Slide 86 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Inbound Program Development


ALE configuration
INBOUND_IDOC_PROCESS • Partner Profiles
IDOC • Process Code
• Version change
• Function module attribute
• Segment filter • Function module registry
• Field conversion
Call function
IDOC_INPUT_<MSGTYPE>

• Read IDOC data


Return Variables • Post Application data
• Send Success info back to ALE layer

If ERROR, trigger
Workflow Task
ALE layer

Slide 87 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE error handling

User action R/3 action

Error in inbound function module

ALE triggers error event

input Error Occurred

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 Finis hed

Workitem completed

Slide 88 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

ALE error handling

 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

Slide 89 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Advanced Inbound Topics

• Data consistency

• Serialization

• Individual vs. mass processing

• Call transaction function modules

Slide 90 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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’

Slide 91 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Data Consistency

ALE Laye r Application


function module

Lock IDoc(s)

Re ad IDoc(s)

Lock application obje cts


Optional: Se rialization che ck
Proce ss IDoc data
Write application data to DB

Write IDoc(s) status


Write links
Optional:
Write se rialization data
Trigge r e v e nt(s)

Commit Work

Unlock IDoc(s) and


application obje cts

Slide 92 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Serialization

Sender Comm. Layer Receiver

Object X, First IDOC Input from IDOC 1


changed twice: overtaken must be prevented
in order not to lose
information from
1 IDOC 2

2 2

1 !?

Slide 93 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Serialization

 Check, if IDOC has been overtaken


 Use function module ‘IDOC_SERIALIZATION_CHECK’
 react to overtaken IDOCs according to your needs

 Prerequisite is the definition of a serialization


object

Slide 94 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

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

Slide 96 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Topics to cover

 What is ALE ?
 Components of ALE.
 Anatomy of an IDoc.
 ALE Processing
 Transactions For Monitoring and Processing IDocs.
 Questions

Slide 97 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Monitoring IDocs

• The IDoc interface offers 2 different approaches for tracking of data


load and data flow:
Reports for monitoring
Workflow for notifications
• Both approaches are based on the concept of status transitions, i.e.
an IDoc changes its status from a given value to another value.

Slide 98 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

List Of All IDocs Created. (Default, Additional, EDI)-- WE02/ WE05

Slide 99 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Selection Program For Issuing Output -- WE15

Slide 100 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Process All Selected IDocs. WE14

Slide 101 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Test Tool For Idoc Processing (WE19)

Slide 102 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Select IDocs BD87

Slide 103 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Idoc Search For Business Contents (Database). WE09

Slide 104 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006
IBM Global Services

Status Conversion With Trfc Execution. BD75

Slide 105 ABAP | Confidential | ALE For ABAPers .ppt | 12/11/2019 © Copyright IBM Corporation 2006

Vous aimerez peut-être aussi