Sie sind auf Seite 1von 28

SAP Labs, Inc.

1999 EDI01 (Thomas 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
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 2
.Developing IDoc Interfaces
=Definitions
=How to Extend ?
=Exercises to Extend
IDoc Processing
Agenda
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
Segment
Name
Segment
Type
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
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 4
IDoc Record Types
Status Record
IDoc-ID
Status information
Data Record
IDoc-ID
Sequence/Hierarchy
Segment
Format definition for
header data
item data
Control Record
IDoc-ID
Sender-ID
Receiver-ID
IDoc type and logical message
External structure
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 5
Definition: IDoc Type
Basis Type Basis Type
IDoc IDoc Type Type
= =
Basis Type Basis Type
IDoc IDoc Type Type
Extension Extension
= =
+ +
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/ccccc001
Segment Name
/partner/ccccc001
Segment Name
/partner/ccccc013
Segment Name
/partner/ccccc013
Segment Type
E1ccccc
Segment Type
E1ccccc
Segment Name
E2ccccc000
Segment Name
E2ccccc000
Segment Name
E2ccccc001
Segment Name
E2ccccc001
Segment Name
E2ccccc013
Segment Name
E2ccccc013
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 distinguish
versions 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 IDoc
type is created always, if changes are made after releasing
that object.
Possible changes are strongly restricted to guarantee
external compatibility of the IDoc interface.
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
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
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 10
Tools to Develop an IDoc Type
Tool to define the
segment with its fields
E1HDDOC
Tool to define the
IDoc type with its segments
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 11
What Kind of Development, and When
The IDoc type requested is available, and matches all
requirements:
Nothing to be done !
The IDoc type requested is available, but does not match in all
the requirements:
Development as extension !
The IDoc type requested is not available, or matches only in
few requirements:
Development as basis type !
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 12
.Developing IDoc Interfaces
=Definitions
=How to Extend ?
=Exercises to Extend
IDoc Processing
Agenda
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.
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.
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 15
Areas of a Customer Extension
O Define data structure:
In area menu WEDI.
O Implement processing in
outbound and inbound:
Project management CMOD.
O Publish documentation:
In area menu WEDI.
Application
Function Module
Program
Report
Business Workflow
Function Module
IDoc Interface
Segment
IDoc Type
Segment
Name
Segment
Type
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 16
Steps to Extend the Data Structure
O Identify the required fields, and their
underlying data elements in ABAP
repository.
O Define the required segments with the
segment editor.
O Define the extension by extending a
basis type with the
IDoc type editor.
O Assign the logical message to the
extension via
environment in the IDoc type editor.
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 17
Steps to Extend the Processing
O Create project in
project management, attributes.
O Select the right customer-exit(s) in
project management, SAP enhancements.
O Implement the selected customer-exit(s) in
project management, enhancement components.
Outbound: Read the SAP database and format
data into IDoc format.
Inbound: Write data from the IDoc format to the
database.
O Activate project in project management.
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
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 19
Inbound Call Sequence
EDI subsystem
IDoc Interface
Process Code
Call Function ...
SAP Application
Customer-exit 1
Customer-exit 2
Customer-exit x
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 20
Publish Documentation of IDoc Types
Begin

End
...
typedef struct z2incodx000
{

} z2incodx000
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 21
.Developing IDoc Interfaces
=Definitions
=How to Extend ?
=Exercises to Extend
IDoc Processing
Agenda
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 22
Exercises to Extend IDoc Processing
SAP System R/3 SAP System R/3
IDoc
Orders Light
Orders
Customer Vendor
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 23
Exercise 1: Start-Up
C Set-up a partner profile to send purchase orders to vendor IDOC-LI-nn. The message
control settings are EF / NEU / LF, the logical message is ORDLGT with process code
ME21-BC621-nn.
E This set-up was already done!
C Create a purchase order via transaction ME21, and check with one of the monitor
programs that the IDoc exists (note the IDocs number).
C Set-up a partner profile to receive customer orders from customer IDOC-KU-nn. The
logical message is ORDLGT with process code VA01-BC621-nn.
E This set-up was already done!
C With the test tool, transaction WE19, flip-around the IDoc created in step 2. The IDoc will
serve as the customer order. Because you have changed sites, you have to change the
control 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 reaches
status 51: Document type NB unknown.
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 24
Exercise 2: Extend Inbound (Cross Reference)
C You plan to overcome the error from exercise 1 by implementing a cross-reference from
purchasing document type NB to sales document type TA.
Hence you implement a customer-exit for the inbound processing in project
management.
C Create a project
C Select SAP enhancements; search with development class IDOCTRAINING
C Implement the exit in enhancement components
C Activate your project
C 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.
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 25
Exercise 3: Extend Outbound (Fill Field)
C The IDoc type ORDLGT01 has the field NAME (ekko-ernam in purchasing) in segment
E1HEAD, anyway the field is not populated by outbound processing.
Hence you implement a customer-exit for the outbound processing in project
management.
C Create a project
(With exercise 2 the project already exists!)
C Select SAP enhancements; search with development class IDOCTRAINING
(With exercise 2 the enhancement is already selected!)
C Implement the exit in enhancement components
C Activate your project
C Test your exit by creating a new purchase order via transaction ME21, and check with
one of the monitor programs that the IDoc exists, and the field NAME is populated.
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 26
Exercise 4: Extend IDoc Type
C You are asked to transmit Terms of Delivery with your orders documents. Neither IDoc
type ORDLGT01 nor one of its segments has fields for Terms of Delivery.
C Extend the IDoc type ORDLGT01 with a 3-digit field for the code and a 28-digit field for
the description of Terms of Delivery (dataelements INCO1 and INCO2).
C Create a customer segment Z1INCOnn
C Create an extension ZEXTENnn by extending IDoc type ORDLGT01
C Assign logical message ORDLGT to basis type ORDLGT01 and extension ZEXTENnn.
- The processing of that extension will be implemented in the following exercises number 5
and 6.
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 27
Exercise 5: Extend Outbound (Fill Customer Segment)
C You are asked to send Terms of Delivery with your orders documents. The IDoc type
ORDLGT01 was already extended in exercise 4. Now you have to implement the
outbound processing.
C Create a project
(With exercise 2 the project already exists!)
C Select SAP enhancements; search with development class IDOCTRAINING
(With exercise 2 the enhancement is already selected!)
C Implement the exit in enhancement components
C Activate your project
C Because of the IDoc type is maintained in the outbound partner profile, you have to
adjust the partner profile for vendor IDOC-LI-nn.
C Test your exit by creating a new purchase order via transaction ME21, and check with
one of the monitor programs that the IDoc exists, and the segment Z1INCOnn was
populated (note the IDocs number).
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 28
Exercise 6: Extend Inbound (Process Customer Segment)
C You are asked to receive Terms of Delivery with your orders documents. The IDoc type
ORDLGT01 was already extended in exercise 4. Now you have to implement the
inbound processing.
C Create a project
(With exercise 2 the project already exists!)
C Select SAP enhancements; search with development class IDOCTRAINING
(With exercise 2 the enhancement is already selected!)
C Implement the exit in enhancement components
C Activate your project
C 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 are
updated.

Das könnte Ihnen auch gefallen