• No results found

Complete Ref on SAP Idoc

N/A
N/A
Protected

Academic year: 2021

Share "Complete Ref on SAP Idoc"

Copied!
100
0
0

Loading.... (view fulltext now)

Full text

(1)

Prepared and Submitted by

Ramesh Jakkula

81221

Complete reference on

SAP IDOC

(2)

Complete reference on SAP IDOC

Contents

Introduction

3

Communication between SAP and Legacy system through IDOC

3

Things to be achieved:

3

Functional Logical Flow steps:

4

a.

How Output Type gets triggered

4

b. How IDOC gets generated

5

c.

How IDOC gets read

5

Brief explanation on IDOC

6

Creation of Condition table: SPRO or V/60

16

Creation of Access sequence: SPRO

19

Creation of Output type: SPRO

22

Assigning Delivery type to Output determination procedure: SPRO

26

Creation of Condition records: NACE

34

Creation of Logical system: SALE

37

Creation of Port: WE21

39

Creating a partner profile: WE20

41

Outbound IDOC

42

Creation of segment: we31

42

Creation of IDOC type: WE30.

49

Creation of Message type: WE81

56

Creating link between IDOC type and Message type: WE82

58

Creation of Process code: WE41

59

Coding in User exits of Function Module: SE37

61

Viewing IDOC in IDOC list: WE02

77

Inbound IDOC

79

Creation of Function module: SE37

79

Assigning the characteristics for FM: BD51

85

Assigning FM with IDOC type: WE57

86

Creation of process code: WE42

88

Creating partner profile for Inbound parameter: WE20

91

Processing of Inbound IDOC manually: WE19

95

(3)

Introduction

This document is prepared to guide technical and functional flow for IDOC The scope of this document includes complete steps to create outbound & inbound IDOC in SAP R/3. The document gives detail on the functional customization required while creating outbound & inbound IDOC.

System SAP R/3 is used for the Outbound and Inbound operations. Information for Business (SAP R/3) would flow to-fro through IDOC using EDI as transmission mode.

Communication between SAP and Legacy system through IDOC

Outbound IDOC

Inbound IDOC

Outbound IDOC: When IDOC is sent from SAP to Legacy system. The data from tables of SAP will be filled into the segments of the IDOC and it is sent to the Legacy system. We will maintain Recipient information. Inbound IDOC: When IDOC is sent from Legacy to SAP system. The Incoming IDOC is read by SAP and the data from segments of the IDOC will be updated into the tables of the SAP system. We will maintain Sender information.

Things to be achieved:

The Partner profile: Condition table, Access sequence, Requirement routine, Output determination procedures, Condition records, Application, Partner number, Partner type, Partner function, Output type, Port, Process code, Function Module and Message type.

IDOC creation: Segments, Basic type or Extension type. Generating the Out going IDOC (Outbound).

Reading the Incoming IDOC (Inbound).

(4)

Complete reference on SAP IDOC

Functional Logical Flow steps:

a. How Output Type gets triggered

Since the document is made for the Business logic (Ex: Delivery), when the delivery is created or changed then output type gets triggered by the following steps.

Note: Condition type is nothing but Output type

Output determination procedure

Condition type

Access sequence

Condition table

Req.

routi

ne

Triggering of Output type

Conditi

on

records

Delivery type

Creation of Delivery

(5)

b. How IDOC gets generated (Outbound IDOC)

c. How IDOC gets read (Inbound IDOC)

Triggering of Output type

Program RSNASTED (perform EDI_PROCESSING)

Process code

Functional Module (Fills the standard segments)

Table EDP12

User Exits

Filling the user defined segments or updates the standard segment data

Generating the IDOC with appropriate status

Incoming IDOC

Process code

Functional Module

Table EDP21

Validates the Sender and Recipient information (Checks for partner profile)

Validates the Sender and Recipient information (Checks for partner profile)

Table TEDE1

(6)

Complete reference on SAP IDOC

When Delivery created or changed (vl01n or vl02n) then.

1. Output determination procedures (NACE).

2. Get the condition type. e.g.: ZDLV

3. Validates Requirement routine if maintained.

4. If succeed in Requirement routine then it will go ahead otherwise returns to the delivery

screen without triggering the output type.

5. It will get the access sequence from condition type.

6. For that access sequence it will get the Condition table

7. It checks for the existence of Condition records in the condition table.

8. If succeed then the Condition type will get triggered and in turn the output type will gets

triggered. If fails then returns to the delivery screen without triggering the output type.

9. Once the output type triggered then for that output type the processing routine program

will be executed e.g.: program RSNASTED and form EDI_PROCESSING. In this form it

will get the Process code for the respective output type and since the Function Module is

attached to the Process code, it executes the FM (IDOC_OUTPUT_DELVRY) and in turn

it will executes the user exits where the code has been written to fill the IDOC according

to the requirement of the project and generates the IDOC and send it outside the system

with proper status.

10. In case Inbound IDOC, FM is used to read the segments and by using BAPI or BDC or

