Ale for Abapers

97
Saint- Gobain IBM Confidential : 2008 Application Link Enabling (ALE) June, 2009 ABAP Team (IBM India)

description

ALE for SAP ABAP

Transcript of Ale for Abapers

Page 1: Ale for Abapers

Saint- Gobain IBM Confidential : 2008

Application Link Enabling (ALE)

June, 2009ABAP Team (IBM India)

Page 2: Ale for Abapers

2 Saint – Gobain & IBM Confidential : 2008

Topics to coverTopics to cover

What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

ALE in typical Project Scenario.

Questions

Page 3: Ale for Abapers

3 Saint – Gobain & IBM Confidential : 2008

ALE!! What is it ??

It is a set ofIt is a set of Tools, programs and data definitions

that provides the mechanism for that provides the mechanism for distributing functionality and data across distributing functionality and data across multiple system.multiple system.

Page 4: Ale for Abapers

4 Saint – Gobain & IBM Confidential : 2008

What Data can be Exchanged ?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.

Page 5: Ale for Abapers

5 Saint – Gobain & IBM Confidential : 2008

What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

Trouble Shooting

ALE in typical Project Scenario.

Questions

Topics to coverTopics to cover

Page 6: Ale for Abapers

6 Saint – Gobain & IBM Confidential : 2008

Components of ALE Components of ALE

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Tools:Tools:

Customizing Tools Customizing Tools

Development ToolsDevelopment Tools

Page 7: Ale for Abapers

7 Saint – Gobain & IBM Confidential : 2008

Application ServicesApplication Services

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Tools:Tools:

Customizing Tools Customizing Tools

Development ToolsDevelopment Tools

This is where the SAP applications ( SD, FI, MM etc. ) generate their data and documents

Page 8: Ale for Abapers

8 Saint – Gobain & IBM Confidential : 2008

Distribution ServicesDistribution Services

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Tools:Tools:

Customizing Tools Customizing Tools

Development ToolsDevelopment Tools

Recipients Formats and

Filters the data Creates IDocs

