ABAP IDOC'S BASIC TOOLS 2

Creating an IDoc Segment WE31:

The segment defines the structure of the records in an IDoc. They are defined with transaction WE31.We will define a structure to send a text from the text database.Transaction WE31 calls the IDoc segment editor. The editor defines the fields of a single segment structure. The thus defined IDoc segment is then created as a data dictionary structure. You can view the created structure with SE11 and use it in an ABAP as any TABLES declaration.

To demonstrate the use of the IDoc segment editor we will set up an example, which allows you to send a single text from the text pool (tables STXH and STXL) as an IDoc. These are the texts that you can see with SO10 or edit from within many applications.

We will show the steps to define an IDoc segment YAXX_THEAD with the DDic structure of THEAD.



To facilitate our work, we will use the "copy-from-template-tool", which reads the definition of a DDIC structure and inserts the field and the matching definitions as rows in the IDoc editor. You could, of course, define the structure completely manually, but using the template makes it easier.

 The tool in release 4.0b lets you use both DDIC structures or another IDoc segmentdefinition as a template.


The thus created structure can be edited any time. When saving, it will create a data dictionary structure based on the definition in WE31. The DDIC structure will retain the same name. You can view the structure as a table definition with SE11 and use it in an ABAP the same way.

Defining the Message Type (EDMSG)

The message type defines the context under which an IDoc is transferred to its destination. It allows for using the same IDoc file format for several different applications.Imagine the situation of sending a purchase order to a supplier. When the IDoc with the purchase order reaches the supplier, it will be interpreted as a sales order received from a customer, namely you.

Simultaneously you want to send the IDoc data to the supplier's warehouse to inform it that a purchase order has been issued and is on the way.Both IDoc receivers will receive the same IDoc format; however, the IDoc will be tagged with a different message type. While the IDoc to the supplier will be flagged as a purchase order (in SAP R/3 standard: message type = ORDERS), the same IDoc sent to the warehouse should be flagged differently, so that the warehouse can recognize the order as a mere informational copy and process it differently than a true purchase order.

The message type together with the IDoc type determine the processing function. The message types are stored in table EDMSG.Defining the message type can be done from the transaction WEDI

EDMSG: Defining the message type (1)

The entry is only a base entry which tells the system that the message type is allowed. Other transactions will use that table as a check table to validate the entry. IT is as shown .



EDMSG: Defining the message type (1):

The entry is only a base entry which tells the system that the message type is allowed. Other transactions will use that table as a check table to validate the entry.


RELATED POSTS

No comments :

Post a Comment