LSMW data of segments will be updated into the tables and appropriate message will be

updated in the IDOC status.

Brief explanation on IDOC

1. The IDOC is nothing but (I) Intermediate (DOC) Document.

2. It is a data container (ASCII file format) used to exchange the information between any two systems.

3. Each IDOC has its own unique identity number (within a client).

4. IDOC’s are stored in database (table EDID4) as simple flat files with lines of text, where the lines are structured into data fields.

(7)

5. IDOC’s are processed by FM which can be assigned while customization. 6. It is system independent (SAP-to-SAP or Non-SAP (Legacy)).

7. It can be viewed in text editor; the data stored in DIOC is in character format. 8. IDOC’s are direction independent (Outbound or Inbound).

9. IDOC’s consists of 3 components. a. Control records (EDIDC). b. Data records (EDIDD). c. Status records (EDIDS).

10. The interface used can be EDI (Electronic Data Interchange) between two SAP or with any NON-SAP systems or ALE (Application link Enabling) between two NON-SAP systems.

(8)

Complete reference on SAP IDOC

(9)

2. Current status: A two-digit status is assigned to an IDOC to allow the processing to be monitored. Both the SAP application and the external system during status confirmation must maintain the field with the correct value. The statuses for outbound IDOC’s are between '01' and '49', while the statuses for inbound IDOC’s begin with '50'.

3. Basic type: It is the initial creation of IDOC type where everything is designed according to the standard by SAP.

4. Extension: It is the extension of Basic type where all the segments of Basic type will exists and also the additional user defines segments exists. It is defined by the customer.

5. Message type: The message type is a business function and is unique identifier of business process where IDOC type is being used. The three field’s message type (required), message code (optional) and message function (optional) belong to the key fields in the partner profiles,

(10)

Complete reference on SAP IDOC

8. Port: It is the point where the IDOC‘s are accepted from other system and sent to other system.

B. Data records (EDIDD): It carries application dependent data for e.g. Delivery related data The IDOC types can be a Basic type or Extension type.

1. IDOC type: The IDOC type is systematic arrangement of segment in parent and child relation (Header and Item level). It can be Basic type or Extension type. The length of each segment will be of 1000 character long.

(11)

3. Extension type: It is basically defined by the user, it is the extension of basic type for e.g.: ZFPOGSAP.

(12)

Complete reference on SAP IDOC

The structure of segment is similar to a table

(13)
(14)

Complete reference on SAP IDOC

(15)
(16)

Complete reference on SAP IDOC

Creation of Condition table: SPRO or V/60

Condition table: A table where the key fields are data combinations for which messages are triggered (and offered for processing). For each data combination, there is a condition record in the table. The data part contains the actual message. The condition tables which are contained in the standard SAP R/3 System should remain unchanged. If you want to make changes, you should create new condition tables. To do this, copy a similar, already existing condition table and make the necessary changes.

To create a new condition table: Enter the name between 501 and 999 with proper description and then select the desired fields for the condition table from the list of allowed fields. Generate the new condition table.Specify the condition tables in the access sequences. This way, you establish the link between output condition, access sequence and output condition record.

Enter table as 950 and go to menu condition -> create.

(17)
(18)

Complete reference on SAP IDOC

Now click on generate (Shift+F4)

(19)

Creation of Access sequence: SPRO (NACE)

The access sequence defines the order in which the system searches for condition records valid for a condition type. In case of EDI search is made to determine the valid default values for the respective message. To create a new access sequence, copy a similar one already existing in the system and change it to correspond to your requirements. The access sequence should be four-digit alphanumeric start with the letter Z (since SAP reserves this letter for the standard system) with appropriate description. Provide the condition table and requirement routine number.

The Tables: T682, T682T and T682I

(20)

Complete reference on SAP IDOC

Press enter.

Now click on new entries and enter the following.

Save in same package and project. Now double click on Accesses at left.

(21)

Click on new entries and enter the following.

There can be multiple Condition tables per access sequence.

Here you can add requirement depending upon the requirement of the project. Save it. Double click on Fields by selecting the entire row.

(22)

Complete reference on SAP IDOC

Creation of Output type: SPRO (NACE)

The output type represents different output, such as quotations, order confirmations, and delivery notes in the SAP System. To create a new output type, copy a similar access sequence in the system and make the necessary changes the key should begin with the letter Y or Z up to 4 characters, with appropriate description. Here we have to attach a program in change output tab. It is used to control output type on change of some key fields of application data.

Tables: T685, T685B, T685T, TNAPR, T681A and T681B. Click on Maintain Output type.

(23)

Enter the following

(24)

Complete reference on SAP IDOC

Enter the following.

Now double click on processing routines at left.

(25)

Enter the following.

(26)

Complete reference on SAP IDOC

Click on new entries and enter the following

Now save in the same package and project.

Assigning Delivery type to Output determination procedure: SPRO (NACE)

It is the collection of Condition types. Tables: T683, T683U, T683S and T683T.

(27)

