You are on page 1of 140

SAP ALE / IDOCS

EXPERIENCE

TEAMWORK

www.jhsoftech.co.nr

JH SOFTECH

JH SOFTECH

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 2

JH SOFTECH

Agenda
1 INTRODUCTION 2 3 4 ALE IDOCS CONFIGURATION

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 3

jhsoftech. 4 .JH SOFTECH Agenda 5 Inbound system 6 7 8 9 Analysis Design Conclusion References www.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 5 .JH SOFTECH ERP Brief Overview of ALE Brief Overview of ALE Various Methods of CA Various Methods of CA Benefits Benefits Disadvantages Disadvantages www.jhsoftech.

6 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.JH SOFTECH ERP Brief Overview of IDOCS Brief Overview of IDOCS Creating New Idocs Creating New Idocs Configuration Configuration Summary Summary www.co.

7 .co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Overview of ALE Abbreviation Evolution What is ALE? Benefits Disadvantages www.

JH SOFTECH ALE Application Link Enabling www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 8 .co.jhsoftech.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.JH SOFTECH What is ALE ? • ALE is SAP’s technology to support distributed yet integrated processes across several SAP sytem • Middleware tool in SAP’s Buisness Framework Architecture • ALE can integrate business processes and functions between R/3 system and non-R/3 systems as well as between loosely coupled R/3 Systems www. 9 .jhsoftech.

jhsoftech. www. Thus provides reliable distribution. 10 . • ALE has functions for monitoring messages flows and handling communication problems. • Distribution of applications between different releases of R/3 Systems • Any SAP system can be upgraded to a newer release without affecting the existing functionality.JH SOFTECH Benefits Of ALE • Communication interfaces allow connections integration with non-SAP systems.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co. 11 .jhsoftech.JH SOFTECH ALE Consists of • Outbound Process • Inbound Process • Exception Handling www.

12 .co.Outbound Process Architecture www.JH SOFTECH ALE.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.

The output determination technique triggers ALE and outputs for a business document • Change Pointers – Based on change document technique – Changes made are recorded in change document header table CDHDR www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. 13 . account determination.co. and output determination.JH SOFTECH Some Concepts used in outbound inbound • Message Control – Is an cross application technique used in pricing.

• Filter Objects – They remove unwanted data for each recipient of data • Port Definition – They are used in an outbound process to define the medium in which documents are transferred – ALE uses tRFC port.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. which transfers data in memory to buffer • RFC Destination – It is the logical name used to define the characteristics of a communication link to a remote system on functions needs to executed – In ALE it specifies information required to log on to the remote SAP system to which IDoc is sent www. • Selection Programs – These are typically implemented as functional modules . 14 .co.JH SOFTECH Concepts Contd.jhsoftech. – Extracts Application data and creates a mater IDoc... – A selection program exists for each message type.

15 .jhsoftech. tRFC port Packet size for an IDoc Mode in which process sends an IDoc (batch versus immediate) Person to be notified in case of errors.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. message type. • Partner Profile – – – – It specifies logical names.co..JH SOFTECH Concepts Contd. IDoc type. www.

jhsoftech. 16 .The Technical flow an outbound process for Masterdata JH SOFTECH Begin Process Flow for distributing Master Data: Objects to be distributed are selected Data is read from the databa se and formatted into IDOC format No Collect Idocs Yes Execute RSEOUT00 Program Idoc Packets are stored in the ARFC Data Execute RSARFCEX . which calls INBOUND_IDOC_PROCESS on the Remote System ALE service layer is invoked via MASTER_IDOC_DISTRIBUTE ALE Distribution model is cons ulted to determine recipients Filtering conversion & Version change are carried out for each recipient Communcation Idocs are saved in the database Successful No www.co.nr Done 5/19/2009 4:57:09 PM 5864_ER_WHITE.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.co.JH SOFTECH Processing in the Application Layer • The customer distribution model is consulted to make sure that a receiver has been defined • If at least one receiver exists. 17 . then IDoc selection program creates reads data object from database and creates master IDoc • Master IDoc is stored in memory • Program then calls ALE service layer using MASTER_IDOC_DISTRIBUTE passing it master IDoc www.

18 .jhsoftech. it is dropped • Segment Filtering – A set of segment that are not required can be filtered out. • Field Conversion – Values in the data records can be converted to global or to specific values for receivers www.co.JH SOFTECH Processing in ALE interface Layer • Receiver Determination – Receivers are determined from the customer distribution model • IDoc Filtering – IDoc filter is specified in distribution model. – If data record doesn’t meet filter criteria.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

• Version Change for segments – A new version of segment always contains fields from the previous version and additional fields that are added for the new version. • Communication IDocs are generated – After all conversion and filtering operations .co. • IDocs are dispatched to the communication layer www.communication records are generated .. Seg.JH SOFTECH Processing in ALE Interface Layer contd.jhsoftech.Release in IDoc type. – One master IDoc can have multiple IDoc depending upon number of receivers • Syntax Check is performed – Goes through syntax check and data integrity validation.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 19 .

JH SOFTECH Processing in the Communication layer • System reads the port definition specified in the partner profile which is then used to read RFC destination • RFC system contains communication settings to log on to remote system • The sending system calls INBOUND_IDOC_PROCESS module asynchronously on the destination system and passes IDocs via memory buffers www.jhsoftech. 20 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.JH SOFTECH ALE.Inbound Process Architecture www. 21 .co.

like MATM for MATMAS – A process code is assigned to each posting program. 22 . – A process code exists for each message type. www.JH SOFTECH Some Concepts Used in Inbound • Posting Programs – They are implemented as function modules and they read data from IDoc and create an application data from it. Like MATM to IDOC_INPUT_MATMAS • Partner Profile – It consists of partner number.co. and the person to be notified in case of errors.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. mode in which IDocs are processed (batch versus immediate).

Inbound Process Architecture www.co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 23 .JH SOFTECH ALE.

24 www.Process Flow for Inbound Begin JH SOFTECH Remote system calls IDOC_INBOUND_ASYNCHR ONOUS and passes communication idoc to the system Yes Process Idoc immediately User id is validated & authorizations are checked No Program RBDAPP01 is Executed Read process code from the partner profile Data in the control record is validated against the partner profile ALE Services : Filtering conversion & Version change are carried out Application Idoc is saved in the database Process code points to the posting module Posting Module creates the application document Done 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.nr .co.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. • IDoc to be processed is passed as an input parameter.jhsoftech.JH SOFTECH Processing in the Communication Layer • The INBOUND_IDOC_PROCESS is triggered as a result of RFC from the sending system. 25 .co. www. • Control is transferred to ALE/EDI layer.

jhsoftech. the IDoc is passed to posting program using RBDAP001 – Else it is buffered in the system until RDBAPP01 is executed explicitly www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 26 . • Segment filtering and conversion – Unwanted segments can be filtered out at this stage • Application IDoc is created on database and syntax check is performed • The IDoc is marked ready for dispatch • IDoc is passed to the posting program – Partner Profile is read. message type.co. and IDoc type.JH SOFTECH Processing in the ALE/EDI Interface Layer • Basic Integrity check – A basic integrity check is performed on the control record data such as direction. If the value of the Processing field is set to Process Immediately.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. • The results of execution is passed back via function module’s output parameters • If posting is successful. 27 .co.jhsoftech. an application document is created and IDoc gets status code of 53 else it gets status code 51 www.JH SOFTECH Processing in the Posting Module • The processing code in the partner profile points to posting module for the specific message in IDoc • The posting module implemented as function module either calls SAP transaction using call transaction command for posting documents or invokes a direct input function module.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. • Person to Be notified field in the Partner Profile is used to send the error notification. 28 . a designated user is notified. If an error occurs at stage. www.JH SOFTECH Exception Handling • Workflow is integrated in the outbound to handle exceptions.jhsoftech.

29 .JH SOFTECH ALE SETUP (SALE) • • • • • Define logical systems Assign Logical Systems to Clients Define Communication Parameters: RFC Destination Modeling the distribution Generate Partner Profiles www.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.

jhsoftech.JH SOFTECH Define logical systems www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co. 30 .

jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH www.co. 31 .

co.jhsoftech.JH SOFTECH www. 32 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

33 .co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Assign Logical System Names for Clients www.

co.jhsoftech. 34 .JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

35 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.JH SOFTECH www.co.

jhsoftech.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 36 .JH SOFTECH Define Communication Parameters: RFC Destination www.

co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 37 .JH SOFTECH www.

co.jhsoftech. 38 .JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

JH SOFTECH www. 39 .co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

co. 40 .JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. 41 .JH SOFTECH www.co.

jhsoftech. 42 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Modeling the distribution www.co.

JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.co. 43 .

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 44 .jhsoftech.co.JH SOFTECH www.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. 45 .JH SOFTECH www.

46 .jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.JH SOFTECH www.

co.JH SOFTECH Generate Partner Profiles www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. 47 .

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 48 .jhsoftech.JH SOFTECH www.co.

JH SOFTECH 20. 49 .8.26.jhsoftech.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.12 www.

50 .jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.JH SOFTECH IDocs www.

an IDOC is created. • IDocs are based on EDI standards. • In an inbound ALE or EDI process. 51 . It is simply a data container used to exchange information between any two processes that can understand the syntax and semantics of the data. www. • Stored in the database.JH SOFTECH What is an IDOC? • IDoc stands for intermediate document.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. an IDOC serves as input to create an application document. • When we execute an outbound ALE or EDI Process. • Every IDOC has an unique number (within a client). ANSI X.co.12 and EDIFACT.

(SAPto-SAP as well as Non-SAP) • Independent of direction of data exchange. • IDocs can be viewed in a text editor.e. i.JH SOFTECH • IDocs are independent of the sending and receiving systems. 52 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Data is stored in character format instead of binary format.jhsoftech.co. www. can be used by both outbound and inbound process.

jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co. • Basic IDocs • Extended IDocs www. 53 .JH SOFTECH IDOC Components There are basically two types of IDocs .

defines the structure and format of the business document to be exchanged between two systems.jhsoftech. Mandatory/optional segments. www.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Hierarchy of segments. It can either be SAP provided or customer – developed.JH SOFTECH IDoc DEFINITION COMPONENTS Basic IDOC Type (WE30) • Basic IDoc type . Minimum/maximum range of each segment. List of permitted segments. 54 . CharacteristicsName – up to 30 characters where last two signify the version no.

JH SOFTECH Segments Segments.positional and based on qualifiers. Segment ComponentsSegment type.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.A segment defines format and structure of the data record. www. They are reusable components.version independent name of segment.co. 55 . SAP provided begin with E1 and customer defined by Z1. Data fields in IDocs may be of two types.

The last three characters represent the version of the segment. The name of the Segment Definition is 10 characters long and is automatically assigned by the system from the name of segment type.After a segment is released and a new version of SAP is installed any change to the segment definition creates a new segment definition.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Segment Documentation. www.jhsoftech.co. 56 .Represents data dictionary documentation for the fields in segments. SAP Segment Definitions start with E2 and customer segment definitions start with Z2. Segment Definitions can be no more than 1000 bytes. Segment definition is version dependent definition of a segment where you specify the fields that belong to the segment.version dependent.JH SOFTECH Segment definition.

co. www.JH SOFTECH • A segment definition is a version of a segment. 57 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. the previous one must be released. than the previous one. If a new segment definition is to be created.jhsoftech. A version always contains all. and at least one field more. There must only be one segment definition per release.

jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. • In Transaction WE30 we create the IDoc as an Extension and specify the basic type for which it is an extension.JH SOFTECH Extended IDocs Extending Existing IDOC Type • Used in cases where some additional information is required in addition to that supplied by the Standard IDoc Type. www. 58 .co.

59 . www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. Segments translate into data records.JH SOFTECH IDOC RUNTIME COMPONENTS An IDoc is an instance of an IDoc type. At runtime following events occur.co. One control record is attached to the IDoc. Unique IDoc no. is allocated. Status record are attached.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH TYPES OF RECORDS IN IDocs • Control record • Data record • Status record www.jhsoftech. 60 .co.

JH SOFTECH

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 61

JH SOFTECH

CONTROL RECORD
• All control information like IDoc number , sender , receiver, message type. • There is only one control record per IDoc. • Structure for control record is same for all IDoc. • It is stored in EDIDC table. Documentation- WE61

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 62

JH SOFTECH

DATA RECORD
They contain application data and are divided in two partsAdministrative and Data section ( of 1000 bytes). • Administrative Section consists of Idoc number, Segment Name, Segment number, Version, Segment Hierarchy etc. • Data Section contains the data of respective segment. • Data section is mapped to a segment type as defined in administrative section to interpret meaning of various data values in a record. Documentation- WE61

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 63

time are assigned.0-49 For inbound processing .above 50 • Latest status code is maintained in the control record. List of status codes – WE47 Documentation.JH SOFTECH STATUS RECORDS • Attached to the IDOC throughout the process .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Status codes :. 64 . date.For outbound processing .jhsoftech.co.WE61 www. • Status code.

co. 65 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH IDoc DEVELOPMENT www.jhsoftech.

4. 66 . Create programs for new or extended IDocs.JH SOFTECH IDoc DEVELOPMENT A steps to create a new IDoc are1.jhsoftech. Create a new IDoc type or an extension. 3. Assign the IDoc type to message class(we82).nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Customize ALE interface to recognize the IDocs and their programs. www.co. 2.

(WE30). 3. Creating a new basic IDOC type 1.co. 67 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Release the segment type and basic IDoc type. Create Basic IDoc type. 2.JH SOFTECH 1.jhsoftech. Create Segment type . www.(WE31).

jhsoftech. • Enter the name for your segment type and click on the Create icon. • Type the short text.JH SOFTECH Creating a Segment • Go to transaction code WE31. www. • Go to Edit -> Set Release. • Follow steps to create more number of segments. • Enter the variable names and data elements. • Save it and go back. 68 .co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

select Basic type and click Create icon. • Choose the appropriate values and press Enter. • Enter the Object Name. • The system transfers the name of the segment type to the IDOC editor.jhsoftech. www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Create IDOC Type • Go to transaction code WE30. • Select the create new option and enter a description for your basic IDOC type and press enter. • Select the IDOC Name and click Create icon. 69 . • The system prompts us to enter a segment type and its attributes.co.

Press Enter • Click New Entries to create new Message Type. • Fill details.jhsoftech.JH SOFTECH Create Message Type • Go to transaction code WE81. the system will give this message “The table is cross-client (see Help for further info)”. • After selection.co. • Save it and go back. • Change the details from Display mode to Change mode. 70 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. www.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 71 .jhsoftech. the system will give this message “The table is cross-client (see Help for further info)”. • Change the details from Display mode to Change mode. www.co. • Fill details. • After selection. • Click New Entries to create new Message Type. • Save it and go back. Press Enter.JH SOFTECH Assign Message Type to IDoc Type • Go to transaction code WE82.

JH SOFTECH 1.Create a new IDoc type or an extension www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 72 .co.jhsoftech.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Creating a new basic IDOC type Creating a new segment type (we31) www.jhsoftech.JH SOFTECH 1. 73 .

co.JH SOFTECH www. 74 .jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH www.jhsoftech. 75 .

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.JH SOFTECH Create an IDoc type – (we30) www.jhsoftech. 76 .

77 .jhsoftech.co.JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

JH SOFTECH www. 78 .co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. 79 .JH SOFTECH www.

80 .jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH www.co.

co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 81 .JH SOFTECH www.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH www.jhsoftech. 82 .

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 83 .JH SOFTECH www.jhsoftech.co.

JH SOFTECH

Release the segment type(WE31) and IDoc type (WE30)

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 84

JH SOFTECH

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 85

JH SOFTECH

2. Create a new message class (we81)Assign the IDoc to a message class (we82)

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 86

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.jhsoftech.JH SOFTECH 2. Create a new message class (we81)Assign the IDoc to a message class (we82) www. 87 .

jhsoftech. 88 .co.JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

JH SOFTECH WE82 www.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co. 89 .

JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.co. 90 .

jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 91 .JH SOFTECH www.co.

jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 92 .JH SOFTECH 3.Create programs for new or extended IDocs www.co.

• Outbound IDocs from stand-alone programs.JH SOFTECH OUTBOUND PROGRAM FOR CUSTOM BASIC IDOC TYPES Outbound bound are also referred as IDoc generation programs.jhsoftech. Based on the triggering mechanism used for IDoc generation there are three types: • Outbound IDocs from Message Control. 93 . www. • Outbound IDocs from change pointers.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. Example Purchase order. Outbound IDocs from stand alone program These programs are developed as stand alone programs with their own interface. These programs are mainly used for master data distribution in ALE. 94 . They can be implemented as reports or separate function modules that can be called from another program.JH SOFTECH Brief rundown: Outbound IDocs from Message Control. These programs are implemented as function modules and are specifically designed for applications that make use of message control component to generate IDocs. This is mainly used by EDI processes for transactional data.co. www. ALE uses the message control for distributing transactional data.jhsoftech.The interface is preset by SAP.

www. 95 .jhsoftech.co. These programs are mainly used for master data distribution based on changes made to master data.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Outbound IDocs from Change Pointers These programs are implemented as function modules and their interface is set by SAP. For example when material master is changed.

• Call the ALE service layer(MASTER_IDOC_DISTRIBUTE) to create the IDoc in the database. • Populate control record information.co. www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 96 . • Commit work.jhsoftech. • Populate an internal table of type EDID with data records for the various segments.JH SOFTECH PROGRAM FLOW FOR STAND ALONE • Select application data from the database .

advanced workflow programming etc. www. Advanced scenario .Function modules can be designed for advanced scenarios like mass processing . Posting programs are implemented as function modules and are designed to read IDoc data and create an application document.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co. Basic scenario – The ALE layer calls the posting program and passes IDoc data to it. serialization checks. 97 .jhsoftech.JH SOFTECH INBOUND PROGRAM FOR CUSTOM BASIC IDOC TYPES Inbound programs are also called posting programs.

Verify control information(msg type) if message type is incorrect.jhsoftech. • Parse through each data record and build internal tables as required by the direct posting function module.Several IDocs can be posted together. www. The results of the exceptions are passed to the ALE layer. • Populate the return parameters.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. • Call the posting program and capture the results. 98 . • Return the function module. • If more IDocs are present go to step 2 else go to next one. • Read the IDoc data for the idoc.JH SOFTECH PROGRAM FLOW • Read control record information. raise the exception.co.

99 .Customize ALE/EDI interface to recognize the IDocs and their programs www.jhsoftech.JH SOFTECH 4.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

JH SOFTECH The steps in configuring an outbound process depend on the type of program you have developed for the outbound IDoc .co. (BD64) • Create or change partner profile.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 100 .jhsoftech. www. For stand alone programs we have following steps• Add the message to the ALE distribution model IN sender’s side.

jhsoftech.(WE57) • Create a new process code(WE42) • Create/ change a partner profile to add the message type and the process code.(WE20) www. • Define attributes for the inbound function module.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 101 .JH SOFTECH Configuring the inbound process • Add the message type to the ALE distribution model in receiver’s side.co. (BD51) • Allocate the function module to the logical message type.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.JH SOFTECH Developing and Assigning process code to the inbound function module (WEDI) www. 102 .jhsoftech.

JH SOFTECH Attributes of inbound function module (BD51) www.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co. 103 .

JH SOFTECH www.jhsoftech.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 104 .

105 .JH SOFTECH Assignment of FM to logical message and IDoc type(WE57) www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.co.

co.JH SOFTECH www. 106 .jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

JH SOFTECH Inbound Process code(WE42) www.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 107 .jhsoftech.

JH SOFTECH

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 108

JH SOFTECH

Setting Inbound Parameters for Partner Profile (we20)

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 109

JH SOFTECH

www.jhsoftech.co.nr
5/19/2009 4:57:09 PM 5864_ER_WHITE. 110

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 111 . Custom program for your own message type www.JH SOFTECH Triggering the outbound process • Triggering the outbound process via change pointers.co. • Triggering the outbound process via stand alone programs. Standard program for the master data 2. 1.jhsoftech.

112 .jhsoftech. www.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Triggering the outbound process via change pointers.

JH SOFTECH Change Pointers • Tracks changes made to key documents in SAP. 113 . • When master data is changed . and additional change pointers are written in the BDCP table for changes relevant to ALE. www.jhsoftech. and sales orders.co. • Report RBDMIDOC is executed to process change pointers and call the function module for IDoc generation logic.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. such as Material master . Changes made to a document are recorded in the change document header table CDHDR. customer master .

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Triggering the outbound process via change pointers Activating change pointers globally (BD61) www. 114 .jhsoftech.co.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.JH SOFTECH Activating change pointer for a message type ( BD50) www. 115 .co.

116 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Specify the Fields for which Change pointers are to be written (BD52) www.co.jhsoftech.

JH SOFTECH BD21 – Create idoc type from change pointers www. 117 .co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.

co. 118 .JH SOFTECH Triggering the outbound process via stand alone programs.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. www.

1.g RBDSEMAT (BD10) www. Standard program for master data e.jhsoftech.JH SOFTECH Triggering the outbound process via stand alone programs. 119 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.

co. 120 .jhsoftech.JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

121 .co.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH www.

JH SOFTECH Triggering the outbound process via stand alone programs. *data declaration DATA: itab_data TYPE STANDARD TABLE OF edidd WITH HEADER LINE.jhsoftech. TABLES: z1seg_1.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 2. www. Custom program for your own message type REPORT zrep_idoc_outbound.co.zvcust. itab_comm_idoc TYPE STANDARD TABLE OF edidc WITH HEADER LINE. itab_cust TYPE STANDARD TABLE OF zvcust WITH HEADER LINE. 122 . itab_control_data TYPE STANDARD TABLE OF edidc WITH HEADER LINE.

itab_control_data-mestyp = 'ZGET'.co.JH SOFTECH SELECT customerid fname INTO CORRESPONDING FIELDS OF TABLE itab_cust FROM zvcust WHERE customerid = '000000000010000'. 123 . itab_control_data-doctyp = 'ZIDOC_1'. itab_control_data-rcvprn = 'REC_IDOC'.jhsoftech. itab_control_data-rcvprt = 'LS'. *fill control table itab_control_data-direct = '1'. www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. itab_control_data-rcvpor = 'A000000083'. APPEND itab_control_data.

itab_data-sdata = z1seg_1. CLEAR z1seg_1. ENDLOOP www. itab_data-segnam = 'Z1SEG_1'.co.jhsoftech. z1seg_1-customerid = itab_cust-customerid. CLEAR itab_data.JH SOFTECH *fill data table LOOP AT itab_cust. z1seg_1-fname = itab_cust-fname.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 124 . APPEND itab_data.

125 .jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.JH SOFTECH CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' EXPORTING master_idoc_control = itab_control_data TABLES communication_idoc_control = itab_comm_idoc master_idoc_data = itab_data www.

jhsoftech.JH SOFTECH EXCEPTIONS error_in_idoc_control =1 error_writing_idoc_status =2 error_in_idoc_data =3 sending_logical_system_unknown = 4 OTHERS = 5. COMMIT WORK. ELSE. IF sy-subrc <> 0. ENDIF.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. WRITE / itab_status. WRITE / itab_status-status. 126 . www. WRITE sy-subrc.

JH SOFTECH www.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 127 .jhsoftech.

128 .JH SOFTECH www.jhsoftech.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.

co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 129 .JH SOFTECH www.jhsoftech.

jhsoftech. 130 .co.JH SOFTECH www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

JH SOFTECH Inbound Processing of IDocs ALE Layer Reads Idocs Lock Idocs Process message Type Call direct input function module or call transaction Return the results Application Document Application Layer Call Inbound Program Write Status records Commit work Unlock Idocs www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. 131 .jhsoftech.co.

eg A (all screens).Used in advanced workflow scenarios. Value of 0 indicates success and 99999 indicates failure. 132 . In_update_task:-specifies how the piece of code that updates database tables was invoked. • Exporting parameters:Workflow_result:. Aplication variable:.specifies the mode for call transaction method.jhsoftech.Indicates if the posting was successful or not.JH SOFTECH INTERFACE FOR THE FUNCTION MODULE • Importing parameters:Input_method. e(error) and space (background) Mass processing:-used for advanced workflow scenarios.co. www. Default value is space.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

It has two field wf_param and doc_num .jhsoftech.Contains the status records for each idoc. error_idocs. or the document no.JH SOFTECH Call_transaction_done.specifies how status codes are updated. In ALE enabled transactions the codes are updated in the program. • Tables:IDoc_control :.Output parameter. www.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.Output parameter and is used for workflow processing. and the values for the wf_param are processed_idocs. Return variables:.Input parameter Idoc_data_:.Doc_num contains the Idoc no. appl_objecs. 133 .co.Input parameter IDoc_status:.

*INCLUDE MBDCONWF. DATA: segty_data LIKE Z1SEG_1. ENDLOOP. DATA:wa_cust LIKE zvcust OCCURS 0 WITH HEADER LINE. REFRESH itab_cust. ENDCASE. ENDIF. LOOP AT IDOC_CONTRL. MOVE-CORRESPONDING segty_data TO itab_cust. RAISE wrong_function_called. www. 134 .jhsoftech. WHEN 'Z1SEG_1'. CASE idoc_data-segnam. CLEAR: itab_cust.JH SOFTECH INBOUND Function Module for Customer defined programs FUNCTION Z_IDOC_INPUT_ZGET2. DATA: itab_cust LIKE zvcust OCCURS 0 WITH HEADER LINE.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. LOOP AT idoc_data WHERE docnum EQ idoc_contrl-docnum.co. IF IDOC_CONTRL-MESTYP NE 'ZGET'. segty_data = idoc_data-sdata.

INSERT INTO zvcust VALUES itab_cust.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.co.jhsoftech. ENDIF. return_variables-wf_param = 'PROCESSED IDOCS'. ELSE SELECT MAX( customerid ) FROM zvcust INTO wa_cust-customerid. 135 . return_variables-doc_number = idoc_contrl-docnum. Workflow_result = 0. IF sy-subrc EQ 0.JH SOFTECH SELECT SINGLE * FROM zvcust INTO wa_cust WHERE customerid EQ itab_cust-customerid. IF sy-subrc NE 0. return_variables-doc_number = itab_cust-customerid. return_variables-wf_param = 'APPL_OBJECTS'. itab_cust-customerid = wa_cust-customerid + 1. www. INSERT INTO zvcust VALUES itab_cust.

idoc_status-msgv2 = itab_cust-FNAME. idoc_status-msgno = '006'. idoc_status-msgty = 'I'. www. ENDFUNCTION. ENDIF. idoc_status-msgid = 'ZE'. APPEND idoc_status. idoc_status-msgv1 = itab_cust-customerid. idoc_status-status = '53'. idoc_status-docnum = idoc_contrl-docnum.JH SOFTECH APPEND return_variables.co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE. ENDLOOP. 136 .jhsoftech.

JH SOFTECH THANK YOU! www.jhsoftech. 137 .co.nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.

nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech. 138 .co.JH SOFTECH Agenda www.

co. 139 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.jhsoftech.JH SOFTECH Q&A Q&A www.

jhsoftech. 140 .nr 5/19/2009 4:57:09 PM 5864_ER_WHITE.JH SOFTECH Thank you www.co.