8. ALE_programming_Guide.pdf
(
2115 KB
)
Pobierz
ALE Programming Guide
ALE Programming Guide
Release 4.6C
ALE Programming Guide
SAP AG
Copyright
© Copyright 2001 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP AG. The information contained herein may be changed
without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
Microsoft
®
, WINDOWS
®
, NT
®
, EXCEL
®
, Word
®
, PowerPoint
®
and SQL Server
®
are registered
trademarks of
Microsoft Corporation.
IBM
®
, DB2
®
, OS/2
®
, DB2/6000
®
, Parallel Sysplex
®
, MVS/ESA
®
, RS/6000
®
, AIX
®
, S/390
®
,
AS/400
®
, OS/390
®
, and OS/400
®
are registered trademarks of IBM Corporation.
ORACLE
®
is a registered trademark of ORACLE Corporation.
INFORMIX
®
-OnLine for SAP and Informix
®
Dynamic Server
TM
are registered trademarks of
Informix Software Incorporated.
UNIX
®
, X/Open
®
, OSF/1
®
, and Motif
®
are registered trademarks of the Open Group.
HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C
®
, World Wide
Web Consortium,
Massachusetts Institute of Technology.
JAVA
®
is a registered trademark of Sun Microsystems, Inc.
JAVASCRIPT
®
is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.
SAP, SAP Logo, R/2, RIVA, R/3, ABAP, SAP ArchiveLink, SAP Business Workflow, WebFlow,
SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com
are trademarks or registered trademarks of SAP AG in Germany and in several other countries all
over the world. All other products mentioned are trademarks or registered trademarks of their
respective companies.
2
April 2001
SAP AG
ALE Programming Guide
Icons
Icon
Meaning
Caution
Example
Note
Recommendation
Syntax
April 2001
3
ALE Programming Guide
SAP AG
Inhalt
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 Types..............................................................................................55
Distribution Using Message Types..............................................................................................56
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 Coding ..............................................................................................79
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 Processing..............................................................................................85
Inbound Function Module ...........................................................................................................86
Embedding a Function Module in ALE Inbound Processing.................................................87
Data Consistency ..................................................................................................................88
Ensuring Data Consistency..............................................................................................89
4
April 2001
SAP AG
ALE Programming Guide
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 inputErrorOccurred .............................................................................................. 165
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
April 2001
5
Plik z chomika:
smorag
Inne pliki z tego folderu:
9. ENHANCEMENT_MODIFICATIONS_BAPI_ALE.pdf
(1181 KB)
8. ale_steps.pdf
(34 KB)
8. ALE_programming_Guide.pdf
(2115 KB)
6. ScriptSYMBOLS.pdf
(38 KB)
8. ALE_quick_start.pdf
(208 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin