Wednesday, May 27, 2015

SAP ABAP ALE IDOC 2

SAP ABAP  ALE IDOC 2
  1. Steps to create a ALE system:
    1. Go to transaction SALE.
    2. Name a logical system. (<server_name>CLNT<client_number>)
      • S21CLNT800
    3. Assign logical system to the client.
      • Sender S21
    4. DO both the above steps in target system too. create a logical system and assign this to a client.
    5. Go to transaction SM59 in source system, to create an RFC connection to the target system.
    6. Test the connection and test remote login.
    7. Create a Port using transaction WE21.
    8. Goto transaction BD64 to create model view. (only if you have two different systems)
      • Add message type
      • create partner peofile
    9. GO to transaction BD10 to send a material (MATMAS)
    10. in target system goto transaction BD11 and check the same material you going to receive.
    11. BD12 to send a customer.
    12. BD13 to get a customer.
    13. BD87 to process Idocs which are in error.
    14. WE19 is a test tool for Idocs.
    15. WE09 to search data in Idoc segment.
    16. Function Module MASTER_IDOC_DISTRIBUTE to create an outbound Idoc in your system.
=============================================================
Common steps :

1) Define Logical system @ sender (SALE)  : S21CLNT811
   S21CLNT800

In any distributed environment, each participating system must have a unique ID to avoid confusion. In SAP, the name of the logical system is used as the unique ID. This name is assigned explicitly to one client in an SAP system.

2) Assign Logical system to Client (SALE) : Client 811 IDES-ALE: Production
           Client 800 Sender S21
3) Configuration of RFC connection (SM59) : RFC Destination     S21CLNT811 
   RFC Destination     S21CLNT800
4) Test Connection (SM59).
5) Creating RFC ports (WE21): A000000077
A000000079
=============================================================

=============================================================

For example two clients in the same R/3 instance.

Client 900 = 800 source system   table ZDC_HBHT_IDOC_2 with data

Client 800 = 811 reciever system table ZDC_HBHT_IDOC_2 without data


To transfer the data between two clients the table structures and their data types should be match.  

In this example, Client 900 is Source system, and Client 800 is destination system.

In Client 900 I have created a customized table and inserted some records.

In Client 800 I have created only table. 
=============================================================


Steps in Client 800:
1) Create Segment ( WE31 )      : ZSEG_HT
2) Creating Basic IDOC Type ( WE30 )      : ZIDC_HB 
3) Realease Basic Type IDOC ( WE30 Menu ) : 
4) Creating message Type   ( WE81 )      : ZMSG_HT
5) Assign Message Type to Basic IDOC Type (WE82) :   
6) Creating Model View and Distributing and Generating Partner profile (WE20) (BD64): ZMV_HBHT 
Target system S21CLNT811                  
Model view ZMV_HBHT has been created
7) Partner : S21CLNT811

8) Create reportZ_HBHT_TEST_IDOC_SENDER      : Idoc Generated 0000000001037851

=============================================================
Steps in Client 811:
1) Create a function module      : Z_HBHT_IDOC_RECIEVER
2) Assign FM to Logical Message (WE57): Z_HBHT_IDOC_RECIEVER Function module ZIDC_HB ZMSG_HT Inbound Message Type
3) Define Input Method for Inbound Function Module              (BD51): Z_HBHT_IDOC_RECIEVER 2
4) Creating Process Code: (WE42): ZPCD
5) Generating the Partner Profile (BD64): Partner No. S21CLNT800
6) Transferring the IDOC control records from Client 900 to 800      : Idoc Generated 0000000001037852 in sender 
======================================================================


========================================================================
To communicate with each other. SAP has designed for R/3 systems its own communication tool IDocs, it is even possible, using a middle ware EDI system, to have R/3 system communicate by Idocs on its side, with an open system by XML files on the other side,

    1. Idoc segment  : A segment is a record, defined as such in the database vocabulary. There is no hierarchical structure within the segment.
    2. Sections: An Idoc is made of three sections. control data and status. control section have only single segment, whereas other two sections may have one or more segments.
      • Status section is not transported with the Idoc, only control and data sections are. status is taken from the last segment in the idoc status section.
        • Status
        • Message
      • Control section represents the header section of an Idoc, it contains information about both sender and receiver systems.
        • Idoc Number
        • Direction (1 for outbound , 2 for inbound)
        • Status : current status of Idoc.
        • Basic Type
        • Extension Type
        • Message Type
        • Sender or Receiver information
        • Port
        • Partner number
        • Partner Type (LS, KU, Vendor, ...)
        • SAP Release version number of the Idoc.
        • Output Mode : 2 for immediate sending , collective sending.
      • Data Section :it contains one or many segments which are arranged in hierarchical order. there is a concept of child and parent segment,  a child segment may not exist if there is not the parent segment.
        • Every segment of the data section must have character field format.
    3. Structure of interface:
      • A view of the distribution mode
      • No, one or many filters
      • A sending system
      • A receiving system
      • A message Type
      • For outbound process:
        • A port to emit to
        • An output mode
        • A packet size
        • A basic IDoc type
      • For inbound interface
        • A process code
    4. View of the distribution model is only obligatory if filters need to be applied. BD64.
    5. Message Type and Basic Idoc Type:
      • A message Type is conceptually represents nature of the Idoc.
      • MATMAS is a message type which belong to many Idoc Type Like MATMAS01, MATMAS02 etc..

    6. Partner profiles: Dealing with every interface which do not have filters.
