How to create and customize IDOC.doc

(879 KB) Pobierz
MIGRATION



Project: Fox

 

 

Phase: Realisation

Date:

Document:

Author:

07/03/06

Solution documentation

P.Trzak

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

List of changes (id)

Short description

Date

Status

MIr

Inbound processing

01.10.2008

 

Mir

IDOC extension

02.10.2008

 

Status               (open, close, in process)


Table of Contents

 

1              Creation of the new IDOC + outbound (out of SAP) IDOC processing              3

1.1              IDOC segments              3

1.2              IDOC type (WE30)              5

1.3              Message type creation              9

1.4              IDOC customizing              10

1.4.1              Message Types and Assignment to IDOC Types (WE82)              10

1.4.2              Partner profiles (WE20)              11

1.5              IDOC sending program              21

2              Inbound IDOC processing              23

2.1              IDOC type, IDOC segment, IDOC basic type              23

2.2              Process codes (WE42)              26

2.3              Characteristics of inbound functions modules (BD51)              28

2.4              Assignment of FM to Log. Message and IDOC Type (WE57)              29

2.5              Partner profile (WE20)              30

2.6              IDOC receiving              31

3              Extension of IDOC              34

4              User exit to process extra Z-fields in the material master IDOC              39

5              IDOC customizing              40

5.1              Message Types and Assignment to IDOC Types (transaction WE82)              40

5.2              Assignment of FM to Log.Message and IDOC Type (WE57)              41


1          Creation of the new IDOC + outbound (out of SAP) IDOC processing

 

IDOC related transactions: menu transaction WEDI (try twice if does not work first time)

 

 

 

 

1.1        IDOC segments

First we need to prepare the segment(s) for our IDOC.

 

 

 

1.2        IDOC type (WE30)

When the segment(s) is/are created we can create the IDOC type itself.

 

Adding the next segments we always refere to the previously added segments. The next segments can be added as a children of the previous segment – or can be on the same level.

 

 

 

Finally the IDOC has to be released. To modify IDOC type later – we have to first run “Cancel release…”.

 

1.3        Message type creation

 

 

 

 

 

1.4        IDOC customizing

1.4.1     Message Types and Assignment to IDOC Types (WE82)

 

 

 

1.4.2     Partner profiles (WE20)

 

 

 

 

 

 

 

 

 

 

 

Add cradentials to able sender system log into receiver system.

 

 

 

 

 

 

 

1.5        IDOC sending program

Below you find an example (not complete – just to give an idea) of the code which creates the IDOC and sends it:

 

* Old style - change it to the new one

  DATA: BEGIN OF T_IDOC_DATA OCCURS 10.

          INCLUDE STRUCTURE EDIDD.

  DATA: END OF T_IDOC_DATA.

 

  DATA: BEGIN OF F_IDOC_HEADER.

          INCLUDE STRUCTURE EDIDC.

  DATA: END OF F_IDOC_HEADER.

 

 

  DATA: BEGIN OF T_IDOC_COMM_CONTROL OCCURS 10.

          INCLUDE STRUCTURE EDIDC.

  DATA: END OF T_IDOC_COMM_CONTROL.

 

 

* ------------ Create first segment ----------------------------

    clear E1MARAM.

    MOVE-CORRESPONDING MARA TO E1MARAM.

 

    CLEAR T_IDOC_DATA.

    T_IDOC_DATA-SEGNAM = C_SEGNAM_E1MARAM.

    T_IDOC_DATA-SDATA = E1MARAM.

 

*   .....Reduce fields for the segment "standard - we can also call it

    CALL FUNCTION 'IDOC_REDUCTION_FIELD_REDUCE'

      EXPORTING

        MESSAGE_TYPE = MESSAGE_TYPE

        SEGMENT_TYPE = C_SEGNAM_E1MARAM

        SEGMENT_DATA = T_IDOC_DATA-SDATA

      IMPORTING

        SEGMENT_DATA = T_IDOC_DATA-SDATA.

 

    APPEND T_IDOC_DATA.

 

 

* ------------ Create second segment ----------------------------

   CLEAR E1MVKEM.

        MOVE-CORRESPONDING MVKE TO E1MVKEM.

 

        CLEAR T_IDOC_DATA.

        T_IDOC_DATA-SDATA = E1MVKEM.

        T_IDOC_DATA-SEGNAM = C_SEGNAM_E1MVKEM.

 

*       .....Reduce fields for the segment

        CALL FUNCTION 'IDOC_REDUCTION_FIELD_REDUCE'

          EXPORTING

            MESSAGE_TYPE = MESSAGE_TYPE

            SEGMENT_TYPE = C_SEGNAM_E1MVKEM

            SEGMENT_DATA = T_IDOC_DATA-SDATA

          IMPORTING

            SEGMENT_DATA = T_IDOC_DATA-SDATA.

    APPEND T_IDOC_DATA.

 

 

* ------------------ Prepare control record  -------------------------

* ------- who sends, where sends, which IDOC is send etc.

*---------------------------------------------------------------------

 

* fill IDOC_HEADER

  CLEAR F_IDOC_HEADER.

...

Zgłoś jeśli naruszono regulamin