ALE/IDOC configurations?

Hi Experts,
Suppose i've two R/3 systems let say R1(Source system) and R2 (Target System). Now i want to send MATMAS05 IDOC from R1 to R2. Can anyone tell wht are ALE configuration's need to b done on both systems......plz give all Tcodes which are required at both systems with descriptions....
Pts will b rewarded to approraite answers
Regards
Faisal

Hi Friend ,
Please the process in steps .
MASTER DATA TRANSFERMATION BETWEEN 2 DIFF CLIENTS
•     For this scenario Client 800 is the Sender and 810 is the receiving system
1. Creating Logical Systems
o     Login using 800 client
o     Go to T. Code SALE
o     Expand Sending and Receiving Systems
o     Expand Logical Systems
o     Click on Define Logical System
o     Click on New Entries
o     Create STUD_S, STUD_R Logical Systems
o     Save and come back
o     Assign the STUD_S Logical System to client 800
o     Assign the STUD_R Logical System to client 810
2. Creating the RFCs
o     Go to T. Code SM59
o     Expand R/3 Connections
o     Enter RFC Name as STUD_S
o     Connection Type as 3
o     Language as EN
o     Client as 800
o     User as  SAPUSER
o     PWD as abap
o     Target host as sap
o     Click on Remote logon button to test the RFC
o     Enter RFC Name as STUD_R
o     Connection Type as 3
o     Language as EN
o     Client as 800
o     User as  SATISH
o     PWD as abap
o     Target host as sap
o     Click on Remote logon button to test the RFC
3. Creating the Message Type
o     Go to T. Code WE81
o     Click on change, continue
o     Click on New Entries button
o     Give message type as ZBAPI_STUD_MAS and description
o     Save and back
4. Creating the Segment
o     Go to T. Code WE31
o     Give segment name as ZBAPI_STUD_SEG
o     Enter Short Text
o     Enter the Field Name and Data Element in the text boxes
o     Save, continue,
o     Click on Edit -> Set Release.
5. Creating the Basic IDOC Object
o     Go to T. code WE30
o     Give obj. name as ZBAPI_STUD_IDOC
o     Click on create
o     Select create new radio button, give description and continue
o     Select the IDOC obj name and click on create button
o     Enter the segment name which is create earlier
o     Select the check box if you want to make the segment mandatory
o     Enter 1 in minimum number 99999 in maximum number, continue
o     Save and back
o     Click on Edit -> Set Release
6. Creating Customer Distribution Model
o     Go to T. Code BD64
o     Click on change and Create model view button
o     Enter the short text and Technical name as ZSTUDENT
o     Select the model and click on Add Message Type Button
o     Give the Sender as STUD_S,
o                    Receiver as STUD_R,
o                    Message Type as ZBAPI_STUD_MAS
o     Select the model view & click on Environment -> Generate Partner Profiles
o     Select Transfer IDOC Immediately and Trigger Immediately radio buttons
o     Click on Execute
o     You should get a list in green color which means it executed successfully.
o     Back to main screen, select the model view
o     Click Edit->Model view->Distribute
o     Click on continue
o     You should get a list saying model view is distributed successfully.
7. Checking the Port
o     Go to T. Code WE21
o     Expand Transactional RFC
o     Find the port from the list which is created using BD64 for STUD_R (Receiving system) RFC Destination.
8. Checking the Partner Profiles.
o     Go to T. Code WE20
o     Expand Partner Type LS
o     Select the Partner profile STUD_R
o     Double click on Message Type ZBAPI_STUD_MAS in Outbound parmtrs.
o     Check Receiver Port is assigned correctly
o     Check the Basic type as your Basic IDOC object.
9. Assigning the Message Type to Basic IDOC Object
o     Go to T. Code WE82
o     Click on Change & continue, New Entries button
o     Give the Message type as ZBAPI_STUD_MAS
o     Give Basic Type as ZBAPI_STUD_IDOC
o     Release as 46C
o     Save and back
10. Creating Inbound Function Module (Posting Program)
o     Go to T. Code SE37
o     Create a function Module IDOC_INPUT_ZBAPI_STUD_MAS
o     Set the Processing type as Remote Enabled Module and mode as start immed, in Attributes Tab.
o     Import Parameters
INPUT_METHOD                 LIKE     BDWFAP_PAR-INPUTMETHD
MASS_PROCESSING     LIKE     BDWFAP_PAR-MASS_PROC
NO_APPLICATION_LOG     LIKE     SY-DATAR
MASSSAVEINFOS                 LIKE     MASSSAVINF
o     Export Parameters
WORKFLOW_RESULT          LIKE     BDWF_PARAM-RESULT
APPLICATION_VARIABLE     LIKE     BDWF_PARAM-APPL_VAR
IN_UPDATE_TASK          LIKE     BDWFAP_PAR-UPDATETASK
CALL_TRANSACTION_DONE  LIKE     BDWFAP_PAR-CALLTRANS
o     Tables
IDOC_CONTRL     LIKE     EDIDC
IDOC_DATA          LIKE     EDIDD
IDOC_STATUS     LIKE     BDIDOCSTAT
RETURN_VARIABLES     LIKE     BDWFRETVAR
SERIALIZATION_INFO     LIKE     BDI_SER
o     Exceptions
WRONG_FUNCTION_CALLED
o     Source Code
DATA: FIRST_TRANC LIKE MARA_UEB-TRANC,
      ZBAPI_STUD_SEG like zbapi_stud.
DATA: ZBAPI_STUD LIKE ZBAPI_STUD.
  DATA: I_ZBAPI_STUD LIKE ZBAPI_STUD.
  DATA: C_TRUE                         VALUE 'X'.
  DATA: C_FALSE                        VALUE ' '.
DATA: BEGIN OF T_IDOC_ROLLNO OCCURS 0,
        DOCNUM LIKE EDIDC-DOCNUM,
        ROLLNO LIKE ZBAPI_STUD-ROLLNO,
      END   OF T_IDOC_ROLLNO.
  DEFINE APPEND_RESFIELDS.
    PERFORM APPEND_RES_FIELDS TABLES T_MFIELDRES
                                     T_RES_FIELDS
                              USING  &1
                                     COUNTER-D_IND.
  END-OF-DEFINITION.
  DATA: I_MARA_UEB LIKE MARA_UEB.
  DATA: I_ZSTUD_UEB LIKE ZBAPI_STUD.
  DATA: I_MAKT_UEB LIKE MAKT_UEB.
  DATA: I_MARC_UEB LIKE MARC_UEB.
  DATA: I_MARD_UEB LIKE MARD_UEB.
  DATA: I_MFHM_UEB LIKE MFHM_UEB.
  DATA: I_MARM_UEB LIKE MARM_UEB.
  DATA: I_MEAN_UEB LIKE MEA1_UEB.
  DATA: I_MBEW_UEB LIKE MBEW_UEB.
  DATA: I_STEU_UEB LIKE STEU_UEB.
  DATA: I_STEUMM_UEB LIKE STEUMM_UEB.
  DATA: I_MLGN_UEB LIKE MLGN_UEB.
  DATA: I_MLGT_UEB LIKE MLGT_UEB.      " //br010797 neu zu 4.0
  DATA: I_MPGD_UEB LIKE MPGD_UEB.
  DATA: I_MPOP_UEB LIKE MPOP_UEB.
  DATA: I_MVEG_UEB LIKE MVEG_UEB.
  DATA: I_MVEU_UEB LIKE MVEU_UEB.
  DATA: I_MVKE_UEB LIKE MVKE_UEB.
  DATA: I_MPRW_UEB LIKE MPRW_UEB.
  DATA: I_LTX1_UEB LIKE LTX1_UEB.
  DATA: HELP_MARC_UEB LIKE MARC_UEB.
  DATA: T_MARA_UEB LIKE MARA_UEB OCCURS 0.
  DATA: T_MAKT_UEB LIKE MAKT_UEB OCCURS 0.
  DATA: T_MARC_UEB LIKE MARC_UEB OCCURS 0.
  DATA: T_MARD_UEB LIKE MARD_UEB OCCURS 0.
  DATA: T_MFHM_UEB LIKE MFHM_UEB OCCURS 0.
  DATA: T_MARM_UEB LIKE MARM_UEB OCCURS 0.
  DATA: T_MEAN_UEB LIKE MEA1_UEB OCCURS 0.
  DATA: T_MBEW_UEB LIKE MBEW_UEB OCCURS 0.
  DATA: T_STEU_UEB LIKE STEU_UEB OCCURS 0.
  DATA: T_STEUMM_UEB LIKE STEUMM_UEB OCCURS 0.
  DATA: T_MLGN_UEB LIKE MLGN_UEB OCCURS 0.
  DATA: T_MLGT_UEB LIKE MLGT_UEB OCCURS 0.    " //br010797 neu zu 4.0
  DATA: T_MPGD_UEB LIKE MPGD_UEB OCCURS 0.
  DATA: T_MPOP_UEB LIKE MPOP_UEB OCCURS 0.
  DATA: T_MVEG_UEB LIKE MVEG_UEB OCCURS 0.
  DATA: T_MVEU_UEB LIKE MVEU_UEB OCCURS 0.
  DATA: T_MVKE_UEB LIKE MVKE_UEB OCCURS 0.
  DATA: T_MPRW_UEB LIKE MPRW_UEB OCCURS 0.
  DATA: T_LTX1_UEB LIKE LTX1_UEB OCCURS 0.
