Upload
knani9090
View
217
Download
0
Embed Size (px)
Citation preview
8/12/2019 Idocext
1/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 1
Thomas C. BeckerSAP AG
Extension of IDoc typesand Processing
Please pay attent ion to
the notes when pr int ingth is document !The IDoc Interface
8/12/2019 Idocext
2/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 2
Developing IDoc Interfaces
Definitions
How to Extend ?
Exercises to ExtendIDoc Processing
Agenda
8/12/2019 Idocext
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
Segment
Name
Segment
Type
8/12/2019 Idocext
4/28
8/12/2019 Idocext
5/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 5
Definition: IDoc Type
Basis Type
IDoc Type=
Basis Type
IDoc Type
Extension
=
+
8/12/2019 Idocext
6/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 6
Definition: Segment
Segment Type
/partner/ccccc
Segment Name
/partner/ccccc000
Segment Name
/partner/ccccc001
Segment Name
/partner/ccccc013
Segment Type
E1ccccc
Segment Name
E2ccccc000
Segment Name
E2ccccc001
Segment Name
E2ccccc013
8/12/2019 Idocext
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 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.
8/12/2019 Idocext
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
8/12/2019 Idocext
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
8/12/2019 Idocext
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
8/12/2019 Idocext
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 all
the requirements:Development as extension !
The IDoc type requested is not available, or matches only infew requirements:
Development as basis type !
8/12/2019 Idocext
12/28
8/12/2019 Idocext
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.
8/12/2019 Idocext
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.
8/12/2019 Idocext
15/28 SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 15
Areas of a Customer Extension
Define data structure:In area menu WEDI.
Implement processing inoutbound 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
Segment
Name
Segment
Type
8/12/2019 Idocext
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 thesegment editor.
Define the extension by extending abasis type with the
IDoc type editor.
Assign the logical message to the
extension viaenvironment in the IDoc type editor.
8/12/2019 Idocext
17/28 SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 17
Steps to Extend the Processing
Create project inproject management, attributes.
Select the right customer-exit(s) inproject management, SAP enhancements.
Implement the selected customer-exit(s) inproject management, enhancement components.
Outbound: Read the SAP database and format
data into IDoc format.
Inbound: Write data from the IDoc format to the
database.
Activate project in project management.
8/12/2019 Idocext
18/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 18
Outbound Call Sequence
SAP Application
Message Control
IDoc Interface
IDoc Interface
Process CodeCall Function ...
EDI subsystem
Customer-exit 1
Customer-exit 2
Customer-exit x
8/12/2019 Idocext
19/28
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
8/12/2019 Idocext
20/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 20
Publish Documentation of IDoc Types
Begin
End
...
typedef struct z2incodx000
{
} z2incodx000
8/12/2019 Idocext
21/28
SAP Labs, Inc. 1999 EDI01 (Thomas Becker) / 21
Developing IDoc Interfaces
Definitions
How to Extend ?
Exercises to ExtendIDoc Processing
Agenda
8/12/2019 Idocext
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
8/12/2019 Idocext
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 message
control settings are EF / NEU / LF, the logical message is ORDLGT with process code
ME21-BC621-nn.
This set-up was already done!
Create a purchase order via transaction ME21, and check with one of the monitor
programs that the IDoc exists (note the IDocs number).
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.
This set-up was already done!
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.
8/12/2019 Idocext
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 from
purchasing 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.
8/12/2019 Idocext
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 segment
E1HEAD, 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 with
one of the monitor programs that the IDoc exists, and the field NAME is populated.
E i 4 E d ID T
8/12/2019 Idocext
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 IDoc
type 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 for
the description of Terms of Delivery (dataelements INCO1 and INCO2).
Create a customer segment Z1INCOnn
Create an extension ZEXTENnnby 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 5
and 6.
E i 5 E t d O tb d
8/12/2019 Idocext
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 type
ORDLGT01 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 to
adjust the partner profile for vendor IDOC-LI-nn.
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 Z1INCOnnwas
populated (note the IDocs number).
E i 6 E t d I b d
8/12/2019 Idocext
28/28
Exercise 6: Extend Inbound (Process Customer Segment)
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.
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 are
updated.