SAP ALE Programming Guide | SAP PDF study Material

You can add your own scenarios to the ALE business processes provided in the standard system.You can use one of two programming models o do this.

 Contents

ALE Programming Guide……………………….7

 

Implementing Distribution Using BAPIs………………………….8

Distribution Using BAPIs…………….10

Implementing Your Own BAPIs……16

Filtering Data…………………………….18

Reducing Interfaces………………….21

Defining and Assigning Filter Object Types…………………..23

Filtering BAPI Parameters…………25

Defining Hierarchies Between BAPI Parameters……………27

Maintaining BAPI-ALE Interfaces…30

Determining the Receiver of a BAPI………………………………35

Determining Filter Objects of a BAPIs…………………………..37

Determining Receivers of Asynchronous BAPIs…………….38

Determining Filter Objects Using Business Add-Ins…..39

Example Programs with Asynchronous BAPI Calls……42

Determining Receivers of Synchronous BAPIs………………47

Example Programs with Synchronous BAPI Calls……..49

Determining Unique Receivers of Synchronous BAPIs…..52

Developing BAPIs for Interactive Processing………………..53

Enhancing IDocs of BAPI-ALE Interfaces………………………54

Distribution Using Message Types55

Distribution Using Message Types56

Implementing Outbound Processing……………………………..60

Developing a Function Module for ALE Outbound Processing…………………………………………..61

Basics………………………………62

Interrogating the Distribution Model…………………………63

Structure of Control Records…64

Structure of the Data Records.65

Converting Currency Amounts……………………………66

Replacing SAP Codes With ISO Codes……………….67

Left-justified Filling of IDoc Fields……………………….68

Calling MASTER_IDOC_DISTRIBUTE…………………….69

Exceptions and Export Parameters of MASTER_IDOC_DISTRIBUTE………………………70

Example of Generating an IDoc………………………………71

Example Program to Generate an IDoc……………….72

Using the Example Coding79

Customizing ALE Outbound Processing……………………….80

Defining ALE Object Types…..81

Assigning the Object Type for the Outbound Link to the Message Type…………………………82

Assigning the Application Object Type for the Outbound Link to the Message Type………..83

Outbound Processing Using Message Control………………84

Implementing Inbound Processing85

Inbound Function Module………….86

Embedding a Function Module in ALE Inbound Processing………………………………………….87

Data Consistency………………..88

Ensuring Data Consistency89

Serialization…………………90

Processing IDocs Individually.91

Naming Convention………..92

The Function Module’s Interface………………………..93

Import Parameters………….94

IDoc Processing……………..95

Export Parameters………….96

The Inbound Function Module’s Export Parameters…………………………………………..97

Export Parameters When IDoc was Successfully Processed………………………………98

Export Parameters When an Error Occurred in IDoc Processing…………………………99

Example of Processing an IDoc……………………….100

Example Program to Process an IDoc………….101

Serialization Using Message Types……………………….118

Example Program for Serialization……………………119

Customer Exits………………….125

Example Program for a Customer Exit………………126

Mass Processing……………….132

Import Parameters………..133

Export Parameters………..134

All Inbound IDocs Processed Successfully……135

Error in One Inbound IDoc………………………….137

Example Program for Mass Processing IDocs……139

Using Call Transaction……….144

ALE-Enabled Transactions………………………………145

Call Transaction Succeeds………………………………147

Call Transaction Fails……149

Import Parameters in CALL TRANSACTION……..150

Export Parameters in CALL TRANSACTION……..151

Inbound Processing Successful…………………..152

Error During Inbound Processing…………………153

ALE Settings……………………….154

Declaring the Function Module’s Attributes…………….155

Registering the Function Modules in Inbound Processing………………………………………….156

Creating an Inbound Processing Code…………………..157

Inbound Processing Using SAP Workflow…………………..158

Work Items……………………….159

Workflow………………………..160

IDOCXAMPLE as a Reference for IDOC_PACKET………………………………………………161

IDPKXAMPLE as a Reference for IDOC_PACKET………………………………………………162

Advanced Workflow Programming……………………………..163

Setting the Parameter RESULT in the Event Container……………………………………………..164

Event inputErrorOccurred165

Event inputFinished………167

Triggering an Application Event After Successful IDoc Processing……………………………..168

Using the Parameter NO_OF_RETRIES………………..170

Master Data Distribution……………171

Defining the Message……………….172

Processing Outbound Master Data……………………………..173

Distributing Master Data Using the SMD Tool……………..174

Sending Master Data Directly…..178

Processing Inbound Master Data.179

Connections to Non-SAP Systems………………………………180

Translator Programs for Communication…………………….182

Technical Implementation…………183

TCP / IP Settings……………………184

Sending IDocs to an External System…………………………185

Sending IDocs: External System to SAP System…………187

Transaction Identification Management (TID)………………189

Integrating Dialog Interfaces……..191

Calls With References to the Logical System………………193

Calls Without References to the Logical System………….195

Serialization of Messages………….197

Serialization by Object Type………198

Serialization By Message Type….200

Serialization at IDoc Level…………201

Automatic Tests……………………….202

Example Scenario for Distributing Master Data……………203

Preparing the Test…………………….204

Developing the Test Procedure….205

Error Handling…………………………207

Objects, Events and Tasks to be Created…………………….209

Object Types and Events…………..211

Creating IDoc Object Type: IDOCXAMPLE…………………212

Creating IDoc Packet Object Type: IDPKXAMPLE……….214

Creating a Standard Task………….215

Maintaining Inbound Methods……217

Checking Consistency of Inbound Error Handling……….218

More References