Internal fields/ tables
DATA: FLAG_ERROR_HAPPENED.
DATA: flag_material_exists. "//br210397 zu 4.0 keine Verwendung mehr
  DATA: FLAG_EXIT_TO_BE_DONE.
  DATA: HELP_TABIX LIKE SY-TABIX.
  DATA: HELP_TRANC LIKE MARA_UEB-TRANC.
  DATA: HELP_ALAND LIKE STEU_UEB-ALAND.
  DATA: HELP_VKORG LIKE MVKE-VKORG.
  DATA: HELP_WERKS LIKE T001W-WERKS.
  DATA: HELP_LFDNR LIKE STEU_UEB-LFDNR.
  DATA: LAST_MARC_TRANC LIKE MARA_UEB-TRANC.
  DATA: LAST_MLGN_TRANC LIKE MARA_UEB-TRANC.    " //br010797 neu zu 4.0
  DATA: LAST_TEXT_TRANC LIKE MARA_UEB-TRANC.
  DATA: CURRENT_TABIX LIKE SY-TABIX.
  DATA: GENERAL_SUBRC LIKE SY-SUBRC.
  DATA: HELP_FACTOR TYPE P DECIMALS 3.
  DATA: USER_SEGMENTS LIKE EDIDD OCCURS 0 WITH HEADER LINE.  " insert
  DATA: CUST_SEGMENT LIKE EDIDD.
  DATA: I_MFIELDRES LIKE MFIELDRES.
DATA: I_MERRDAT LIKE MERRDAT.
  DATA: I_EDIDD LIKE EDIDD.
                                       " //br neu zu 3.1g
  DATA: T_RES_FIELDS LIKE DELFIELDS OCCURS 0 WITH HEADER LINE.
  DATA: T_MFIELDRES LIKE MFIELDRES OCCURS 0.
  DATA: T_MERRDAT LIKE MERRDAT OCCURS 0.
  DATA: T_EDIDD LIKE EDIDD OCCURS 0.
DATA: BEGIN OF t_matnr OCCURS 0, "//br210397 zu 4.0
        matnr LIKE mara-matnr,   " wird nicht mehr verwendet
      END OF t_matnr.            "
  DATA: BEGIN OF COUNTER,
          TRANC LIKE MARA_UEB-TRANC,
          D_IND LIKE MARA_UEB-D_IND,
        END OF COUNTER.
DATA: BEGIN OF t_idoc_tranc OCCURS 0,                          " 4.0
        docnum LIKE edidc-docnum,                              "
        tranc  LIKE mara_ueb-tranc,                            "
      END OF t_idoc_tranc.                                     "
  DATA T_IDOC_TRANC LIKE MATIDOCTRANC OCCURS 0 WITH HEADER LINE."
  DATA: FLAG_FITS.
  DATA: APPLICATION_SUBRC LIKE SY-SUBRC.
  DATA FLAG_MUSS_PRUEFEN LIKE SY-DATAR.
  DATA MAX_ERRORS LIKE T130S-ANZUM.    " 4.0
note 419281
  DATA : FLG_MASS.
  CLEAR : FLG_MASS.
  FIELD-SYMBOLS: .            " 4.0
ALE-distribution unity : IDOC status set by locking      "note0361838
  data:                                                     "note0361838
    it_dsp_idocstat like bdidocstat                         "note0361838
      occurs 0 with header line.                            "note0361838
Initialize data - general
  REFRESH T_MFIELDRES.
  REFRESH T_IDOC_TRANC.
  REFRESH T_IDOC_TRANC.                "JH/02.02.98/4.0C  KPr100004993
REFRESH t_idoc_tranc_segment.   " //br 40 : unnötig
REFRESH matnr_tranc.            "    -"-
REFRESH t_matnr.
  COUNTER-TRANC = 1.
  COUNTER-D_IND = 1.
  REFRESH T_MARA_UEB.
  REFRESH T_MAKT_UEB.
  REFRESH T_MARC_UEB.
  REFRESH T_MARD_UEB.
  REFRESH T_MFHM_UEB.
  REFRESH T_MARM_UEB.
  REFRESH T_MEAN_UEB.
  REFRESH T_MBEW_UEB.
  REFRESH T_STEU_UEB.
  REFRESH T_STEUMM_UEB.
  REFRESH T_MLGN_UEB.
  REFRESH T_MLGT_UEB.                  " //br010797 neu zu 4.0
  REFRESH T_MPGD_UEB.
  REFRESH T_MPOP_UEB.
  REFRESH T_MVEG_UEB.
  REFRESH T_MVEU_UEB.
  REFRESH T_MVKE_UEB.
  REFRESH T_MPRW_UEB.
REFRESH VKORG_ALAND.
REFRESH WERKS_ALAND.
  CLEAR APPLICATION_SUBRC.
  REFRESH T_MERRDAT.
Check if right function is called
  READ TABLE IDOC_CONTRL INDEX 1.
  IF SY-SUBRC <> 0.
    EXIT.
  ELSE.
    IF  IDOC_CONTRL-IDOCTP <> 'ZBAPI_STUD_IDOC'.
      RAISE WRONG_FUNCTION_CALLED.
    ENDIF.
  ENDIF.
  LOOP AT IDOC_CONTRL.
  Initialize data - per IDOC
  t_idoc_tranc-docnum = counter-tranc.
    T_IDOC_TRANC-DOCNUM = IDOC_CONTRL-DOCNUM.
    T_IDOC_TRANC-FIRST_TRANC_IDOC = COUNTER-TRANC + 2.
    APPEND T_IDOC_TRANC.
  Select segments which belong to IDOC
    REFRESH T_EDIDD.
    LOOP AT IDOC_DATA WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
      APPEND IDOC_DATA TO T_EDIDD.
    ENDLOOP.
   BUSINESS TRANSACTION EVENT (header / data)         "note0388000
     call function 'OPEN_FI_PERFORM_MGV00200_E'         "note0388000
          exporting                                     "note0388000
              idoc_header       = idoc_contrl           "note0388000
              FLG_APPEND_STATUS = 'X'                   "note0388000
          tables                                        "note0388000
(DEL)       idoc_data         = idoc_data "note0388000 note0418561
              idoc_data         = t_edidd               "note0418561
              idoc_status       = idoc_status           "note0388000
          exceptions                                    "note0388000
              others       = 1.                         "note0388000
     if sy-subrc = 1.                                   "note0388000
        continue.                                       "note0388000
     endif.                                             "note0388000
  Within one IDOC: loop through data segments:
  Prepare internal tables for the current material
    LOOP AT T_EDIDD INTO IDOC_DATA.
    Transform from CoreData to Normal Data if necesary
      CASE IDOC_DATA-SEGNAM.
       WHEN 'E1MARAC'.
*--COMMENTED BY SATISH
         PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.
       WHEN 'E1MAKTC'.
         PERFORM MOVE_E1MAKTC_TO_E1MAKTM USING IDOC_DATA.
*--COMMENTES ENDED BY SATISH
         WHEN 'ZBAPI_STUD_SEG'.
          PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.
            CLEAR I_ZBAPI_STUD.
Second: Move E1MARAC into E1MARAM
            I_ZBAPI_STUD = IDOC_DATA-SDATA.
Third: Move E1MARAM back into IDOC-line
            IDOC_DATA-SDATA =  I_ZBAPI_STUD.
            IDOC_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.
      ENDCASE.
      CURRENT_TABIX = SY-TABIX.
      COUNTER-D_IND = COUNTER-D_IND + 1.
      COUNTER-TRANC = COUNTER-TRANC + 2.
      CASE IDOC_DATA-SEGNAM.
         WHEN 'ZBAPI_STUD_SEG'.
        Initialize data - per material
          COUNTER-D_IND = 1.
          FIRST_TRANC = COUNTER-TRANC.
        interpret segment
          ZBAPI_STUD_SEG = IDOC_DATA-SDATA.
          MOVE-CORRESPONDING ZBAPI_STUD TO I_ZSTUD_UEB.
          T_IDOC_ROLLNO-DOCNUM  = IDOC_CONTRL-DOCNUM.
          T_IDOC_ROLLNO-ROLLNO  = I_ZSTUD_UEB-ROLLNO.
          APPEND T_IDOC_ROLLNO.
       ENDCASE.
            if not ZBAPI_STUD_SEG is initial.
             ZBAPI_STUD-MANDT  = ZBAPI_STUD_SEG-MANDT.
             ZBAPI_STUD-ROLLNO = ZBAPI_STUD_SEG-ROLLNO.
             ZBAPI_STUD-FNAME  = ZBAPI_STUD_SEG-FNAME.
             ZBAPI_STUD-LNAME  = ZBAPI_STUD_SEG-LNAME.
              INSERT ZBAPI_STUD FROM ZBAPI_STUD_SEG.
              COMMIT WORK.
            ENDIF.
*-- ALE ditribution unity : update IDOC status                "note03618
      LOOP AT it_dsp_idocstat.                                  "note036
         LOOP AT IDOC_STATUS WHERE DOCNUM = it_dsp_idocstat.    "note036
            DELETE idoc_status INDEX sy-tabix.                  "note036
         ENDLOOP.                                               "note036
         APPEND it_dsp_idocstat TO idoc_status.                 "note036
      ENDLOOP.                                                  "note036
*--GENERATING THE IDOC STATUS
  PERFORM HANDLE_ERROR_EXT             " //br40
              TABLES                                        "
                 IDOC_CONTRL                                "
                 IDOC_STATUS                                "
                 RETURN_VARIABLES                           "
                 T_MERRDAT                                  "
                 T_IDOC_TRANC                               "
                 T_IDOC_ROLLNO          "JH/4.0C/KPr100004993
              USING                                         "
                 GENERAL_SUBRC                              "
                 NO_APPLICATION_LOG                         "
                 MASSSAVEINFOS         "wk/40c
              CHANGING                                      "
                 WORKFLOW_RESULT.                           "
              PERFORM HANDLE_ERROR
                          TABLES
                             IDOC_CONTRL
                             IDOC_STATUS
                             RETURN_VARIABLES
                             T_MERRDAT
                             T_IDOC_ROLLNO     "JH/4.0C/KPr100004993
                          USING
                             APPLICATION_SUBRC
                          CHANGING
                             WORKFLOW_RESULT.
  SORT T_IDOC_ROLLNO BY ROLLNO. "note 315124
React on general error
  DATA: I_MERRDAT LIKE MERRDAT.
  IF GENERAL_SUBRC <> 0.
    I_MERRDAT-MSGTY = 'E'.
    I_MERRDAT-MSGID = SY-MSGID.
    I_MERRDAT-MSGNO = SY-MSGNO.
    I_MERRDAT-MSGV1 = SY-MSGV1.
    I_MERRDAT-MSGV2 = SY-MSGV2.
    I_MERRDAT-MSGV3 = SY-MSGV3.
    I_MERRDAT-MSGV4 = SY-MSGV4.
    APPEND I_MERRDAT TO T_MERRDAT.
  ENDIF.
  LOOP AT T_MERRDAT INTO  I_MERRDAT
                    WHERE MSGTY = 'S'  "success
                    OR    MSGTY = 'D'  "dummy
                    OR    MSGTY = 'I'  "Information " //br011097 zu 3.1I
                    OR    MSGTY = 'H'  "dummy       " 4.0
                    OR    MSGTY = 'W'. "warning
    DELETE T_MERRDAT.
  ENDLOOP.
    ENDLOOP.
  ENDLOOP.
ENDFUNCTION.
*&      Form  handle_error_ext
FORM HANDLE_ERROR_EXT
        TABLES
           IDOC_CONTRL                   STRUCTURE EDIDC
           IDOC_STATUS                   STRUCTURE BDIDOCSTAT
           RETURN_VARIABLES              STRUCTURE BDWFRETVAR
           T_MERRDAT                     STRUCTURE MERRDAT
           IDOC_TRANC                    STRUCTURE MATIDOCTRANC
JH/02.02.98/4.0C  KPr100004993 (Anfang)
           T_IDOC_ROLLNO                 STRUCTURE T_IDOC_ROLLNO
JH/02.02.98/4.0C  KPr100004993 (Ende)
        USING
           GENERAL_SUBRC                 LIKE SY-SUBRC
           NO_APPLICATION_LOG            LIKE SY-DATAR
           MASSSAVEINFOS                 LIKE MASSSAVINF
        CHANGING
           WORKFLOW_RESULT               LIKE BDWF_PARAM-RESULT.
  DATA FLAG_ERROR_HAPPENED.
  DATA I_MERRDAT LIKE MERRDAT.
  DATA IDOC_INDEX_2_SUBRC LIKE SY-SUBRC.
  DATA AL_HANDLES TYPE BAL_T_LOGH. "//br99
  SORT T_IDOC_ROLLNO BY ROLLNO.                        "note 315124
React on general error
  IF GENERAL_SUBRC <> 0.
    REFRESH T_MERRDAT.
  i_merrdat-tranc = 0.                              " //br261197
    READ TABLE IDOC_TRANC INDEX 1.     " zu 40b
    I_MERRDAT-TRANC = IDOC_TRANC-FIRST_TRANC_IDOC.          "
    I_MERRDAT-MSGTY = 'E'.
    I_MERRDAT-MSGID = SY-MSGID.
    I_MERRDAT-MSGNO = SY-MSGNO.
    I_MERRDAT-MSGV1 = SY-MSGV1. I_MERRDAT-MSGV2 = SY-MSGV2.
    I_MERRDAT-MSGV3 = SY-MSGV3. I_MERRDAT-MSGV4 = SY-MSGV4.
    APPEND I_MERRDAT TO T_MERRDAT.
  ENDIF.
DATA: C_TRUE,
      C_FALSE VALUE 'X'.
If error happened ==> Rollback whole work....
  LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY NA 'SDHWI'.
    EXIT.
  ENDLOOP.
  IF SY-SUBRC = 0.
    FLAG_ERROR_HAPPENED = C_TRUE.
    ROLLBACK WORK.
  ELSE.
    FLAG_ERROR_HAPPENED = C_FALSE.
  ENDIF.
Set IDOC status
two cases:
single IDOC-processing: ==> error can be written in IDOC status
package processing ==> anononymous "package error" for all IDOCs
  READ TABLE IDOC_CONTRL INDEX 2.
  IDOC_INDEX_2_SUBRC = SY-SUBRC.
  IF SY-SUBRC = 0.
    IF 1 = 2.                          "//br40
      MESSAGE E051(B1).                                     "
    ENDIF.                                                  "
    CLEAR I_MERRDAT.
    I_MERRDAT-MSGID = 'B1'.
    I_MERRDAT-MSGTY = 'E'.
    I_MERRDAT-MSGNO = '051'.
  ENDIF.
  IF IDOC_INDEX_2_SUBRC NE 0 OR FLAG_ERROR_HAPPENED = C_FALSE.
  Nur in diesen Fällen wird Application Log geschrieben
  Delete all Successes and Dummy records from t_merrdat
  DELETE t_merrdat WHERE msgty = 'S'  "success         " testweise
                   OR    msgty = 'D'. "dummy           "
    LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY = 'D'.     "
      I_MERRDAT-MSGTY = 'S'.                                "
      MODIFY T_MERRDAT FROM I_MERRDAT.                      "
    ENDLOOP.                                                "
  ENDIF.
  WORKFLOW_RESULT = 0.
  LOOP AT IDOC_CONTRL.
  Set IDOC status
    CLEAR IDOC_STATUS.
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IF FLAG_ERROR_HAPPENED = C_FALSE.
Application log
      PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC
                                    T_MERRDAT
                                    IDOC_STATUS
                             USING  IDOC_CONTRL
                                    FLAG_ERROR_HAPPENED
                                    NO_APPLICATION_LOG
                                    MASSSAVEINFOS
                                    AL_HANDLES.
    idoc_status-status = '53'.       "OK!
    APPEND idoc_status.
JH/02.02.98/4.0C  KPr100004993 (Anfang)
    Fill Return variables
      CLEAR RETURN_VARIABLES.
      RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
      RETURN_VARIABLES-WF_PARAM = 'Processed_IDOCs'.
      APPEND RETURN_VARIABLES.
    Verknüpfungseintrag anlegen
      READ TABLE T_IDOC_ROLLNO WITH KEY ROLLNO = IDOC_CONTRL-DOCNUM
                              BINARY SEARCH.
      IF SY-SUBRC = 0.
        RETURN_VARIABLES-DOC_NUMBER = T_IDOC_ROLLNO-ROLLNO.
        RETURN_VARIABLES-WF_PARAM = 'Appl_Objects'.
        APPEND RETURN_VARIABLES.
      ENDIF.
JH/02.02.98/4.0C  KPr100004993 (Ende)
    ELSE.
      IF IDOC_INDEX_2_SUBRC NE 0.
Application Log
        PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC
                                      T_MERRDAT
                                      IDOC_STATUS
                               USING  IDOC_CONTRL
                                      FLAG_ERROR_HAPPENED
                                      NO_APPLICATION_LOG
                                      MASSSAVEINFOS
                                      AL_HANDLES.
      ELSE.
        IDOC_STATUS-MSGID = I_MERRDAT-MSGID.
        IDOC_STATUS-MSGTY = I_MERRDAT-MSGTY.
        IDOC_STATUS-MSGNO = I_MERRDAT-MSGNO.
        IDOC_STATUS-MSGV1 = I_MERRDAT-MSGV1.
        IDOC_STATUS-MSGV2 = I_MERRDAT-MSGV2.
        IDOC_STATUS-MSGV3 = I_MERRDAT-MSGV3.
        IDOC_STATUS-MSGV4 = I_MERRDAT-MSGV4.
        IDOC_STATUS-STATUS = '51'.     "ERROR!
        APPEND IDOC_STATUS.
      ENDIF.
    Fill Return variables
      CLEAR RETURN_VARIABLES.
      RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    return_variables-wf_param = c_wf_par_processed_idocs.
      RETURN_VARIABLES-WF_PARAM = 'Error_IDOCs'.
      APPEND RETURN_VARIABLES.
      WORKFLOW_RESULT = 99999.
    ENDIF.
  APPEND idoc_status.
  ENDLOOP.
  IF NO_APPLICATION_LOG IS INITIAL.
    CALL FUNCTION 'BAL_DB_SAVE'                           "//br99
         EXPORTING
              I_IN_UPDATE_TASK = ' '
              I_SAVE_ALL       = ' '
              I_T_LOG_HANDLE   = AL_HANDLES.
       EXCEPTIONS
            LOG_NOT_FOUND    = 1
            SAVE_NOT_ALLOWED = 2
            NUMBERING_ERROR  = 3
            OTHERS           = 4.
    CALL FUNCTION 'BAL_GLB_MEMORY_REFRESH'                "//br99
         EXPORTING
            I_AUTHORIZATION          =
              I_REFRESH_ALL            = ' '
              I_T_LOGS_TO_BE_REFRESHED = AL_HANDLES.
       EXCEPTIONS
            NOT_AUTHORIZED           = 1
            OTHERS                   = 2
  ENDIF.
ENDFORM.                               " handle_error
Save, check and activate
11. Assigning the Inbound Function Module to Basic Type & Message Type
o     Go to T. Code WE57
o     Click on change, continue, continue and New Entries Button
o     Enter the Module as IDOC_INPUT_ZBAPI_STUD_MAS
o     Type as “F”
o     Basic Type as ZBAPI_STUD_IDOC
o     Message Type as ZBAPI_STUD_MAS.
o     Direction as 2
o     Save and back
Now Login in 810 client
12. Assigning the Inbound Function Module in ALE Table
o     Go to T. Code BD51
o     Click on continue, New Entries button
o     Give the Inbound Function Module IDOC_INPUT_ZBAPI_STUD_MAS
o     Give Input t. as 0 (zero)
o     Save and back
13. Creating Process Code
o     Go to T. Code WE42
o     Click on Change, New Entries Button
o     Give Process Code name as ZSTUD, give Description & Save
o     Select Processing with ALE Services Radio button
o     Select Processing by Function Module Radio button
o     Click the ALE Table (arrow Icon) in Identification
o     Give the Function Module Name ZIDOC_INPUT_ZBAPI_STUD_MAS
o     Give maximum number of repeats 0
o     Save and back, back
o     Select the process code from the list & click on Logical Messages Icon
o     Give the Message Type as ZBAPI_STUD_MAS
o     Save & Back, Save & Back, Save & Back
14. Changing the Customer Distribution model in Receiving system
o     Go to T. Code BD64
o     Click on change and Create model view button
o     Select the model view & click on Environment -> Generate Partner Profiles
o     Select Transfer IDOC Immediately and Trigger Immediately radio buttons
o     Click on Execute
o     You should get a list in green color which means it executed successfully.
15. Assigning the Process Code to Message Type in Receiving System
o     Go to T. Code WE20
o     Expand Partner Type LS
o     Select the Partner Profile STUD_S
o     Double click on Message Type ZBAPI_STUD_MAS in Inbound parmtrs.
o     Give the Process Code as ZSTUD
o     Click on Trigger Immediately Radio button
o     Save & Back
o     Save & Back
16. Creating the Selection Program (Outbound Program)
•     Login in client 800.
•     Go to T. Code SE38
•     Create a Report Program as   ZSTUD_SEND with the following code
REPORT ZSTUD_SEND
       NO STANDARD PAGE HEADING.
TABLES: ZBAPI_STUD.
DATA: IT_STUD LIKE ZBAPI_STUD OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
SELECT-OPTIONS: S_ROLLNO FOR ZBAPI_STUD-ROLLNO.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN:BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-H02.
PARAMETERS:  P_MESTYP LIKE EDIDC-MESTYP,
             P_RCVPRN LIKE TBDLST-LOGSYS.
SELECTION-SCREEN:END OF BLOCK B2.
SELECTION-SCREEN:END OF BLOCK B1.
START-OF-SELECTION.
  PERFORM CREATE_STUDENT.
  PERFORM CREATE_IDOC.
*&      Form  CREATE_STUDENT
      sending student
FORM CREATE_STUDENT.
SELECT * FROM ZBAPI_STUD
   INTO TABLE IT_STUD
   WHERE ROLLNO IN S_ROLLNO.
ENDFORM.                    " CREATE_STUDENT
*&      Form  CREATE_IDOC
      IDOC Creation
FORM CREATE_IDOC.
DATA : IMAS_DATA LIKE EDIDD OCCURS 10 WITH HEADER LINE,
       IMAS_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE,
       ICOM_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE.
IMAS_CON-RCVPRT = 'LS'.
IMAS_CON-RCVPRN = P_RCVPRN.
IMAS_CON-IDOCTP = 'ZBAPI_STUD_IDOC'.
IMAS_CON-MESTYP = P_MESTYP.
IMAS_CON-DIRECT = 1.
APPEND IMAS_CON.
LOOP AT IT_STUD.
  IMAS_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.
  IMAS_DATA-SDATA = IT_STUD.
  APPEND IMAS_DATA.
ENDLOOP.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
     EXPORTING
          MASTER_IDOC_CONTROL            = IMAS_CON
        OBJ_TYPE                       = ''
        CHNUM                          = ''
     TABLES
          COMMUNICATION_IDOC_CONTROL     = ICOM_CON
          MASTER_IDOC_DATA               = IMAS_DATA
   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.
COMMIT WORK.
LOOP AT  ICOM_CON.
  WRITE :/ 'IDOC: ', ICOM_CON-DOCNUM, 'CREATED SUCCESSFULLY'.
ENDLOOP.
ENDFORM.                    " CREATE_IDOC
17. Transferring the student records from 800 to 810 client
•     Execute Report Program   ZSTUD_SEND
•     Give the Range of Roll Nos to Transfer
•     Give Message Type as    ZBAPI_STUD_MAS
•     Give Receiver Logical system as   STUD_R
•     Execute
•     You should get the IDOC Number
•     Take the IDOC Number and go to T. Code WE05 & Execute
•     In Outbox you can see the IDOC Status
•     Select the status record in left side window
•     Double click on the Status record in right side window
•     You can see the Control Record, Data Record and Status Records for that IDOC
•     If the ICON is green and the status code is 3, it means the IDOC is passed to PORT Successfully.
Now Login in 810 client
•     Go to T. Code WE05 & Execute
•     You can see the status record in left side window
•     If the status no is 53 and color is green, it means the IDOC is Posted to Application successfully.
•     You can see the Log Information by double clicking on the status record in right side window.
•     Now in left side window, you can see the Control Record, Data Record & Status Record of the IDOC
•     Now go to T. Code SE16
•     Give the table name ZBAPI_STUD & press F7
•     See the contents of the table
•     The table is updated with the students records transferred from 800 client with our selection program.
Reward if useful
Regrds
Jagadeesh.G

Similar Messages

  • ALE/ IDOC CONFIGURATION OBJECT

    IT'S URGENT
      I NEED AN OBJECT IN ALE/IDOC CONFIGURATION SETTINGS

    Hi Viji.
    I can provide you a link which deals with precise material for ALE/IDOC configuration.
    This link has just 1 page, but very good configurations.
    http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.wsadapters.jca_sap.doc/doc/csap_depl_config_serv.html
    Inside if you want Outbound or Inbound settings, choice is to be made.
    <removed by moderator>
    Regards
    Harsh
    Edited by: Mike Pokraka on Aug 6, 2008 10:56 AM

  • ALE/IDOC configuration study Material

    Hi All,
    Anyone come across ALE/IDOC configuration study Material which consists of
    ONLY ONE PAGE. If YES, Please pass it on.
    Points Assured \[but not given. Dont write such statements here anyway!\]
    Regards,
    Viji.
    Edited by: Jan Stallkamp on Aug 6, 2008 2:26 PM

    Hi Viji.
    I can provide you a link which deals with precise material for ALE/IDOC configuration.
    This link has just 1 page, but very good configurations.
    http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.wsadapters.jca_sap.doc/doc/csap_depl_config_serv.html
    Inside if you want Outbound or Inbound settings, choice is to be made.
    <removed by moderator>
    Regards
    Harsh
    Edited by: Mike Pokraka on Aug 6, 2008 10:56 AM

  • ALE/Idoc configuration - (R3--XI--File)

    Iam XI developer and know basic ABAP. Client is NOT  using any Idocs right now. I have to develop a scenarios ( including ALE/Idoc Configuration on R3 for standard Idocs like MATMAS, DEBMAS, CREMAS etc ) both Master data and change pointer to XI and then to File.
    Would some one show me step by step procedures for ALE/Idoc configuration on R3 and XI.I need to send both Master data and incremental data to XI possibly by bundling Idocs to XI.

    Hi Ram...
    Once the mapping is done then re-check the ALE settings.
    <b>SAP XI</b>
    1) <b>RFC Destination (SM59)</b>   
            a) Choose create.
                b) Specify the name of the RFC destination
                c) Select connection type as 3 and save
                d) In the technical settings tab enter the details SAP SID/URL and system number#.
                e) Enter the Gateway host as same details above SID/URL.
                f) Gateway service is 3300+system number#.
                g) In the Logon /Security tab, enter the client user & Password details of                                   Destination system.
                h) Test the connection and remote logon.
    <b>2)         Create Port (IDX1)</b>  
             a) Select create new button
                b) Enter the port name as SAP+SID (The starting char should be SAP)
                c) Enter the destination client.
                d) Enter the RFC Destination created in SAP R/3 towards other system.
                e) Save
    <b>3)         Load Meta Data for IDOC (IDX2)</b>            a) Create new
                b) IDOC Message Type
                c) Enter port created in IDX1.
    <b>SAP R/3
    1) RFC Destination (SM59)</b>       
        a) Choose create.
                b) Specify the name of the RFC destination
                c) Select connection type as 3 and save
                d) In the technical settings tab enter the details SAP SID/URL and system number#.
                e) Enter the Gateway host as same details above SID/URL.
                f) Gateway service is 3300+system number#.
                g) In the Logon /Security tab, enter the client user & Password details of                                   Destination system.
                h) Test the connection and remote logon.
    <b>2)         Create Port (We21)</b>
                a) First Select Transactional RFC and then click create button
                b) Enter the destination port name as SAP+SID (The starting char should be SAP)
                c) Enter the destination client.
                d) Enter the RFC Destination created in SAP R/3 towards other system.
                e) Save
    <b>3)         Create Partner Profile (WE20)</b>
                a) Create New
                b) Create the Partner no. name as same the logical system name of the destination                      system.
                c) Select Partner type LS         
                d) Enter details for Type: US/USER, Agent, and Lang.
                e) Click on the + button to select the message type.
                f) Select Partner no. and LS which ever create above.
                g) Select Message type
                h) Select Process code related to the Message type.
                I) save.
    <b>In SLD – System Landscape Directory</b>
    TS for R/3 (Logical system):-Assign the client name created in R/3 as Logical system Name.
    Ts for Third Party (Logical system):-
    BS for SAP R/3 (Logical system):- Assign the client name created in R/3 as Logical system Name.
    BS for Third Party (Logical system):-Enter the XI logical system name.
    <b>In Transaction SALE</b>
    Define and Assign the logical system name.
    Cheers,
    raghavesh

  • ALE/IDOC CONFIGuRING

    Hi ,
    can any one send me step by step ALE/IDOC Configuring please it is very important for me..
    Thank's in advance..

    hi,
    check all the below links.......
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    For ALE -- IDoc's
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
    ALE/ IDOC/EDI
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    for MM
    http://help.sap.com/saphelp_nw04/helpdata/en/78/217da751ce11d189570000e829fbbd/content.htm
    one more good link
    /people/kevin.wilson2/blog/2006/11/13/ale-scenario-development-guide
    ~~Guduri

  • Ale/idoc configuration Guide

    Hi,
    Hi i am trying to create ale/idoc scenario between my two clients. Can any one tell me steps by steps configuration of that.
    Regards,
    Gurprit Bhatia

    Hi,
    ALE IDOC
    Sending System(Outbound ALE Process)
    Tcode SALE - for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 - Create Model View
    Tcode BD82 - Generate partner Profiles & Create Ports
    Tcode BD64 - Distribute the Model view
    Message Type MATMAS
    Tcode BD10 - Send Material Data
    Tcode WE05 - Idoc List for watching any Errors
    Receiving System(Inbound ALE )
    Tcode SALE - for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 - Check for Model view whether it has distributed or not
    Tcode BD82 -- Generate partner Profiles & Create Ports
    Tcode BD11 Getting Material Data
    Tcode WE05 - Idoc List for inbound status codes
    ALE IDOC Steps
    Sending System(Outbound ALE Process)
    Tcode SALE ?3 for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 - Create Model View
    Tcode BD82 - Generate partner Profiles & Create Ports
    Tcode BD64 - Distribute the Model view
    This is Receiving system Settings
    Receiving System(Inbound ALE )
    Tcode SALE - for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 - Check for Model view whether it has distributed or not
    Tcode BD82 -- Generate partner Profiles & Create Ports
    Tcode BD11 Getting Material Data
    Tcode WE05 - Idoc List for inbound status codes
    Message Type MATMAS
    Tcode BD10 - Send Material Data
    Tcode WE05 - Idoc List for watching any Errors
    1)a Goto Tcode SALE
    Click on Sending & Receiving Systems-->Select Logical Systems
    Here Define Logical Systems---> Click on Execute Button
    go for new entries
    1) System Name : ERP000
    Description : Sending System
    2) System Name : ERP800
    Description : Receiving System
    press Enter & Save
    it will ask Request
    if you want new request create new Request orpress continue for transfering the objects
    B) goto Tcode SALE
    Select Assign Client to Logical Systems-->Execute
    000--> Double click on this
    Give the following Information
    Client : ERP 000
    City :
    Logical System
    Currency
    Client role
    Save this Data
    Step 2) For RFC Creation
    Goto Tcode SM59-->Select R/3 Connects
    Click on Create Button
    RFC Destination Name should be same as partner's logical system name and case sensitive to create the ports automatically while generating the partner profiles
    give the information for required fields
    RFC Destination : ERP800
    Connection type: 3
    Description
    Target Host : ERP000
    System No:000
    lan : EN
    Client : 800
    User : Login User Name
    Password:
    save this & Test it & RemortLogin
    3)
    Goto Tcode BD64 -- click on Change mode button
    click on create moduleview
    short text : xxxxxxxxxxxxxx
    Technical Neme : MODEL_ALV
    save this & Press ok
    select your just created modelview Name :'MODEL_ALV'.
    goto add message type
    Model Name : MODEL_ALV
    sender : ERP000
    Receiver : ERP800
    Message type :MATMAS
    save & Press Enter
    4) Goto Tcode BD82
    Give Model View : MODEL_ALV
    Partner system : ERP800
    execute this by press F8 Button
    it will gives you sending system port No :A000000015(Like)
    5) Goto Tcode BD64
    seelct the modelview
    goto >edit>modelview-->distribute
    press ok & Press enter
    6)goto Tcode : BD10 for Material sending
    Material : mat_001
    Message Type : MATMAS
    Logical System : ERP800
    and Execute
    7)goto Tcode : BD11 for Material Receiving
    Material : mat_001
    Message Type : MATMAS
    and Execute --> 1 request idoc created for message type Matmas
    press enter
    Here Master Idoc set for Messge type MATMAS-->press Enter
    1 Communication Idoc generated for Message Type
    this is your IDOC
    Change Pointers
    I know how to change the description of a material using ALE Change Pointers.
    I will give the following few steps
    1) Tcode BD61---> check the change pointers activated check box
    save and goback.
    2) Tcode BD50---> check the MATMAS check box save and comeback.
    3) Tcode BD51---> goto IDOC_INPUT_MATMAS01 select the checkbox save and comeback.
    4) Tcode BD52---> give message type : matmas press ok button.
    select all what ever you want and delete remaining fields.
    save & come back.
    5) 5) go to Tcode MM02 select one material and try to change the description and save it
    it will effects the target systems material desciption will also changes
    6) goto Tcode SE38 give program Name is : RBDMIDOC and Execute
    give Message type : MATMAS and Executte
    ALE/IDOC Status Codes/Messages
    01 Error --> Idoc Added
    30 Error --> Idoc ready for dispatch(ALE Service)
    then goto SE38 --> Execute the Program RBDMIDOC
    29 Error --> ALE Service Layer
    then goto SE38 --> Execute the Program RSEOUT00
    03 Error --> Data Passed to Port ok
    then goto SE38 --> Execute the Program RBDMOIND
    12 Error --> Dispatch ok
    Inbound Status Codes
    50 Error --> It will go for ALE Service Layer
    56 Error --> Idoc with Errors added
    51 Error --> Application Document not posted
    65 Error --> Error in ALE Service Layer
    for 51 or 56 Errors do the following steps
    goto WE19 > give the IDOC Number and Execute>
    Press on Inbound function Module
    for 65 Error --> goto SE38 --> Execute the Program RBDAPP01 then your getting 51 Error
    with regards,
    sowjanya.gosala.

  • ALE/IDOC configuration problem

    Hi Gurus,
    It will be nice if you please help me finding the flaws in my configuration that is not allowing me to get a desired output.
    Let me make it step by step:-
    1. My desired output:- To see destination partner type as "LI/LF/ vendor name" for the Inbound IDOCs when an IDOC is starts it journey from "KU/WE/customer name" or vice versa
    2. Present output:- Inbound IDOC always comes to "LS/ /TS90CLNT800". It means in my case inbound IDOC always comes to Logical System LS instead of LI or KU
    How to configure it properly so that I can pass the Inbound IDOCS to other partner type except LS.
    Please help.
    Here what I have done so far as setting:-
    1. Created a Logical System TS90CLNT800 using transaction SALE
    2. Assigned it with client 8003. Created one RFC named tZRFC with connection Type "3"
    (R/3 connection) using trxn SM59
    4. Created a port ZEDI and assiged tZRFC using trxn WE21
    5. Created partner profile for Vendors in partner type LI and for Customer in partner type KU
    6. Because of getting error " no partner profile for ZEDI LS found" therefore created inbound parameters in parter profile LS for each Message Type.
    I am processing IDOC within same client 800 ( both inbound and Outbound)
    But I want the Inbound Idocs should come into partner type LI if the the Outbound IDOC is sent from KU and vice versa.
    Please help me what config I need to do.
    Amit

    Hi Sruthi,
    Thank you very much for your time that you have spent for my problem.
    So far I created these type of partner profiles and they were working in the following fashion.
    Partner Profile created in WE20:
    Partner Type = LI, Partner Number V001 ( Vendor Number)
    Partner Type = KU, Partner Number K001( Customer Number)
    Partner Type = LS, Partner Number ZEDI ( Logical System)
    I created one Logical System ZEDI and assigned it to Client
    tRFC created in SM59:-
    Connection Type = R/3 Connection, Name tZRFC
    Port created in WE21:-
    Port Name ZEDI (again) and assigned with tZRFC.
    BD64 not used so far
    Now If I add Message type ORDERS in Inbound Parameters of Partner Type KU and Outbound Parameters on Partner type LI system fails.
    If I add message type ORDERS in Inbound Parameters of Partner Type LS and Outbound Parameters on Partner type LI system works fine.
    Whenever IDOCs are being processed partner profile are being shown as follows:-
    Outbound IDOC : LI/LF/V001 ( Receiver)
    Inbound IDOC : LS/  /ZEDI ( Sender)
    My question is that can I make any setting so that I get the following:-
    Sender ( LI/LF/V001)
    Receiver ( KU/WE/K001)
    LF and WE are respective partner functions
    Regards,
    Amit

  • Change pointers using ALE/IDOC configure

    how configure CVhange Pointers using ALE/IDOC

    Hi,
    [Change pointers configuration|Change pointers]
    For more info you can search in SCN, you will get more.
    Thanks!!

  • ALE/IDOC Configuration needs to do Asynchronous processing

    Hi,
    I have generated the partner profile for sending and recieving system and has created a synchronous process.
    I need to do asynchronous process so what should I do?
    So when I am trying to DISTRIBUTE the model view it giving me the error.
    If any one can answer i appreciate them.
    Thank you,
    Mili.

    Hi Mili,
    Please add manually message type <b>SYNCH</b> for partner profile (WE20) LS <b>SNX125LS</b> then try again to distribute the model view.
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • ALE - IDOC vs IDOC - EDI

    Hi,
    I can see the ALE IDOC configurations at many places . Whats the process to send an IDOC to External Non-SAP System?
    Does it differ much??
    Please explain the steps.

    Hi,
    Pushing the IDOC from SAP to External:
    IDOC are SAP specifc data structure.  Only SAP understands IDOCS natively.  Normall what you can do is write a process that maps the IDOC to the format the recieving system is looking for. ie: flat file etc...   Or if the external system can be coded to understand the IDOC structure, you could put a flat file with this structure to be read by teh external system.
    Pulling from the External system:
    Usin connectors, the external system can call a BAPi or RFC function module that can create IDOCS and pass the data to the external system using the IDOC structure.
    thanks.
    JB

  • ALE & IDOC ? Needs?

    <b>Hi friends, can any one help me , in interview  .how to explain this ale & idoc.????????
    ALE & IDOC
    Configured ALE for communicating purchase orders, material master and customer master.  Created RFC Function module for ALE layer to process the Inbound IDOCs i.e. transferring of data to the table using Inbound IDOCs and processing Outbound IDOCs.</b>

    Hello Thambisha,
    Go through these links
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
    http://help.sap.com/saphelp_erp2004/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b828943d711d1893e0000e8323c4f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/03e6e790-0201-0010-9d98-ab8102817a92
    Regards,
    Praveen

  • ALE/IDOC responsibility

    Hi,
    ALE and IDOC configuration,creation/maintain at R/3 application side, who is gonna responsibliity of?
    XI consultant? or ABAPer? ALE Consultant?
    is there a ALE consultant in real life?
    any comment will be appreciated for me.
    thanks
    venjamin

    Hi Venjamin,
    XI consultant?
    XI consultant is not responsible for ALE/IDOC configuration ...
    But as a ABAP consultant, he can create/maintain ALE/Idoc configuration... and in ALE configuration creating logical systems, assigning to client i think is for Basis person will do or the functional but not ABAPer mostly...
    and also no Particulat ALE consultant exists...
    Regards,
    Sridhar

  • How to configure ALE/IDOC in  nace for V3.

    Hi,
    Please let me  know how to configure ALE/IDOC output type in Nace and how to configure the message outputs.
            I require the steps to configure the above.
             Screen shots will also be helpful.
    Regards,

    Hi Somya,
    I have a little manual that explain how to create an outbound Idoc from a message class (for invoice).
    But it is in spanish, if you want give me a email address and I'll send you.
    Rgrds,
    Francisco Castillo

  • ALE and Idocs configuration

    Hi Gurus,
    Please tell me the ALE and Idocs configuration settings
    Thnaks in advance

    Hi,
    Please refer to the details mentioned in the hyper-links beow.
    You will get the details how to go about it.
    To see the IDOC & status check it in WE02/WE05
    You will get step by step process.
    ABAP Development
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.geocities.com/xplosion78/customised_ALE_IDOC_BY_SACHIN_DABHADE.zip
    http://help.sap.com/saphelp_45b/helpdata/en/35/b0ea5187a62488e10000009b38f9b7/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/c4/6bc368fef411d28d0900104b56737d/frameset.htm
    ABAP Development
    Follow below steps to create custom IDOC.
    1.Create segments through transaction WE31.
    2.Create IDoc Type through transaction WE30 by attaching created segments.
    3.Message type through transaction WE81.
    4.Link Idoc and message type in WE82 transaction.
    Check the transaction WEDI for ALE settings
    Check these links for more details on IDoc's:
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    ALE/ IDOC/ XML
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://www.thespot4sap.com/Articles/SAP_XML_Business_Integration.asp
    http://help.sap.com/saphelp_srm30/helpdata/en/72/0fe1385bed2815e10000000a114084/content.htm
    IDOC Convertion
    /people/kevin.wilson2/blog/2005/12/07/changing-fields-in-an-idoc-segment
    http://www.intelligententerprise.com/channels/applications/feature/archive/kasturi.jhtml
    Hope this will help.
    Regards,
    Priyanka.

  • Data transfer using ALE/IDOC into XML.

    Dear All,
    I have to transfer FI document data (FB01) from the sap system ,convert it into XML and dump it in 1 of the file servers.I want to do this using ALE/IDOC.Is it possible to do the same and how.Similarly i want to do the same for Vendor and Customer master i.e sending the data in XML format.
    Kindly Suggest how do i go about doin the same..Its very urgent.Please help.
    Thanks & Regards,
    Lailu Philip.

    In continuation:
    Example Purchasing & Selling scenario
    We will develop a custom IDoc to carry the billing number from the Service Receiver’s system to the Service Provider’s system. We will populate the IDoc in a user exit on the sending side and we will process the transaction on the receiving side using a custom function module and a BDC transaction call.
    No rule conversion, segment filtering or version conversion will be implemented in the model as described in Figure 1.
    Requirements
    • Working ALE environment - See ALE Basis Configuration Guide;
    • ALE scenario design together with the business requirement;
    • Development access; and
    • ALE configuration access.
    NOTES:
    1. All IMG references to transactions are located in the transaction SALE which is the ALE portion of the IMG
    2. This is one way of developing a scenario where no message control exists. If message control exist (EG. On purchase orders) then NAST can be used to call an outbound function module that would create the required IDocs.
    3. Extensive knowledge of IDocs and ALE basis configuration is required in order to understand this guide.
    2. OUTBOUND PROCESSING
    2.1. Create IDoc type (WE30) Client independent
    The IDoc type refers to the IDoc structure that you will require for your development. In our case the IDoc type is called ZINVRV01. This IDoc type will have 1 segment called Z1INVRV with 2 fields, LIFNR & XBLNR, in this segment. If you require many segments or nested segments then they are also created using the same procedure.
    We will create the IDoc of the following structure:
    ZINVRV01
    Purchasing and Selling - Invoice receipt reversal
    Z1INVRV P&S - Segment 1
    Segment fields
    LIFNR Vendor account number
    XBLNR Reference document number
    Figure 3: IDoc type ZINVRV01
    To create the IDoc type, follow these next few steps:
    • Enter transaction WE30 (ALE -> Extensions -> IDoc types -> Maintain IDoc type)
    • Type in ZINVRV01 and click on Basic IDoc type, click the Create icon
    • Click on Create new (we are creating an IDoc from scratch but you may want to copy another IDoc if it is similar to your requirements) and enter a description, and press enter
    • Click on ZINVRV01 and then on the Create icon
    • Enter Z1INVRV as the segment type (must start with Z1), check mandatory if the segment must exist (in this case check it), enter 1 in minimum number and 1 as maximum number. (Make the maximum number 9999999999 if there are going to be many of these segments in each IDoc. IE. When line items are passed via IDocs), click on Segment editor
    • Enter a description for your segment type and create
    • Enter a description for your segment, enter each field required in your IDoc, in our case type LIFNR across for Field name, DE structure and DE documentation, repeat for XBLNR and press enter to validate.
    • Save and generate, press back
    • To release the segment choose Goto, Release from the menu
    • Check the box on the line of your new segment
    • Save, back and enter
    • Your IDoc type structure should be displayed with your new segment
    • Save and back
    • To release the IDoc type choose Extras, Release type from the menu and Yes
    Your IDoc is now ready for use. If you need to add fields or segments to your IDoc type, you will need to cancel the release of the IDoc type as well as the segment release using a similar procedure followed above (except now you uncheck the release box for the segment and you choose cancel release for the IDoc type).
    2.2. Create message type (WE81) Client independent
    To create a new message type, follow these next few steps:
    • Enter transaction WE81 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Create logical message type)
    • Choose Create logical message type by double clicking on it
    • Click on change icon to enter change mode
    • Click on New entries to add a new type
    • Enter the required message type, in our case it is ZINVRV and an appropriate description
    • Save and exit.
    Your message type has now been created. The next step will be to link it to the IDoc.
    2.2.1. Link message to IDoc type (WE82 & BD69) Client independent
    To link the message type to the IDoc type follow these next few steps:
    • Enter transaction WE82 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> EDI: Message Types and Assignment to IDoc Types)
    • Click on change icon to enter change mode
    • Click on New entries to create the link
    • Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
    • Save and exit
    • Enter transaction BD69 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Assign message type to IDoc for ALE)
    • Click on change icon to enter change mode
    • Click on New entries to create the link
    • Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
    • Save and exit
    Your IDoc is now linked to your message type. We still need to link object types and add the message to the model before we can use the message.
    2.2.2. Maintain object type for message type (BD59) Client independent
    The ALE objects are used to create links between IDocs and applications objects, to control the serialisation, to filter messages in the customer model and to use listings.
    For our own message type and IDoc you must maintain object types for the links.
    If you want to check the serialisation for the message type, then you must maintain object types for the serialisation. If no serialisation object has been maintained for a given message type, then the serialisation will not be checked for this message type.
    To add an object type to our message type, follow these next few steps:
    • Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types)
    • Type in your message type ZINVRV and press enter
    • Click on New entries
    • Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR
    • Save and exit.
    You have now created an object that we’ll use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.
    We now need to add our new message type to the distribution model.
    2.3. Configuring the Distribution Model
    This task is performed on your ALE reference client.
    2.3.1. Manual Configuration (BD64) Client dependent
    To manually configure the customer distribution model, read the ALE configuration procedure, and follow these steps:
    • Perform the Maintain customer distribution model directly function. (ALE -> Distribution customer model -> Maintain customer distribution model directly)
    • Specify the customer model you want to maintain and the logical system that is to be the sender of the messages OR create a new model. (Create model ALE with logical system ALELS1C400)
    • Choose the receiving systems to which the sending system must forward message type ZINVRV to.
    • For each receiving logical system allocate the message type necessary for communication to the receiving systems as per ALE configuration procedure.
    • Create filter objects (in our case LIFNR as the object type with the associated vendor number, 0000018001 with leading zeros, in the object area) for the message types.
    • Save the entries.
    NOTES:
    You cannot maintain a message type between the same sender and receiver in more than one customer distribution model.
    Only the owner is authorised to modify the model.
    To change the owner of a model, choose the 'Maintain ownership of customer distribution model' function. Make sure that all changes will be distributed to all systems that know the corresponding model. To do so, you can use the correction and transport system.
    To transport the customer distribution model you should use the Distribute customer model function of the IMG as described below.
    2.3.2. Distribute customer model (BD71) Client dependent
    After the customer model has been created centrally, it must be distributed to the other remote systems. This entails first of all setting up the communication for the distributed systems and then sending the model.
    2.3.2.1. Distribute Model (BD71) Client dependent
    This task is performed on your ALE reference client. To distribute the customer distribution model, read the ALE configuration procedure and follow these steps:
    • Make the settings for the communication with the other decentral systems, you have not set them yet.
    • Define the RFC destination for R/3 connections whose names correspond to the name of the corresponding logical system.
    • Create the output partner profile.
    • Distribute the customer model
    • Specify the name of the customer model.
    • You must specify the target system to which you want to distribute the customer model.
    • You must repeat this function for every distributed logical system.
    2.3.2.2. Maintain sending system partner profile (WE20) Client dependent
    With this function, you define the partner profiles for all outbound and inbound messages on the basis of the customer distribution model.
    After you have defined and distributed the customer model, you will have to maintain the partner profiles locally. To do this read the ALE configuration procedure.
    • Enter the output mode (background, immediately) and the package size for outbound processing.
    Requirements
    • The customer model must be maintained.
    • RFC destinations must be maintained.
    • The customer model must be distributed.
    • To ensure that the appropriate persons in charge are informed if a processing error occurs, you must make settings in: Error processing Maintain organisational units.
    2.4. Populate & distribute IDoc using ABAP
    An IDoc consists of a control record with structure edidc and one or more data records with structure edidd. The control record contains the sender and recipient of the IDoc, as well as information on the type of message.
    To be able to pass an IDoc to the ALE layer, you must set up a field string with structure edidc and an internal table with structure edidd. They are used to call function module master_idoc_distribute, which performs the save to the database and triggers the dispatch if necessary.
    2.4.1. Example code
    The code displayed below does the following:
    • populates our IDoc segment Z1INVR with the 2 fields XBLNR and LIFNR, populates the segment name and appends this to an internal table used to store the IDoc data;
    • populates the control record info with the message type and IDoc type; and
    • calls the MASTER_IDOC_DISTRIBUTE function module which distributes the IDoc as configured in the customer distribution model.
    Data declaration statements
    DATA: C_INVREV_SEGNAME(7) TYPE C VALUE 'Z1INVRV',
    C_INVREV_MESTYPE(6) TYPE C VALUE 'ZINVRV',
    C_INVREV_IDOC_TYPE(8) TYPE C VALUE 'ZINVRV01',
    Z1INVRV LIKE Z1INVRV,
    C_INVREV_DOCTYPE LIKE BKPF-BLART VALUE 'YY',
    IDOC_CONTROL LIKE EDIDC,
    T_COMM_CONTROL LIKE EDIDC OCCURS 0 WITH HEADER LINE,
    IDOC_DATA LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    Move the document header into a structure
    LOOP AT DOC_HEAD_TAB INTO DOC_HEAD.
    ENDLOOP.
    Move the document item data into a structure
    LOOP AT DOC_ITEM_TAB INTO DOC_ITEM WHERE NOT ( LIFNR IS INITIAL ).
    ENDLOOP.
    Populate the IDoc segment’s field with the required data
    CLEAR Z1INVRV.
    Z1INVRV-LIFNR = DOC_ITEM-LIFNR. “Store vendor number for filter
    Z1INVRV-XBLNR = DOC_HEAD-XBLNR. “Billing number
    IDOC_DATA-SEGNAM = C_INVREV_SEGNAME. “Segment name
    IDOC_DATA-SDATA = Z1INVRV. “Segment data
    APPEND IDOC_DATA. “Populate IDoc internal table
    Move the control data info required for the distribution
    IDOC_CONTROL-MESTYP = C_INVREV_MESTYPE.
    IDOC_CONTROL-DOCTYP = C_INVREV_IDOC_TYPE.
    Call the distribute function with the required parameters
    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' IN UPDATE TASK
    EXPORTING
    MASTER_IDOC_CONTROL = IDOC_CONTROL
    TABLES
    COMMUNICATION_IDOC_CONTROL = T_COMM_CONTROL
    MASTER_IDOC_DATA = IDOC_DATA
    EXCEPTIONS
    ERROR_IN_IDOC_CONTROL = 1
    ERROR_WRITING_IDOC_STATUS = 2
    ERROR_IN_IDOC_DATA = 3
    SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
    OTHERS = 5.
    Figure 4: Outbound processing example code
    NOTE:
    For debugging purposes, use transaction WE05 (IDoc overview) to see check your IDoc status, or to see whether an IDoc was created/
    3. INBOUND PROCESSING
    3.1. Create Function Module
    This function module is called when a message type, of type ZINVRV, comes into the receiving system. This needs to be configured and is dealt with later in this section. The function module is passed the IDoc as a parameter.
    Example parameters
    Import parameters Reference field Opt Y/N
    INPUT_METHOD BDWFAP_PAR-INPUTMETHD N
    MASS_PROCESSING BDWFAP_PAR-MASS_PROC N
    Export Parameters Reference field Opt Y/N
    WORKFLOW_RESULT BDWFAP_PAR-RESULT N
    APPLICATION_VARIABLE BDWFAP_PAR-APPL_VAR N
    IN_UPDATE_TASK BDWFAP_PAR-UPDATETASK N
    CALL_TRANSACTION_DONE BDWFAP_PAR-CALLTRANS N
    Table Parameters Reference field Optional Y/N
    IDOC_CONTRL EDIDC
    IDOC_DATA EDIDD
    IDOC_STATUS BDIDOCSTAT
    RETURN_VARIABLES BDWFRETVAR
    SERIALIZATION_INFO BDI_SER
    Exceptions
    WRONG_FUNCTION_CALLED
    Example code
    The code displayed below does the following:
    • populates a BDC table with the IDoc info;
    • calls the transaction via a BDC call; and
    • updates the IDoc status according to the BDC error status.
    EXTRACT FROM: Z_IDOC_INPUT_ZINVRV
    Declaration of local variables
    DATA: C_SEGNAM(10) TYPE C VALUE 'Z1INVRV'.
    *-Loop through the IDOCs
    LOOP AT IDOC_CONTRL.
    *---Loop through the data for the IDOC
    LOOP AT IDOC_DATA WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
    CASE IDOC_DATA-SEGNAM.
    WHEN C_SEGNAM.
    Here we get the info from the idoc table
    IT_Z1INVRV = IDOC_DATA-SDATA.
    ENDCASE.
    PERFORM REV_INV.
    ENDLOOP.
    PERFORM UPDATE_IDOC_STATUS.
    ENDLOOP.
    FORM REV_INV "Reverse invoice form
    Local variables & constants
    DATA: C_TCODE LIKE BKPF-TCODE VALUE 'VF11'. "BDC transaction code
    Now we can build the bdc table to call the reversal transaction start of screen 109
    CLEAR BDC_TAB.
    BDC_TAB-PROGRAM = 'SAPMV60A'.
    BDC_TAB-DYNPRO = '109'.
    BDC_TAB-DYNBEGIN = 'X'.
    APPEND BDC_TAB.
    Document number
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = 'KOMFK-VBELN(01)'.
    BDC_TAB-FVAL = IT_Z1INVRV-XBLNR. "Billing document number
    APPEND BDC_TAB.
    OK Code for screen 109
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = 'BDC_OKCODE'.
    BDC_TAB-FVAL = 'SICH'.
    APPEND BDC_TAB.
    Now we can call transaction 'VF11' with the populated bdc table. The transaction is called inside the idoc-contrl loop, so a transaction will be called for every idoc (journal). the transaction is called in no-display mode ('N') because this code runs in background as it is called by ale. The update is specified to be synchronous ('S') because we have to wait for the result to update the idoc status correctly.
    CALL TRANSACTION C_TCODE USING BDC_TAB MODE 'N' UPDATE 'S'.
    Store the return code for use in another form (status update)
    RETURN_CODE = SY-SUBRC.
    Here we check the return code, if there was an error, we put the transaction in a bdc session for the user to review and correct.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = 'ZINVRV'
    USER = C_ALE_USER
    KEEP = 'X'.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = C_TCODE
    TABLES
    DYNPROTAB = BDC_TAB.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3.
    ELSE. "No problems
    C_EXISTS = 'N'.
    Select from the billing document table to get sales doc number
    SELECT * FROM VBRP WHERE VBELN = IT_Z1INVRV-XBLNR.
    Select from the sales document table to get user status number
    SELECT SINGLE * FROM VBAP WHERE VBELN = VBRP-AUBEL AND
    POSNR = VBRP-AUPOS.
    Select from the status table to change the user status to pending
    SELECT * FROM JEST WHERE OBJNR = VBAP-OBJNR AND
    STAT LIKE C_USER_STATUS.
    IF JEST-STAT = C_US_PENDING. "User status is pending
    JEST-INACT = C_UNCHECKED. "Make pending the active status
    UPDATE JEST.
    C_EXISTS = 'Y'. "I.E. An entry is already in table
    ELSEIF JEST-INACT = C_UNCHECKED AND JEST-STAT NE C_US_PENDING.
    JEST-INACT = C_CHECKED. "Make everything else inactive
    UPDATE JEST.
    ENDIF.
    ENDSELECT.
    IF C_EXISTS = 'N'. "I.E. Pending has never been a status before
    JEST-OBJNR = VBAP-OBJNR.
    JEST-STAT = C_US_PENDING.
    JEST-INACT = C_UNCHECKED. "Make pending the active status
    INSERT JEST.
    ENDIF.
    ENDSELECT. "Select from VBRP (Billing document table)
    ENDIF.
    ENDFORM. " REV_INV
    FORM UPDATE_IDOC_STATUS.
    Now we check the CALL TRANSACTION return code and set IDOC status
    CLEAR IDOC_STATUS.
    IF RETURN_CODE = 0.
    WORKFLOW_RESULT = '0'.
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IDOC_STATUS-STATUS = '53'.
    IDOC_STATUS-UNAME = SY-UNAME.
    IDOC_STATUS-REPID = SY-REPID.
    IDOC_STATUS-MSGTY = SY-MSGTY.
    IDOC_STATUS-MSGID = SY-MSGID.
    IDOC_STATUS-MSGNO = SY-MSGNO.
    IDOC_STATUS-MSGV1 = SY-MSGV1.
    IDOC_STATUS-MSGV2 = SY-MSGV2.
    IDOC_STATUS-MSGV3 = SY-MSGV3.
    IDOC_STATUS-MSGV4 = SY-MSGV4.
    RETURN_VARIABLES-WF_PARAM = 'Processed_IDOCs'.
    RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    APPEND RETURN_VARIABLES.
    ELSE.
    WORKFLOW_RESULT = '99999'.
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IDOC_STATUS-STATUS = '51'.
    IDOC_STATUS-UNAME = SY-UNAME.
    IDOC_STATUS-REPID = SY-REPID.
    IDOC_STATUS-MSGTY = SY-MSGTY.
    IDOC_STATUS-MSGID = SY-MSGID.
    IDOC_STATUS-MSGNO = SY-MSGNO.
    IDOC_STATUS-MSGV1 = SY-MSGV1.
    IDOC_STATUS-MSGV2 = SY-MSGV2.
    IDOC_STATUS-MSGV3 = SY-MSGV3.
    IDOC_STATUS-MSGV4 = SY-MSGV4.
    RETURN_VARIABLES-WF_PARAM = 'ERROR_IDOCS'.
    RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    APPEND RETURN_VARIABLES.
    ENDIF.
    APPEND IDOC_STATUS.
    ENDFORM. " UPDATE_IDOC_STATUS
    Figure 5: Inbound processing example code
    3.1.1. Debugging inbound FM
    Use transaction WE19 to test inbound function module in debugging mode. Also use WE05 to view the IDocs and their statuses.
    3.2. Maintain ALE attributes
    The inbound function module needs to be linked to the message type and the message type needs to be linked to the appropriate inbound process code at the partner profile level before the scenario is enabled. These steps are described below in detail.
    3.2.1. Link Message Type to Function Module (WE57) Client independent
    To link a message (ZINVRV) type to a function module (Z_IDOC_INPUT_ZINVRV) follow these steps:
    • Enter transaction WE57 (ALE -> Extensions -> Inbound -> Allocate function module to logical message)
    • Select an entry (EG. IDOC_INPUT_ORDERS) and copy
    • Type in module name Z_IDOC_INPUT_ZINVRV
    • Type in basic IDoc type as ZINVRV01
    • Type in message type as ZINVRV
    • Type object type as IDOCINVOIC (Invoice document) - Used for workflow
    • Direction should be set to 2 for inbound
    • Enter and save
    3.2.2. Define FM settings (BD51) Client independent
    • Enter transaction BD51 (ALE -> Extensions -> Inbound -> Define settings for input modules)
    • Click on New entries
    • Type in the name of the new function module Z_IDOC_INPUT_ZINVRV
    • Enter 0 for mass processing in the output column
    • Save and Exit
    3.2.3. Maintain process codes (WE42) Client dependent
    A process code needs to be maintained on each client. It then needs to be linked to the message via the partner profiles on each client. This allows the various clients to use a unique function module for the same message type.
    To maintain the process code follow these steps:
    • Log on to the appropriate receiving system client
    • Execute WE42 (ALE -> Extensions -> Inbound -> Maintaining process codes inbound)
    • Choose Inbound with ALE service
    • Choose Processing with function module
    • Click on Processing with function module and choose create icon
    • Click on New Entries
    • Type in process code ZINR and give it a description and save
    • Now you are asked to Please maintain codes added in ALE entry methods, enter and choose Z_IDOC_INPUT_FIRVSL and copy it. You should choose a FM similar to your one.
    • Enter your process code ZINR
    • Enter your function module Z_IDOC_INPUT_ZINVRV
    NOTE: The next 6 steps are used in workflow error handling.
    • Enter IDPKFIDCMT in object type
    • Enter MASSINPUTFINISHED in End event
    • Enter IDOCINVOIC in IDoc object type
    • Enter INPUTERROROCCURREDFI in IDoc start event
    • Enter INPUTFINISHEDFI in IDoc End event
    • Enter IDOCINVOIC in Application object type
    You will need to determine the task associated with object IDOCINVOIC, and then assign the appropriate position to it. This position will then receive the application error messages via workflow.
    To set up the workflow area please consult the Workflow config guide.
    3.3. Create inbound partner profile
    For each message type you need to maintain the inbound partner profiles.
    3.3.1. Maintain receiving system partner profile (WE20) Client dependent
    To maintain inbound partner profiles read the document ALE configuration procedure:
    • Add the message type ZINVRV with process code ZINR.
    • Enter the output mode (background, immediately) for inbound processing and NO message code.
    • Enter the position S and choose the ALE administrator 50000085. This position will then receive all the technical ALE errors via workflow.
    3.4. Test
    Once the inbound function module has been debugged the scenario should be ready to test in its entirety. If problems occur, read through the relevant areas of this document to check your configuration or code.
    Hope this will help you,
    If you  want me to explain more, you can give me your email id.
    Reward with points incase you are satisfied.
    Regards,
    Sushama

