Outbound Idoc Through ALE

download Outbound Idoc Through ALE

of 14

Transcript of Outbound Idoc Through ALE

  • 7/31/2019 Outbound Idoc Through ALE

    1/14

    Welcome, Guest

    Login

    Register

    Getting Started

    Newsletters

    Store

    Solutions

    SAP Services & Support

    About SCN

    Downloads

    Industries

    Training & Education

    Partnership

    Code Exchange

    Lines of Business

    University Alliances Events & Webinars

    Idea Place

    Outbound Idoc Through ALE

    Introduction:

    In this document we will discuss the steps in sending an Idoc ( i.e Outbound Idoc) through ALE.Our requirement is that when we go into transaction IW21 (To create PM notifications),

    After we create a notification and save it the Idoc should be triggered.

    Here we will fill the mandatory fields while creating Notification i.e QMNUM :- Notification Number, QMART :- Notification Type, QM

    For this scenario was given to me as an assignment.

    This document has all the steps required in doing it.

    To Create Idoc Type.

    - First go into transaction WE30 and there we can search for the standard Idoc type

    Which will satisfy our requirement and if we don't find any standard Idoc type then we will create our own custom Idoc type.

    - Here I have found a standard Idoc type which satisfies our requirement as it has the

    Necessary fields which we fill when we create Notification ( the fields are QMNUM, QMTXT, QMART).

    STEP 1

    Added by Syed Nishad, last edited by Syed Nishad on Jul 17, 2008

    Page 1 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    2/14

    STEP2 After opening the Idoc type in Display mode.

    STEP 3 After double clicking on E1NTHDR.

    Page 2 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    3/14

    STEP 4 Click on the segment editor to see the fields which are there in that segment.

    Therefore this segment has the three fields which we require i.e Qmnum, Qmart, Qmtxt.

    NOTE :- If we are using a custom idoc then release it. Then only you will be able to use it.

    Finding the message type attached to this Idoc type

    - To find the Message which is attached to this particular idoc type Goto transaction

    Page 3 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    4/14

    WE82.

    - If it's a Custom idoc type then first goto transaction WE81 create a message type and Release it and then Come to transacti

    Idoc type with your message type.

    - After knowing the name of the message type attached to our Idoc type (INOTIF01) we go to next step.

    TRANSACTION WE82.

    Now we know the message type (INOTIF) for our Idoc type(INOTIF01).

    To Establish the RFC connection between the sending system and receiving system.

    - To establish an RFC connection Goto transaction SM59 and select the ABAP connections and find for the RFC connection

    If you find any RFC connection then test it and try to remote logon.

    - If you are able to remotely logon to receiving system then your RFC connection

    Is working fine otherwise you have to create it again.

    - If you don't find the RFC connection for your receiving system then create an RFC connection by giving the necessary para

    been established.

    Page 4 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    5/14

    Page 5 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    6/14

    Logical system names

    - To know the Logical system name of sending system.

    - Goto transaction SALE there click on the Assign Logical system and then display

    the receiving system details.

    - There you will get to know it's Logical system name.

    - Do the same thing in the receiving system to know its logical system name.

    After selecting the Assign Logical system to client

    Page 6 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    7/14

    Display the 100 client system as we are using that system.

    Therefore its Logical system name is EC1CLNT100.

    To create a Distribution Modal.

    - Goto transaction BD64 and then goto change mode->create a distribution modal-> save it-> click on add message type and

    system and also give the message type.

    - After that click on that Modal and goto Environment-> Generate partner profiles -> execute. This will create the partner profil

    - Next goto Edit -> Modal view -> Distribute.

    Page 7 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    8/14

    - If your Distribution modal is distributed then we can send an idoc now.

    Page 8 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    9/14

    - To know whether your partner profile is created, goto transaction WE20 and click on the logical system and check whether

    receiving system.

    Finding a suitable BADI to code.

    - Now we have to find a suitable BADI, a BADI in which the processing is done when we Press SAVE button in transaction I

    - For that while creating notification before pressing save button goto transaction SE24 and open 1. Go to the TCode SE24 a

    Page 9 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through ALE

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    10/14

    - Open In 'Display' mode, go to 'Methods' tab, Double click the method 'Get Instance' to display it source code, Set a breakpo

    cl_exithandler=>get_class_name_by_interface'.

    - Then Press SAVE button.

    - The screen will stop at this method.

    - Check the value of parameter 'EXIT_NAME'. It will show you the BADI's for that particular step.

    - After noting down the BADI's name goto transaction SE19 and implement those BADI's and

    Place a break point in the method of that BADI and again create a notification and check whether the screen stops at this break poi- Check the same for all BADI'S and after you find the appropriate BADI you have to write the code to fill the Idoc type in the

    - For our requirement I have found a BADI NOTIF_EVENT_POST and implemented it into Z NOTIF_EVENT_POST

    TRANSACTION SE19

    CREATE IT.

    Page 10 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through A...

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    11/14

    GOTO INTERFACE and double click on the method.

    Now do the coding between this method and endmethod.

    - Before writing the code to fill the Idoc we need to know which of the Tables has the data which we need to fill in the Idoc.

    - I have found out in debugging mode that the data i.e. the values of QMNUM, QMART, QMTXT are there in IS_NEW_VIQM

    - So I have written the code according.

    - You can refer the CODE below.

    Method IF_EX_NOTIF_EVENT_POST~CHECK_DATA_AT_POST.

    Page 11 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through A...

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    12/14

    Types: idoc_cntrl1 type edidc,

    idoc_edidd1 type edidd.

    Data: idoc_cntrl type idoc_cntrl1,

    wa_idoc_cntrl type idoc_cntrl1,

    master_cntrl_data type standard table of idoc_cntrl1,

    idoc_edidd type standard table of idoc_edidd1,

    wa_idoc_edidd type idoc_edidd1.

    Types: begin of qmel_struc,

    qmnum type qmel-qmnum,

    qmart type qmel-qmart,

    qmtxt type qmel-qmtxt,

    end of qmel_struc.

    DATA: wa_qmel_struc type E1NTHDR.

    clear idoc_cntrl.

    * These values can be derived from EDP13 table.

    idoc_cntrl-rcvpor = 'A000000108'.

    Idoc_cntrl-rcvprt = 'LS'.

    Idoc_cntrl-mestyp = 'INOTIF'.Idoc_cntrl-idoctp = 'INOTIF01'.

    Idoc_cntrl-rcvprn = 'CID'.

    Wa_qmel_struc-qmnum = is_new_viqmel-qmnum.

    Wa_qmel_struc-qmart = is_new_viqmel-qmart.

    Wa_qmel_struc-qmtxt = is_new_viqmel-qmtxt.

    Wa_idoc_edidd-SEGNAM = 'E1NTHDR'.

    Wa_idoc_edidd-sdata = wa_qmel_struc.

    clear wa_qmel_struc.

    Append wa_idoc_edidd to idoc_edidd.

    Clear wa_idoc_edidd.

    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'

    EXPORTING

    MASTER_IDOC_CONTROL = idoc_cntrl

    * OBJ_TYPE = ''

    * CHNUM = ''

    TABLES

    COMMUNICATION_IDOC_CONTROL = master_cntrl_data

    MASTER_IDOC_DATA = idoc_edidd

    * EXCEPTIONS

    * ERROR_IN_IDOC_CONTROL = 1

    * ERROR_WRITING_IDOC_STATUS = 2

    * ERROR_IN_IDOC_DATA = 3

    * SENDING_LOGICAL_SYSTEM_UNKNOWN = 4* OTHERS = 5

    .

    IF SY-SUBRC 0.

    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Endmethod.

    Get IDOC number

    - By executing the above program, you get the Idoc Number for the particular material .

    - You can write the above code anywhere based upon your requirements.

    - You can also Goto Transaction WE02 or WE05 to check the Status of the Idoc and the Data which is sent in the segment.

    - Execute the Transaction (WE02 or WE05) and check whether the data is correctly populated in data records. Also make sur

    - You can also know the status of an Idoc from Transaction WE47.

    Page 12 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through A...

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    13/14

    ************************* *******

    Important Transaction Codes:

    SALE - IMG ALE Configuration root

    WE20 - Manually maintain partner profiles

    BD64 - Maintain customer distribution model

    BD71 - Distribute customer distribution model

    SM59 - Create RFC DestinationsBDM5 - Consistency check (Transaction scenarios)

    BD82 - Generate Partner Profiles

    BD61 - Activate Change Pointers - Globally

    BD50 - Activate Change Pointer for Msg Type

    BD52 - Activate change pointer per change.doc object

    BD59 - Allocation object type -> IDOC type

    BD56 - Maintain IDOC Segment Filters

    BD53 - Reduction of Message Types

    BD21 - Select Change Pointer

    BD87 - Status Monitor for ALE Messages

    BDM5 - Consistency check (Transaction scenarios)

    BD62 - Define rulesBD79 - Maintain rules

    BD55 - Defining settings for IDoc conversion

    WEDI - ALE IDoc Administration

    WE21 - Ports in Idoc processing

    WE60 - IDoc documentation

    SARA - IDoc archiving (Object type IDOC)

    WE47 - IDoc status maintenance

    WE07 - IDoc statistics

    BALE - ALE Distribution Administration

    WE05 - IDoc overview

    BD87 - Inbound IDoc reprocessing

    BD88 - Outbound IDoc reprocessing

    BDM2 - IDoc Trace

    BDM7 - IDoc Audit Analysis

    BD21 - Create IDocs from change pointers

    SM58 - Schedule RFC Failures

    Basic config for Distributed data:

    BD64: Maintain a Distributed Model

    BD82: Generate Partner Profile

    BD64: Distribute the distribution Model

    Programs

    RBDMIDOC - Creating IDoc Type from Change PointersRSEOUT00 - Process all selected IDocs (EDI)

    RBDAPP01 - Inbound Processing of IDocs Ready for Transfer

    RSARFCEX - Execute Calls Not Yet Executed

    RBDMOIND - Status Conversion with Successful tRFC Execution

    RBDMANIN - Start error handling for non-posted IDocs

    RBDSTATE - Send Audit Confirmations

    FOr testing you can use WE19.

    ************************* *******

    This is the complete process of creating an Outbound Idoc through ALE.

    Page 13 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through A...

    4/20/2012http://wiki.sdn.sap.com/wiki/display/ABAP/Outbound+Idoc+Through+ALE

  • 7/31/2019 Outbound Idoc Through ALE

    14/14

    Follow SCN

    Contact Us SAP Help Portal

    Privacy

    Terms of Use

    Legal Disclosure

    Copyright

    Comments (3)

    Page 14 of 14SAP Community Network Wiki - ABAP Development - Outbound Idoc Through A...