IDOC Development Procedures

  • View
    122

  • Download
    16

Embed Size (px)

DESCRIPTION

IDOC Development Procedures

Text of IDOC Development Procedures

Information Technology

IDoc TemplateSAP Development Architecture

Effective: Revised: Owner: IT Architect: Prepared By: Document Version:

Information Technology Document Revision History Date Version Author Change Description

143680243.doc

Page 1 of 41

Information Technology

Table Of ContentsIntroduction to IDocs.............................................................................................................................................3 Structure of an IDoc..............................................................................................................................................3 GENERAL DEFINITION............................................................................................................................................4 1)CREATING A NEW IDOC...........................................................................................................................................5 OUTBOUND IDOC...................................................................................................................................................14 1)PROGRAMMING IN THE IDOC INTERFACE..............................................................................................................14 2)CONFIGURING THE SYSTEM FOR OUTBOUND IDOCS .............................................................................................17 3)TRANSPORTING THE IDOC TO THE RECEIVING SYSTEM.........................................................................................22 INBOUND IDOC........................................................................................................................................................23 1)PROGRAMMING IN THE IDOC INTERFACE..............................................................................................................23 2)CONFIGURING THE SYSTEM FOR INBOUND IDOCS.................................................................................................24 TESTING IDOCS.......................................................................................................................................................28 MONITORING IDOC................................................................................................................................................29 .......................................................................................................................................................................................33 APPENDIX A..............................................................................................................................................................34 APPENDIX B..............................................................................................................................................................36 APPENDIX C..............................................................................................................................................................37 REFERENCES............................................................................................................................................................39

143680243.doc

Page 2 of 41

Information Technology

Introduction to IDocsThe term IDoc stands for Intermediate document. It is simply a data container (like a text file) used to exchange information between any two processes systems, which can understand the semantics and syntaxstructure and content of the data. An IDoc is created as a result of an outbound ALE or EDI process; an IDoc serves as input to create an application document. For example, an IDoc is created when an order is placed and this IDoc can be used to create a purchase order. Idocs are stored in the database. Every IDoc has a unique number. They can be used for SAP to SAP and SAP to non-SAP communication as long as the participating processes can understand the structure and content of the data. IDoc types are independent of the direction of data exchange. An inbound and an outbound process can use the same IDoc type. Eg. ORDERS01 IDoc is used by the purchasing module to send a purchase order and it is also used by the Sales and Distribution module to accept a sales order. IDocs can be viewed in a text editor since the data is stored in character format. Structure of an IDoc. An IDoc structure consists of several segments. A and segments consists of several data fields. The IDoc structure defines the syntax of the data by specifying a list of permitted segments, the arrangement of the segments, mandatory versus optional segments. Segments define a set of fields and their formats. An IDoc is an instance of an IDoc type and consists of three types of records. One control record. Each IDoc has only one control record. The control record contains all the control information about an IDoc, including o IDoc number, o the sender and recipient information, o information such as message type it represents, o IDoc type, o present status.

The control record structure is the same for all IDoc types. The SAP defined structure is EDIDC and can be viewed using transaction SE11. One or many data records. An IDoc can have multiple data records, as defined by the IDoc

structure. Segments translate into data records. Data records store the application data, such as purchase order header information and purchase order detail lines. The structure of a data record is defined in EDI_DD40 and the data records are found in EDID4.One or many status records. Multiple status records are usually attached to an IDoc. Status records are attached to an IDoc throughout the process, as the IDoc achieves goes through different stagesdifferent milestones. A status code, date and time are assigned at every milestonestage. Transaction WE47 will give you a list of status codes and their definitions. Codes 01 through 49 are used for outbound IDocs and 50 onwards for inbound. The status records can are stored in EDIDS table.

Multiple messages per IDoc type. A message represents a specific type of document transmitted between two partners. Orders, order response, customer master are examples of messages. An IDoc type can be used to represent several message types (of course, the messages must be logically related). For example, the orders IDoc type

143680243.doc

Page 3 of 41

Information Technology (ORDERS05) is used for several messages, including orders (ORDERS), order response (ORDRSP), and order change (ORDCHG.).

General DefinitionWhen creating a new IDoc, the following steps needs to be carried out in both the sending (ES1150) and receiving system (GDV200). There are six phases involved in the methodology to create an IDoc for any Outbound Process (With or without MC). 1) Analysis: Analyze the business requirements and compare them with what SAP Provides. 2) Preparation: Identify various parameters used in the process 3) Setup: Configure the EDI components and build the necessary Master Data. 4) Testing: test the setup phase. 5) Execution: Execute the process 6) Verification: Verify the results

Case Scenario:Lets go through the whole process of creating a new IDoc. We will use a simple example where the system sends out a monthly report for each employees weekly hours. The report is divided in three parts: Header, Details and Summary. Here is an example of a Flat file and actual report Last Name (15) Week Number (1) Total Hours (3) Smith 1 30 2 30 3 4 30 50 140 First Name (15) Social Security (11) Date of Birth (8) Client Site (20) Employee Header (Occurs Once, Required) Work Description Weekly Details (40) (Multiple)

Hours Hourly Rate Worked (3) (3) Total Amount Summary (10) (Occurs once) 123-45-6789 Houston Brewery Network Computers Network Computers DSP Systems

John 40 40 50 60 6900

102668 Beer Testing High level consulting Programming EDI Programming

To accomplish this we will first: create a new IDoc (covers the first three phases above), second: Configure the IDoc (phase three), and last test, execute and verify. Here is also the break up of names that will be assigned to the different components COMPONENT Message Type 143680243.doc NAMING CONVENTION Z ACTUAL NAMEZEMP_MNT_RPT

Page 4 of 41

Information Technology Idoc Type Segment Type Outbound Function Module Z 01 Z Z_IDOC_OUTPUT_ZEMP_MNT_RPT01 Z1EMP_HD, Z1WK_DET, Z1CL_DET, Z1SUMRY Z_IDOC_OUTPUT_EMPMTHRPT

1) Creating a New IDocThe following steps take you through a standard procedure whenever creating a New IDoc. Before going to this, it is important get the right standards. Naming Convention: Names assigned to an IDoc type should be meaningful. It should tell the user what that IDoc does. Maximum length allowed is 30 characters for release 4x. Here is a format for naming custom IDocs. Z Custom IDoc type must start with Z and end with two numeric characters. This number denotes the version of the IDoc. In general the version number is incremented by one. Example, for our case we will assgin the name ZEMP_MNT_RPT01. For the next version, this IDoc will be ZEMP_MNT_RPT02. Naming Segments requires the following format Z1 All custom segments begin with Z1 and all SAP Segments begin with E1 Design Guidelines: Develop an IDoc type for a function, not for a specific application. Example: ORDERS02 is designed for the order process and not specifically for the sales order entry application. Thus, this IDoc is used for several documents such as Purchase order, Sales order, Order response. You should follow a similar strategy when creating a new Basic IDoc type. Use industry standards whenever possible for your data elements. Consult EDI standards for the appropriate length and data types and ISO codes for fields such as measurement units and currencies. Organize the document to contain header, det