Idoc Extension & Processing

28
SAP Labs, Inc. 1999 EDI01 (Tho mas Becker) / 1 Thomas C. Becker SAP AG Extension of IDoc types and Processing Please pay attention to the notes when printing this document ! The IDoc Interface

Transcript of Idoc Extension & Processing

Page 1: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 1/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 1

Thomas C. BeckerSAP AG

Extension of IDoc typesand Processing

Please pay attention to 

the notes when printing this document ! 

The IDoc Interface

Page 2: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 2/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 2

Developing IDoc Interfaces

Definitions

How to Extend ?

Exercises to Extend

IDoc Processing

Agenda

Page 3: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 3/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 3

Development Areas of an IDoc Process

Application

Function Module

Program

Report

Business Workflow

Function Module

IDoc Interface

Segment

IDoc Type

SegmentName

SegmentType

 O u  t  b

 o u n d

   P r o c e

 s s

  I n  b o u n

 d   P r

 o c e s

 s

 D a t a 

 S t r u c t u

 r e

Page 4: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 4/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 4

IDoc Record Types

Status Record IDoc-IDStatus information

Data Record IDoc-IDSequence/Hierarchy

Segment Format definition for• header data

• item data

Control Record IDoc-IDSender-ID

Receiver-IDIDoc type and logical messageExternal structure

Page 5: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 5/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 5

Definition: IDoc Type

Basis TypeBasis Type

IDocIDoc TypeType==

Basis TypeBasis Type

IDocIDoc TypeType

ExtensionExtension

==

++

Page 6: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 6/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 6

Definition: Segment

Segment Type/partner/ccccc 

Segment Type/partner/ccccc 

Segment Name/partner/ccccc000 

Segment Name/partner/ccccc000 

Segment Name/partner/ccccc 001

Segment Name/partner/ccccc 001

Segment Name

/partner/ccccc 013

Segment Name

/partner/ccccc 013

Segment TypeE1ccccc 

Segment TypeE1ccccc 

Segment NameE2ccccc000 

Segment NameE2ccccc000 

Segment NameE2ccccc 001

Segment NameE2ccccc 001

Segment NameE2ccccc 013

Segment NameE2ccccc 013

Page 7: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 7/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 7

Definition: Released & Version

By releasing segments and IDoc types the data structures of

the interface are „frozen“ from the subsystems point of view.The structures are labelled with unique names to distinguishversions for segments as well as for IDoc types.

In one SAP correction level, e.g. 4.0B, only one current

version can exist.

A new version of the development objects segment and IDoctype is created always, if changes are made after releasing

that object.

Possible changes are strongly restricted to guaranteeexternal compatibility of the IDoc interface.

Page 8: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 8/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 8

IDoc Types - Names in ABAP Programming

Control Record, EDIDC

Status Records, EDIDS

Data Records, EDIDD

Tree of Segments 

E1HDDOC

M 1

E1TLSUM

C 1

E1HDADR

C 5

C 99

E1ITSCH

C 5

E1ITDOC

M 1

Page 9: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 9/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 9

IDoc Types - Names in Subsystem

Control Record, EDI_DC40

Status Records, EDI_DS40

Data Records, by segment name 

Tree of Segments 

E2HDDOC*

M 1

E2TLSUM*

C 1

E2HDADR*

C 5

C 99

E2ITSCH*

C 5

E2ITDOC*

M 1

Page 10: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 10/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 10

Tools to Develop an IDoc Type

Tool to define thesegment with its fields

E1HDDOC

Tool to define theIDoc type with its segments

Page 11: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 11/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 11

What Kind of Development, and When

The IDoc type requested is available, and matches allrequirements:

Nothing to be done !

The IDoc type requested is available, but does not match in allthe requirements:

Development as „extension“ !

The IDoc type requested is not available, or matches only infew requirements:

Development as „basis type“ !

Page 12: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 12/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 12

Developing IDoc Interfaces

Definitions

How to Extend ?

Exercises to Extend

IDoc Processing

Agenda

Page 13: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 13/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 13

Advantages of Extensions

The standard code of processing is still in use.

Developments and corrections of standard code

are available automatically.

Extensions are much less effort than

developments.

Page 14: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 14/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 14

Fundamental Rules for Customer Extensions

Additional customer fields are assembled in separate

customer segments.

Customer segments are assigned to standard

segments as child-segments.

Processing of customer segments is implemented in

„customer-exits“.

The customer-exits are called in standard code.

Page 15: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 15/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 15

Areas of a Customer Extension

Define data structure:In area menu „WEDI“.

Implement processing in

outbound and inbound:

Project management „CMOD“.

Publish documentation:

In area menu „WEDI“.

Application

Function Module

Program

Report

Business Workflow

Function Module

IDoc Interface

Segment

IDoc Type

SegmentName

SegmentType

Page 16: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 16/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 16

Steps to Extend the Data Structure

Identify the required fields, and theirunderlying data elements in ABAP

repository.

Define the required segments with the„segment editor“.

Define the „extension“ by extending a

basis type with the„IDoc type editor“.

Assign the logical message to the

extension via

„environment in the IDoc type editor“.

Page 17: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 17/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 17

Steps to Extend the Processing

Create project in

„project management, attributes“.

Select the „right“ customer-exit(s) in„project management, SAP enhancements“.

Implement the selected customer-exit(s) in

„project management, enhancement components“.

Outbound: Read the SAP database and formatdata into IDoc format.

Inbound: Write data from the IDoc format to thedatabase.

Activate project in „project management“.

Page 18: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 18/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 18

Outbound Call Sequence

SAP Application

Message Control

IDoc Interface

IDoc Interface

Process Code

Call Function ...

EDI subsystem

Customer-exit 1

Customer-exit 2

Customer-exit x 

Page 19: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 19/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 19

Inbound Call Sequence

EDI subsystem

IDoc Interface

Process CodeCall Function ...

SAP Application

Customer-exit 1

Customer-exit 2

Customer-exit x 

Page 20: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 20/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 20

Publish Documentation of IDoc Types

Begin

End

...

typedef struct z2incodx000{

…} z2incodx000

Page 21: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 21/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 21

Developing IDoc Interfaces

Definitions

How to Extend ?

Exercises to Extend

IDoc Processing

Agenda

Page 22: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 22/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 22

Exercises to Extend IDoc Processing

SAP System R/3 SAP System R/3IDoc

Orders Light

Orders

Customer Vendor

Page 23: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 23/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 23

Exercise 1: Start-Up

Set-up a partner profile to send purchase orders to vendor IDOC-LI-nn . The messagecontrol settings are EF / NEU / LF, the logical message is ORDLGT with process codeME21-BC621-nn .

This set-up was already done!

Create a purchase order via transaction ME21, and check with one of the monitorprograms that the IDoc exists (note the IDoc‘s number).

Set-up a partner profile to receive customer orders from customer IDOC-KU-nn . Thelogical message is ORDLGT with process code VA01-BC621-nn .

This set-up was already done!

With the test tool, transaction WE19, flip-around the IDoc created in step 2. The IDoc willserve as the customer order. Because you have changed „sites“, you have to change thecontrol record, so it will match with your set-up in step 3.

Due to those exercises set-up, the inbound processing will fail, and the IDoc reachesstatus „51“: Document type NB unknown.

Page 24: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 24/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 24

Exercise 2: Extend Inbound (Cross Reference)

You plan to overcome the error from exercise 1 by implementing a cross-reference frompurchasing document type NB to sales document type TA.

Hence you implement a customer-exit for the inbound processing in projectmanagement.

Create a project

Select SAP enhancements; search with development class IDOCTRAINING

Implement the exit in enhancement components

Activate your project

Test your exit by reprocessing the inbound IDoc from exercise 1 with the test tool,transaction WE19.

The IDoc now reaches status „53“: Sales document posted.

Page 25: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 25/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 25

Exercise 3: Extend Outbound (Fill Field)

The IDoc type ORDLGT01 has the field NAME (ekko-ernam in purchasing) in segmentE1HEAD, anyway the field is not populated by outbound processing.

Hence you implement a customer-exit for the outbound processing in projectmanagement.

Create a project

(With exercise 2 the project already exists!)

Select SAP enhancements; search with development class IDOCTRAINING

(With exercise 2 the enhancement is already selected!)

Implement the exit in enhancement components

Activate your project

Test your exit by creating a new purchase order via transaction ME21, and check withone of the monitor programs that the IDoc exists, and the field NAME is populated.

Page 26: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 26/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 26

Exercise 4: Extend IDoc Type

You are asked to transmit „Terms of Delivery“ with your orders documents. Neither IDoctype ORDLGT01 nor one of its segments has fields for „Terms of Delivery“.

Extend the IDoc type ORDLGT01 with a 3-digit field for the code and a 28-digit field forthe description of „Terms of Delivery“ (dataelements INCO1 and INCO2).

Create a customer segment Z1INCOnn 

Create an extension ZEXTENnn by extending IDoc type ORDLGT01

Assign logical message ORDLGT to basis type ORDLGT01 and extension ZEXTENnn .

The processing of that extension will be implemented in the following exercises number 5and 6.

Page 27: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 27/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 27

Exercise 5: Extend Outbound (Fill Customer Segment)

You are asked to send „Terms of Delivery“ with your orders documents. The IDoc typeORDLGT01 was already extended in exercise 4. Now you have to implement the

outbound processing.

Create a project

(With exercise 2 the project already exists!)

Select SAP enhancements; search with development class IDOCTRAINING

(With exercise 2 the enhancement is already selected!)

Implement the exit in enhancement components

Activate your project

Because of the IDoc type is maintained in the outbound partner profile, you have toadjust the partner profile for vendor IDOC-LI-nn .

Test your exit by creating a new purchase order via transaction ME21, and check withone of the monitor programs that the IDoc exists, and the segment Z1INCOnn waspopulated (note the IDoc‘s number).

Page 28: Idoc Extension & Processing

8/3/2019 Idoc Extension & Processing

http://slidepdf.com/reader/full/idoc-extension-processing 28/28

SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 28

Exercise 6: Extend Inbound (Process Customer Segment)

You are asked to receive „Terms of Delivery“ with your orders documents. The IDoc typeORDLGT01 was already extended in exercise 4. Now you have to implement the

inbound processing.

Create a project

(With exercise 2 the project already exists!)

Select SAP enhancements; search with development class IDOCTRAINING

(With exercise 2 the enhancement is already selected!)

Implement the exit in enhancement components

Activate your project

Test your exit by reprocessing the inbound IDoc from exercise 5 with the test tool,transaction WE19.

With exercise 2 the IDoc reached status „53“: Sales document posted.With the changes of this exercise also the „Terms of Delivery“ in the sales document areupdated.