( Intermediate

Documents

Page 9: Ale for Abapers

9 Saint – Gobain & IBM Confidential : 2008

Communication ServicesCommunication Services

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Tools:Tools:

Customizing Tools Customizing Tools

Development ToolsDevelopment Tools

•TCP/IP

•RFC

•tRFC

• etc

Page 10: Ale for Abapers

10 Saint – Gobain & IBM Confidential : 2008

Development ToolsDevelopment Tools

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Tools:Tools:

Customizing Tools Customizing Tools

Development ToolsDevelopment Tools

Model Maintenance Tool.

(for configuring the flow of data

between systems )Shared Master Data(SMD)tools

(for distributing master data ) Customization parameters

(within SAP for IDoc filtering and

conversion. )

Page 11: Ale for Abapers

11 Saint – Gobain & IBM Confidential : 2008

Customizing ToolsCustomizing Tools

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Tools:Tools:

Customizing Tools Customizing Tools

Development ToolsDevelopment Tools Tools for creating and modifying IDocs

Page 12: Ale for Abapers

12 Saint – Gobain & IBM Confidential : 2008

Application Data

MasterIDOC Determine

Receipients

DetermineReceipients

Filter/ConvertData, Create IDOC

Filter/ConvertData, Create IDOC

Comm.IDOC

Application Functions

Application Functions

Filter/ConvertData

Filter/ConvertData

Comm.IDOC

CarrierCarrier

Application Layer

Application Layer

Distribution/ ALE Layer

Distribution/ ALE Layer

Communication Layer

Communication Layer

ApplicationApplication

In a Nut ShellIn a Nut Shell

Page 13: Ale for Abapers

13 Saint – Gobain & IBM Confidential : 2008

Topics to coverTopics to cover

What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

Trouble Shooting

ALE in typical Project Scenario.

Questions

Page 14: Ale for Abapers

14 Saint – Gobain & IBM Confidential : 2008

Control recordData RecordStatus Record

IDOC

“Intermediate Document”

Page 15: Ale for Abapers

15 Saint – Gobain & IBM Confidential : 2008

The very first record of an IDoc package is always a control record. Thestructure of this control record of the structure EDIDC and describes the contents of the data contained in the package.

Control RecordControl Record

Page 16: Ale for Abapers

16 Saint – Gobain & IBM Confidential : 2008

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 RecordData Record

Page 17: Ale for Abapers

17 Saint – Gobain & IBM Confidential : 2008

Status RecordStatus Record Information about the IDoc status like:IDoc identification numberStatus number - table verifiedIDoc typeDirectionData and time stamp

Page 18: Ale for Abapers

18 Saint – Gobain & IBM Confidential : 2008

Idoc SegmentsIdoc Segments

TCODE:

WE31

Page 19: Ale for Abapers

19 Saint – Gobain & IBM Confidential : 2008

Idoc TypesIdoc Types

TCODE:

WE30

Page 20: Ale for Abapers

20 Saint – Gobain & IBM Confidential : 2008

How to Attach SegmentsHow to Attach Segments

Page 21: Ale for Abapers

21 Saint – Gobain & IBM Confidential : 2008

Message TypesMessage Types

WE81WE82

Page 22: Ale for Abapers

22 Saint – Gobain & IBM Confidential : 2008

Topics to coverTopics 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

ALE in typical Project Scenario.

Questions

Page 23: Ale for Abapers

23 Saint – Gobain & IBM Confidential : 2008

Outbound Processing

Page 24: Ale for Abapers

24 Saint – Gobain & IBM Confidential : 2008

Outbound processing: directOutbound processing: direct

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDOCs

Comm. layer

asynch. RFCor

EDI

CLinks C

Comm. layer

Page 25: Ale for Abapers

25 Saint – Gobain & IBM Confidential : 2008

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

Comm. layer

asynch. RFCor

EDI

Links C

Querying the ModelQuerying the Model

asynch. RFCor

EDI

Comm. layer

C

- ALE supplies APIs (function modules) to allow applications to query the model

Is anybody interested in my message type? Optional: what filter objects are they

interested in?

Page 26: Ale for Abapers

26 Saint – Gobain & IBM Confidential : 2008

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

- The application creates the IDOCThe application creates the IDOC- Technically it is stored as an Technically it is stored as an

internal tableinternal table- Passed to ALE via an API Passed to ALE via an API

(function module)(function module)

Links C

Handover IDoc to ALEHandover IDoc to ALE

asynch. RFCor

EDI

C

Comm. layer

Page 27: Ale for Abapers

27 Saint – Gobain & IBM Confidential : 2008

Receiver determinationReceiver determination

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

asynch. RFCor

EDI

Links C

asynch. RFCor

EDI

C

Comm. layer

- If the application has no specified If the application has no specified recipientsrecipients ALE refers to the customer ALE refers to the customer

distribution model to determine distribution model to determine themthem

Data not relevant to receiver Data not relevant to receiver (according to model) is removed (according to model) is removed in ALE layer.in ALE layer.

Page 28: Ale for Abapers

28 Saint – Gobain & IBM Confidential : 2008

Segment filterSegment filter

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

asynch. RFCor

EDI

Links C

asynch. RFCor

EDI

C

Comm. layer

- The filter is data-independentThe filter is data-independent- IDOC segments that are not IDOC segments that are not

required can be removedrequired can be removed- The filter is message and receiver-The filter is message and receiver-

specificspecific

Page 29: Ale for Abapers

29 Saint – Gobain & IBM Confidential : 2008

Field value conversionField value conversion

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

asynch. RFCor

EDI

Links C

asynch. RFCor

EDI

C

Comm. layer

- The contents of individual The contents of individual fields can befields can be translated to new valuestranslated to new values suppressedsuppressed

- The filter is message and The filter is message and receiver-specificreceiver-specific

Page 30: Ale for Abapers

30 Saint – Gobain & IBM Confidential : 2008

Version changeVersion change

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

Comm. layer

asynch. RFCor

EDI

Links C

asynch. RFCor

EDI

C

Comm. layer

- IDOCs can be changed to older IDOCs can be changed to older versionsversions

- Systems with different release Systems with different release levels can communicate levels can communicate without additional application without additional application logiclogic

Page 31: Ale for Abapers

31 Saint – Gobain & IBM Confidential : 2008

Make LinksMake Links

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

CCLinks

asynch. RFCor

EDI

C

Comm. layer

- Links are written between IDOC Links are written between IDOC andand Application object contained Application object contained

in IDOCin IDOC Communication-Layer's Communication-Layer's

"Transaction-ID""Transaction-ID"

Page 32: Ale for Abapers

32 Saint – Gobain & IBM Confidential : 2008

Dispatch controlDispatch control

Application posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

C

asynch. RFCor

EDI

Links C

asynch. RFCor

EDI

C

Comm. layer

- Technical comms parameters are Technical comms parameters are defineddefined

- EDI or aRFC (asynch. remote EDI or aRFC (asynch. remote function call)function call)

- Send immediately or cumulate Send immediately or cumulate and send via batch joband send via batch job If batch, packet size is If batch, packet size is

determineddetermined

Page 33: Ale for Abapers

33 Saint – Gobain & IBM Confidential : 2008

Scenario analysisScenario analysis

• How does the IDOC look like ?

• How is data being sent ?

• How is the data being received ?

Page 34: Ale for Abapers

34 Saint – Gobain & IBM Confidential : 2008

Outbound program development

• Program logic

– “How is the IDOC being IDOC created ?”

• Triggering

– “How is the IDOC creation kicked off ?”

Page 35: Ale for Abapers

35 Saint – Gobain & IBM Confidential : 2008

Program logicProgram logic

• Select data from application tables• Fill data into IDOC • Pass IDOC to ALE layer (Call function MASTER_IDOC_DISTRIBUTE)• Commit Work

• Receiver determination• Segment filtering• Version Control• Dispatch Control

IDOC program

ALE layer

MASTER_IDOC_DISTRIBUTE

Page 36: Ale for Abapers

36 Saint – Gobain & IBM Confidential : 2008

MASTER_IDOC_DISTRIBUTEMASTER_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

Page 37: Ale for Abapers

37 Saint – Gobain & IBM Confidential : 2008

Filling an EDIDD structureFilling an EDIDD structure

Header (55bytes) SDATA (1000bytes)…. SEGNAM ….EDIDD

Z1SEGField1 Field2 Field3 Field4

“10” “ABC”

MOVE “Z1SEG” to EDIDD-SEGNAMMOVE “10” to Z1SEG-FIELD1MOVE “ABC” to Z1SEG-FIELD2MOVE Z1SEG to EDIDD-SDATA

Page 38: Ale for Abapers

38 Saint – Gobain & IBM Confidential : 2008

General Programming rulesGeneral 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

Page 39: Ale for Abapers

39 Saint – Gobain & IBM Confidential : 2008

Left-justified FillingLeft-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

Page 40: Ale for Abapers

40 Saint – Gobain & IBM Confidential : 2008

Code ConversionsCode 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’

Page 41: Ale for Abapers

41 Saint – Gobain & IBM Confidential : 2008

Filter ObjectsFilter Objects

BD95BD59

Page 42: Ale for Abapers

42 Saint – Gobain & IBM Confidential : 2008

Sending Master Data IdocsSending Master Data Idocs

Only send objects that have changed ?

Change Pointeravailable?

Master data ?

Standalone with custom logic to keeptrack of changes

Change Pointerbased Program

y

N

Y

Standalone programwith user-definable selection criteria

N

Y

Page 43: Ale for Abapers

43 Saint – Gobain & IBM Confidential : 2008

Sending Transactional Data IdocsSending Transactional Data Idocs

Ensure trans- actional Integrity?

Output Determination available ?

Transaction Data ?

hard coded ALElayerModification

Output determinationbased Program

y

N

Y

N

Y

User-Exitavailable?

N

Hardcoded ALE layerno Modification

Y

See Master data

Page 44: Ale for Abapers

44 Saint – Gobain & IBM Confidential : 2008

Change Pointers Change Pointers

Application Posting

• Post Application document

• Create Change Document

• Are changes ALE relevant ?

•Write Change Pointers

• Commit Work

ALE configuration

• ALE relevant Fields

Batch Program(RBDMIDOC)

IDOC Module (Masteridoc_Create_SMD_<MSGTYPE>)

• Read Change Pointers• Fill IDOC• Call ALE layer• Update Change Pointer

Master data

Change pointers

ALE layerMaster_IDOC_DISTRIBUTE

• Determine IDOC module• Call IDOC module

Page 45: Ale for Abapers

45 Saint – Gobain & IBM Confidential : 2008

Change PointersChange Pointers

BD61BD50

Page 46: Ale for Abapers

46 Saint – Gobain & IBM Confidential : 2008

Change Pointers… ContinuedChange Pointers… Continued

BD52BD60

Page 47: Ale for Abapers

47 Saint – Gobain & IBM Confidential : 2008

IDOC moduleIDOC 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

Page 48: Ale for Abapers

48 Saint – Gobain & IBM Confidential : 2008

ALE Configuration For Change PointersALE 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

Page 49: Ale for Abapers

49 Saint – Gobain & IBM Confidential : 2008

ALE For Transactional data ---- Output DeterminationALE For Transactional data ---- Output Determination

NACE

Page 50: Ale for Abapers

50 Saint – Gobain & IBM Confidential : 2008

Output Determination -- Access SequenceOutput Determination -- Access Sequence

Page 51: Ale for Abapers

51 Saint – Gobain & IBM Confidential : 2008

Output Determination -- Output TypesOutput Determination -- Output Types

Page 52: Ale for Abapers

52 Saint – Gobain & IBM Confidential : 2008

Output Types -- DetailsOutput Types -- Details

Page 53: Ale for Abapers

53 Saint – Gobain & IBM Confidential : 2008

Output Types -- Partner FunctionsOutput Types -- Partner Functions

Page 54: Ale for Abapers

54 Saint – Gobain & IBM Confidential : 2008

Output Types -- Processing RoutinesOutput Types -- Processing Routines

Page 55: Ale for Abapers

55 Saint – Gobain & IBM Confidential : 2008

Output Types -- ProceduresOutput Types -- Procedures

Page 56: Ale for Abapers

56 Saint – Gobain & IBM Confidential : 2008

Output Types -- Procedures ControlOutput Types -- Procedures Control

Page 57: Ale for Abapers

57 Saint – Gobain & IBM Confidential : 2008

Output Types -- Condition recordsOutput Types -- Condition records

Page 58: Ale for Abapers

58 Saint – Gobain & IBM Confidential : 2008

Inbound Processing

Page 59: Ale for Abapers

59 Saint – Gobain & IBM Confidential : 2008

Inbound Processing.Inbound Processing.

Application posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

Page 60: Ale for Abapers

60 Saint – Gobain & IBM Confidential : 2008

Input ControlInput Control

Application posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

- For each message type and sender For each message type and sender one can defineone can define when to process when to process

(immediate/batch)(immediate/batch) whether to call application whether to call application

directly or start customer directly or start customer workflowworkflow

who should get work items in who should get work items in case of errorcase of error

- Incoming IDOC packets are passed to Incoming IDOC packets are passed to applicationapplication

Page 61: Ale for Abapers

61 Saint – Gobain & IBM Confidential : 2008

Application InputApplication Input

Application posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

- Inbound IDOCs are passed to Inbound IDOCs are passed to the application via a the application via a standardized function standardized function interfaceinterface

Page 62: Ale for Abapers

62 Saint – Gobain & IBM Confidential : 2008

SerializationSerialization

Application posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

- When processing the When processing the inbound IDOC, the inbound IDOC, the application can call an ALE application can call an ALE API (function module) to API (function module) to check that the IDOC has not check that the IDOC has not been overtakenbeen overtaken If change No. 1 arrives If change No. 1 arrives

after change No. 2, the after change No. 2, the IDOC containing it has IDOC containing it has been overtaken (by the been overtaken (by the IDOC containing the IDOC containing the later change)later change)

Page 63: Ale for Abapers

63 Saint – Gobain & IBM Confidential : 2008

ALE Inbound configuration

IDoc controlrecord

IDoc typeSend. partnr typeSender partner no.Message typeMessage variantMessage functionTest flag

Sender typeSender no.Message typeMessage var.Message func.Fest flag

Process codeProcess typeError eventsAppl.obj.typeInbound func. Inbound func.

Input typeDialog?

Appl. obj. typeInbound func.

Message type

Message var.

Message func.

IDoc type

PartnerProfileinbound

Process codetables(inbound)

Functionmodule'sattributes

ALE functionmoduleregistry

Process code

Page 64: Ale for Abapers

64 Saint – Gobain & IBM Confidential : 2008

FM Assignment to Message Type and IDoc typeFM Assignment to Message Type and IDoc type

TCODE:

WE57

Page 65: Ale for Abapers

65 Saint – Gobain & IBM Confidential : 2008

Process CodesProcess Codes

WE41WE42

Page 66: Ale for Abapers

66 Saint – Gobain & IBM Confidential : 2008

Process Codes in Inbound and OutboundProcess Codes in Inbound and Outbound

TCODE:

WE64

Page 67: Ale for Abapers

67 Saint – Gobain & IBM Confidential : 2008

FM For Inbound EDI FM For Inbound EDI

TCODE:

BD67

Page 68: Ale for Abapers

68 Saint – Gobain & IBM Confidential : 2008

Basic Configuration ElementsBasic Configuration Elements

Create and allocate Logical System Define Ranges (Idocs, Ports, etc ) Define RFC Destinations Define Ports Maintain Customer Model Create Partner Profiles

Page 69: Ale for Abapers

69 Saint – Gobain & IBM Confidential : 2008

Logical SystemLogical System

TCODE:

BD54

Page 70: Ale for Abapers

70 Saint – Gobain & IBM Confidential : 2008

Allocate Logical System to the clientAllocate Logical System to the client

SALE > BASIC SETTINGS > SET UP LOGICAL SYSTEM > ASSIGN LOGICAL SYSTEM TO THE CLIENT

TCODE:

SCC4

Page 71: Ale for Abapers

71 Saint – Gobain & IBM Confidential : 2008

Number RangesNumber 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

Page 72: Ale for Abapers

72 Saint – Gobain & IBM Confidential : 2008

Maintaining RFC DestinationsMaintaining RFC Destinations

TCODE:

SM59

Page 73: Ale for Abapers

73 Saint – Gobain & IBM Confidential : 2008

Displaying and Maintaining PortsDisplaying and Maintaining Ports

A port is a logical representation of a A port is a logical representation of a communication channel in SAP with communication channel in SAP with the data communicated being IDocsthe data communicated being IDocs.

 

TCODE:

WE21

Page 74: Ale for Abapers

74 Saint – Gobain & IBM Confidential : 2008

Partner ProfilesPartner Profiles

TCODE:

WE20

Page 75: Ale for Abapers

75 Saint – Gobain & IBM Confidential : 2008

Partner Profiles-OutboundPartner Profiles-Outbound

Page 76: Ale for Abapers

76 Saint – Gobain & IBM Confidential : 2008

Partner Profiles-InboundPartner Profiles-Inbound

Page 77: Ale for Abapers

77 Saint – Gobain & IBM Confidential : 2008

Distribution ModelDistribution Model

 TCODE:

BD64

Page 78: Ale for Abapers

78 Saint – Gobain & IBM Confidential : 2008

Inbound Program DevelopmentInbound Program Development

INBOUND_IDOC_PROCESSIDOC

ALE layer

IDOC_INPUT_<MSGTYPE>

• Read IDOC data• Post Application data• Send Success info back to ALE layer

ALE configuration• Partner Profiles• Process Code• Function module attribute• Function module registry

Workflow Task

Call function

Return Variables

If ERROR, trigger

• Version change• Segment filter• Field conversion

Page 79: Ale for Abapers

79 Saint – Gobain & IBM Confidential : 2008

ALE error handlingALE error handling

User action R/3 action

Execute Workitem

Fix error and reprocess IDocorFlag IDoc for deletion

Error in inbound function module

ALE triggers error event

Workitem appears in user's Inbox

Display IDoc for user processing

(IDoc method "InputForeground")

ALE triggers end event

Workitem completed

input Error Occurred

input Finished

Page 80: Ale for Abapers

80 Saint – Gobain & IBM Confidential : 2008

ALE error handlingALE 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

Page 81: Ale for Abapers

81 Saint – Gobain & IBM Confidential : 2008

Advanced Inbound TopicsAdvanced Inbound Topics

• Data consistency

• Serialization

• Individual vs. mass processing

• Call transaction function modules

Page 82: Ale for Abapers

82 Saint – Gobain & IBM Confidential : 2008

Data ConsistencyData 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’

Page 83: Ale for Abapers

83 Saint – Gobain & IBM Confidential : 2008

Data ConsistencyData Consistency

ALE Layer Applicationfunction module

Read IDoc(s)

Commit Work

Unlock IDoc(s) andapplication objects

Lock IDoc(s)

Write IDoc(s) statusWrite linksOptional:

Write serialization dataTrigger event(s)

Lock application objectsOptional: Serialization checkProcess IDoc dataWrite application data to DB

Page 84: Ale for Abapers

84 Saint – Gobain & IBM Confidential : 2008

SerializationSerialization

Receiver

1

2

1

2

Object X, changed twice:

First IDOC overtaken

Comm. LayerSender

!?

!?

Input from IDOC 1 must be prevented in order not to lose information from IDOC 2

Page 85: Ale for Abapers

85 Saint – Gobain & IBM Confidential : 2008

SerializationSerialization

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

Page 86: Ale for Abapers

86 Saint – Gobain & IBM Confidential : 2008

Mass ProcessingMass 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

Page 87: Ale for Abapers

87 Saint – Gobain & IBM Confidential : 2008

Call TransactionCall 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

Page 88: Ale for Abapers

88 Saint – Gobain & IBM Confidential : 2008

Topics to coverTopics to cover

What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

ALE in typical Project Scenario.

Questions

Page 89: Ale for Abapers

89 Saint – Gobain & IBM Confidential : 2008

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

Page 90: Ale for Abapers

90 Saint – Gobain & IBM Confidential : 2008

Selection Program For Issuing Output -- WE15Selection Program For Issuing Output -- WE15

Page 91: Ale for Abapers

91 Saint – Gobain & IBM Confidential : 2008

Process All Selected IDocs. WE14Process All Selected IDocs. WE14

Page 92: Ale for Abapers

92 Saint – Gobain & IBM Confidential : 2008

Test Tool For Idoc ProcessingTest Tool For Idoc Processing

Page 93: Ale for Abapers

93 Saint – Gobain & IBM Confidential : 2008

Select IDocs BD87Select IDocs BD87

Page 94: Ale for Abapers

94 Saint – Gobain & IBM Confidential : 2008

Idoc Search For Business Contents (Database). WE09Idoc Search For Business Contents (Database). WE09

Page 95: Ale for Abapers

95 Saint – Gobain & IBM Confidential : 2008

Status Conversion With Trfc Execution. BD75Status Conversion With Trfc Execution. BD75

Page 96: Ale for Abapers

96 Saint – Gobain & IBM Confidential : 2008

Topics to coverTopics to cover

What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing.

Transactions For Monitoring and Processing IDocs.

ALE in typical Project Scenario.

Questions

Page 97: Ale for Abapers

97 Saint – Gobain & IBM Confidential : 2008

QuestionsQuestions