Click on Assign Output determination procedure.

Choose the first line.

Since we are going to work only the delivery type LF, the out.pro. is V10000. Now go back and click Maintain Output determination procedure.

(28)

Complete reference on SAP IDOC

Select V10000 and double click on Control data.

Click on new entries and enter the following.

If needed requirement routine then maintain it. Save it in the same package and project. Creation of Requirement routine: SPRO

If the requirement is fulfilled (SY-SUBRC = 0), then it will go for further processing otherwise it will stop and no output type gets triggered.

(29)

Tables: TFRM.

(30)

Complete reference on SAP IDOC

(31)

Save it in the same package and project.

(32)

Complete reference on SAP IDOC

Save it in the same package and project. Now click on insert

(33)

In this case picking status will be C if it is completely picked. If picking status will be C then sy-subrc = 0 then condition record will be executed and if satisfied then condition type will be triggered and in turn output type will be triggered. If sy-subrc = 4 then no condition record will be executed and no output type triggered.

(34)

Complete reference on SAP IDOC

Creation of Condition records: NACE

Tables: B950

(35)
(36)

Complete reference on SAP IDOC

Enter the following

Press F8

(37)

Creation of Logical system: SALE

Tables: TBDLS and TBDLST.

(38)

Complete reference on SAP IDOC

(39)

Creation of Port: WE21

Tables: EDIPORT and EDIPOX.

Select a port

(40)

Complete reference on SAP IDOC

(41)

Creating a partner profile: WE20

Tables: EDPP1, EDP13, EDP21, EDIMSG and EDP12.

Click on create (F5) and enter the following.

(42)

Complete reference on SAP IDOC

Outbound IDOC

(43)
(44)

Complete reference on SAP IDOC

(45)
(46)

Complete reference on SAP IDOC

(47)

Save in proper package and project. Click on back.

(48)

Complete reference on SAP IDOC

Now go to menu Edit -> Set release.

By this the segment is released and can be used in IDOC type. Tables: ZDLVRY

(49)

Creation of IDOC type: WE30.

(50)

Complete reference on SAP IDOC

(51)
(52)

Complete reference on SAP IDOC

Press Enter.

(53)

Now place the cursor at E1EDL22 and Click on Create segment (shift+F6).

(54)

Complete reference on SAP IDOC

Press enter.

(55)

Now go to menu Edit -> Set release.

Click Yes.

(56)

Complete reference on SAP IDOC

Creation of Message type: WE81

Tables: EDMSG.

You can create new or utilize the standard message types. For creation of new message click on Edit button.

(57)

Click on New Entries and enter the following

(58)

Complete reference on SAP IDOC

Creating link between IDOC type and Message type: WE82

Tables: EDIMSG

(59)

Creation of Process code: WE41

Tables: TEDE1 and TMSG1.

Click on Edit and then click on new entries

(60)

Complete reference on SAP IDOC

Double click on Logical messages at left.

(61)

Save in same package and project.

Coding in User exits of Function Module: SE37

Note: We can create Z Function module to fill the segments of IDOC and to generate the IDOC.

(62)

Complete reference on SAP IDOC

(63)
(64)

Complete reference on SAP IDOC

(65)
(66)
(67)

Creating a partner profile for Outbound parameter: WE20

Tables: EDPP1, EDP13, EDP21, EDIMSG and EDP12.

(68)

Complete reference on SAP IDOC

(69)
(70)

Complete reference on SAP IDOC

(71)
(72)

Complete reference on SAP IDOC

Creating/Changing Delivery: VL01n/VL02n

(73)
(74)

Complete reference on SAP IDOC

Change Delivery block as 03

(75)
(76)

Complete reference on SAP IDOC

Now go to menu Extras -> Delivery Output -> Header

The output has been triggered. Now click on Save.

(77)

Viewing IDOC in IDOC list: WE02

(78)
(79)

Inbound IDOC

(80)

Complete reference on SAP IDOC

Click on Create group.

Enter the group name description and save it.

(81)

Click on Create

(82)

Complete reference on SAP IDOC

(83)
(84)
(85)
(86)

Complete reference on SAP IDOC

Click on new entries and enter as follows and save it.

Assigning FM with IDOC type: WE57

Tables: EDIFCT, EDMSG.

(87)
(88)

Complete reference on SAP IDOC

Save it in proper project.

Creation of process code: WE42

Tables: TEDE2, EDMSG and TMSG2.

(89)

Enter the following.

Save it.

(90)

Complete reference on SAP IDOC

Click on new entries

Enter the following

(91)

Creating partner profile for Inbound parameter: WE20

(92)

Complete reference on SAP IDOC

(93)
(94)
(95)

Processing of Inbound IDOC manually: WE19

(96)

Complete reference on SAP IDOC

You can also process by clicking on inbound function module

(97)

Press enter and the inbound IDOC will be processed and a new IDOC will be saved with different number as follows.

Viewing processed Inbound IDOC: WE02

(98)
(99)
(100)

References

Related documents