Maybe you are looking for

  • How do I change the way audiobooks display.

    When I use audiobooks (iTunes 11) now, and there are tracks to the books, they play out of order (1a, 2a, 3a, 1b, 2b, 3b, etc). There is not an obvious way to change the view of audiobooks to fix it or an obvious fix at all. Thanks for your help

  • How can I get two hard drives connected to the Airport Extreme. There's only 1 USB port.

    I believe I want to use TWO USB Hard Drives with my Airport Extreme, but it seems there is only 1 USB port. I am currently using that USB port for my backup external hard drive (works with Time Machine). But now I have decided I want a common hard dr

  • Logical Key for Degenerate Dimension

    Hi Gurus, Need some help on the degenerate dimensions in the BMM layer. I have one fact table with dimension attributes and I would like to move the attributes into separate logical table and treat it as dimension. Now my newly created dimension has

  • Web Template with multiple Data Provider Query with partial authority

    Dear Guru, I have a single web template, that contains 2 query data providers (e.g. Query A, Query B), and all users access to this web template for both queries. Now, there are some users that have authority to Query A only. When they access to this

  • What frustrates you when using the "Administrator Word Bench"? (RSA1)

    Hi All, As a developer and user of the "Administrator Workbench (RSA1)" ... what feature makes you mumble under your breath in frustration? Problem: When deleting PSA requests, the dialog box does not have a u201CSelect Allu201D button. It was easy t