========================================================================
Idoc Important tables:
  • EDCIM : extension Type
  • EDCIMT : Description for the Idoc Type
  • EDADMDEB : Storage of debugger setting
  • EDBAS : Basic Idoc Types
  • EDBAST : store the description for the basic Idoc Type
  • EDE1T : text table fro outbound process code
  • EDE2T : text table for inbound process code
  • EDE5T : Text table for error processing process code
  • EDE6T: text table for process code for inbound process code
  • EDID4 : Idoc data record fro ECC 4.0
  • EDIDD_OLD : Idoc data record
  • EDIDOT : Short description for I doc Type
  • EDIFCT : IDoc: Assignment of FM to log. message and IDoc type
  • EDIMSG : Output types and assignment to Idoc types
  • EDIPOA : Table for ALE port definition
  • EDIQI : Rfc queue for inbound Idoc
  • EDIQO : Rfc queue for outbound 
  • EDISDEF : Segment Definition for Idoc
  • EDP12: 
  • EDP13: Partner profiles (outbound ) 
  • EDP21 : Partner profiles ( Inbound ) 
  • TEDE1: Process code for output type
  • TEDE2: Process code for input type
========================================================================
Customizing an outbound Interface:
  1. Creation of a new segment type WE31
  2. Creation of new Idoc Basic Type WE30
  3. Creation of new message type WE81
  4. Association with message type to Idoc type : WE82
  5. Launch BD64 (display Distribution Model ) 
    1. Create distribution model
    2. Distribute the distribute model view
    3. Generate and manage partner profile
  6. BD59 : 
Integration of an inbound Idoc :
  1. BD51  : used to register to a function module.
  2. WE57 : function module integrated to a message type.
  3. WE42 : used to inbound process code integration 
  4. WE41 : used to outbound integration
4.1 Useful transactions for IDocs
BD87 : Status Monitor for ALE Messages
SALE : Display ALE Customizing
WE02 : Display IDoc
WE05 : IDoc Lists
WE09 : Search for IDoc in Database
WE19 : Test tool

4.2.1 Outbound IDocs statuses
Statut Description
0 Not used, only R/2
1 IDoc generated
2 Error passing data to port
3 Data passed to port OK
4 Error within control information of EDI subsystem
5 Error during translation
6 Translation OK
7 Error during syntax check
8 Syntax check OK
9 Error during interchange handling
10 Interchange handling OK
11 Error during dispatch
12 Dispatch OK
13 Retransmission OK
14 Interchange Acknowledgement positive
15 Interchange Acknowledgement negative
16 Functional Acknowledgement positive
17 Functional Acknowledgement negative
18 Triggering EDI subsystem OK
19 Data transfer for test OK
20 Error triggering EDI subsystem
21 Error passing data for test
22 Dispatch OK, acknowledgement still due
23 Error during retransmission
24 Control information of EDI subsystem OK
25 Processing despite syntax error (outbound)
26 Error during syntax check of IDoc (outbound)
27 Error in dispatch level (ALE service)
28 Not used
29 Error in ALE service
30 IDoc ready for dispatch (ALE service)
31 Error - no further processing
32 IDoc was edited
33 Original of an IDoc which was edited
34 Error in control record of IDoc
35 IDoc reloaded from archive
36 Electronic signature not performed (timeout)
37 IDoc added incorrectly
38 IDoc archived
39 IDoc is in the target system (ALE service)
40 Application document not created in target system
41 Application document created in target system
42 IDoc was created by test transaction

4.2.2 Inbound IDocs statuses
Status Description
50 IDoc added
51 Application document not posted
52 Application document not fully posted
53 Application document posted
54 Error during formal application check
55 Formal application check OK
56 IDoc with errors added
57 Test IDoc: Error during application check
58 IDoc copy from R/2 connection
59 Not used
60 Error during syntax check of IDoc (inbound)
61 Processing despite syntax error (inbound)
62 IDoc passed to application
63 Error passing IDoc to application
64 IDoc ready to be transferred to application
65 Error in ALE service
66 IDoc is waiting for predecessor IDoc (serialization)
67 Not used
68 Error - no further processing
69 IDoc was edited
70 Original of an IDoc which was edited
71 IDoc reloaded from archive
72 Not used, only R/2
73 IDoc archived
74 IDoc was created by test transaction

============================================================================================================
configuration of IDoc inbound process:

  • Follow the below steps.
    1. Go to NACE transaction
    2. Select V1 application and select OUTPUT TYPES
    3. Select the requred output type and double click on Processing routines.
    4. Enter Medium as DISTRIBUTION ALE, Program as RSNASTED and Routine as ALE_PROCESSING.
    5. Save it.

    Follow the below steps to configure the condition records:
    1. Go to NACE
    2. Select V1 application and select CONDITION RECORDS
    3. Select the requred output type and click on Condition records
    4. Selection screen will be displayed.
    5. Go for execution. In that screen enter the selection criteria. For eg Conditin record is based on Sales document type then
    Sales doc type = OR
    Funt = SP
    Partner -

    leave it blank. It means there is no restriction on partner numbers.
    Medium = A
    date/time = 4
    Lan = EN.
    Note: patner isleft blank means, the sales order of type OR can be send to all partners.
    6. .save it.

    Hope u did the ALE configuratins








No comments:

Post a Comment