Background:

An ALE IDoc Interface set-up requires series of configuration steps involved and often multiple transactions are to be accessed to check whether a particular configuration is as expected or not.

Problem:

Standard transaction BDM5 is available to check but will not fully solve the purpose.

Solution:

A custom transaction is developed which details out all configuration details pertaining to an interface. Details including Partner profile setup, Port setup, RFC connection details, Distribution model setup, Output message types configuration etc..

Explanation:

Input:

A simple selection screen which requires Partner system and IDoc direction.

ZCAIDOCDB_SS.png


As output it details below configuration data.

Output:

1. Partner system/Partner type:

Transactions: BD54, WE20

Tables: TBDLS 

2. Message type/Message function/Message code:

IDoc type, Extension IDoc:

Transactions: WE81, WE82, WE20, WE30

3. Output mode, Packet size:

Transfer Immediately or Collect IDoc’s

Transaction: WE20

Tables: EDP13, EDP12, EDP21

4.Port/ Port type:

Transactions: WE20, WE21

Tables: EDIPORT, EDIPOA

ZCAIDOCDB_WE20_1.png

5. Output type configuration, requirement routines assigned:

Transactions: WE20, NACE

Tables: T683S

ZCAIDOCDB_WE20_2.png

NACE 1.png

6. Change pointers enabled or not.

Transaction: BD50

Tables referred: TBDA2

BD50.png

BD60.png

7. Distribution model/Filters:

Transactions: BD64

Tables referred: TBD05, TBD06

BD64.png

8. Process code information:

Transactions: WE41 for OutBound, WE42 for InBound, WE64

Tables referred: TEDE1, TBD52,  TBDME

WE41.png

WE42.png

9. RFC Destination, RFC type:

Transactions: WE20, WE21, SM59

Tables: RFCDES

WE21.png

SM59_1.png

SM59_2.png

All these (10-12) transactions are consolidated into a single report and logic is as below. Hot spot on each column navigates to more detailed information or relevant transaction.

Code: (also attached as .txt file)


*&---------------------------------------------------------------------*
*& Report  ZCA_IDOC_DASHBOARD                           *
*----------------------------------------------------------------------*
*& Functional             : Sravan Guduru                   *
*& Created On           : 11.05.2016 *
*& Title                       : IDoc technical Config dashboard
 *----------------------------------------------------------------------*
REPORT  zca_idoc_dashboard.
TYPES: BEGIN OF tt_edp13,
          rcvprn TYPE ediprcvprn,
          rcvprt TYPE ediprcvprt,
          mestyp TYPE edipmestyp,
          mescod TYPE edipmescod,
          mesfct TYPE edipmesfct,
          outmod TYPE edipoutmod,
          rcvpor TYPE ediprcvpor,
          idoctyp TYPE edipidoctp,
          cimtyp TYPE edipcimtyp,
          stdmes TYPE edi_pvstdm,
          pcksiz TYPE edippcksiz,
        END OF tt_edp13,
        BEGIN OF tt_edp12,
          rcvprn TYPE ediprcvprn,
          rcvprt TYPE ediprcvprt,
          kappl TYPE edi_kappl,
          kschl TYPE edi_kschl,
          aende TYPE edi_aende,
          evcoda TYPE edipevcoda,
          mestyp TYPE edipmestyp,
          mescod TYPE edipmescod,
          mesfct TYPE edipmesfct,
        END OF tt_edp12,
        BEGIN OF tt_edipoa,
         port TYPE edi_pvrcvp,
         logdes TYPE edi_logdes,
        END OF tt_edipoa,
        BEGIN OF tt_tede1,
          evcode TYPE edi_evcoda,
          routid TYPE edi_prcss1,
        END OF tt_tede1,
        BEGIN OF tt_t683s,
          kappl TYPE kappl,
          kschl TYPE kschl,
          kobed TYPE kobed,
        END OF tt_t683s,
        BEGIN OF tt_tbd05,
          custmodel TYPE custmodel,
          sndsystem TYPE sendsystem,
          mestyp TYPE edi_mestyp,
          rcvsystem TYPE recvsystem,
          fobjtype TYPE fobjtype,
          fobjvalue TYPE modobjval,
        END OF tt_tbd05,
        BEGIN OF tt_tbd06,
          custmodel TYPE custmodel,
          sndsystem TYPE sendsystem,
          bobjtype TYPE swo_objtyp,
          method TYPE swo_method,
          rcvsystem TYPE recvsystem,
          fobjtype TYPE fobjtype,
          fobjvalue TYPE modobjval,
        END OF tt_tbd06,
        BEGIN OF tt_tbdba,
          mestype TYPE edipmestyp,
          objecttype TYPE swo_objtyp,
          method TYPE swo_method,
        END OF tt_tbdba,
        BEGIN OF tt_alvout,
          parnum TYPE edp13-rcvprn,
          partyp TYPE edp13-rcvprt,
          mestyp TYPE edp13-mestyp,
          mescod TYPE edp13-mescod,
          mesfct TYPE edp13-mesfct,
          outmod TYPE edp13-outmod,
          rcvpor TYPE edp13-rcvpor,
          porttyp TYPE ediport-porttyp,
          logdes TYPE edipoa-logdes,
          rfctype TYPE rfcdes-rfctype,
          rfc_description  TYPE rfcdoc_d,
          rfc_system_number TYPE rfcservice,
          rfc_server_name TYPE rfchost_ext,
          rfc_logon_language TYPE rfclang,
          rfc_logon_client TYPE rfcclient,
          rfc_logon_user TYPE rfcuser,
          rfc_password_status TYPE sdest_pwd_status,
          rfc_gateway_host TYPE  rfcgwhost,
          rfc_gateway_service TYPE rfcgwserv,
          rfc_program TYPE rfcexec_ext,
          idoctyp TYPE edp13-idoctyp,
          cimtyp TYPE edp13-cimtyp,
          stdmes TYPE edp13-stdmes,
          active TYPE tbda2-active,
          pcksiz TYPE edp13-pcksiz,
          kappl  TYPE edp12-kappl ,
          kschl TYPE edp12-kschl,
          kobed TYPE t683s-kobed,
          aende TYPE edp12-aende,
          evcoda TYPE edp12-evcoda,
          routid TYPE tede1-routid,
          evcode TYPE tbd52-evcode,
          funcname TYPE tbd52-funcname,
          maxretries TYPE tbd52-maxretries,
          objecttype TYPE swo_objtyp,
          method TYPE swo_method,
        END OF tt_alvout,
        BEGIN OF tt_alvout_detail,
          custmodel TYPE custmodel,
          sndsystem TYPE sendsystem,
          mestyp TYPE edi_mestyp,
          bobjtype TYPE swo_objtyp,
          method TYPE swo_method,
          rcvsystem TYPE recvsystem,
          fobjtype TYPE fobjtype,
          fobjvalue TYPE modobjval,
        END OF tt_alvout_detail.
TYPES: BEGIN OF tt_edp21,
         sndprn TYPE edp21-sndprn,
         sndprt TYPE edp21-sndprt,
         mestyp TYPE edp21-mestyp,
         mescod TYPE edp21-mescod,
         mesfct TYPE edp21-mesfct,
         evcode TYPE edp21-evcode,
        END OF tt_edp21,
        BEGIN OF tt_tbd52,
          evcode TYPE tbd52-evcode,
          funcname TYPE tbd52-funcname,
          maxretries TYPE tbd52-maxretries,
        END OF tt_tbd52,
        BEGIN OF tt_rfcdes,
          rfcdest TYPE rfcdes-rfcdest,
          rfctype TYPE rfcdes-rfctype,
        END OF tt_rfcdes,
        BEGIN OF tt_ediport,
          port TYPE ediport-port,
          porttyp TYPE ediport-porttyp,
          descri TYPE ediport-descri,
        END OF tt_ediport,
        BEGIN OF tt_tbda2,
          MESTYP TYPE tbda2-mestyp,
          ACTIVE TYPE tbda2-active,
        END OF tt_tbda2,
        BEGIN OF tt_tbdme,
          MESTYP TYPE EDI_MESTYP,
          IDOCFBNAME TYPE IDOCFBNAME,
        END OF tt_tbdme.
DATA:  gt_edp13 TYPE STANDARD TABLE OF tt_edp13,
        gt_edp13_copy TYPE STANDARD TABLE OF tt_edp13,
        gs_edp13 LIKE LINE OF gt_edp13
       ,gt_edp12 TYPE STANDARD TABLE OF tt_edp12
       ,gt_edp12_copy TYPE STANDARD TABLE OF tt_edp12
       ,gs_edp12 LIKE LINE OF gt_edp12
       ,gt_edipoa TYPE STANDARD TABLE OF tt_edipoa
       ,gt_edipoa_copy TYPE STANDARD TABLE OF tt_edipoa
       ,gs_edipoa LIKE LINE OF gt_edipoa
       ,gt_tede1 TYPE STANDARD TABLE OF tt_tede1
       ,gs_tede1 LIKE LINE OF gt_tede1
       ,gt_t683s TYPE STANDARD TABLE OF tt_t683s
       ,gs_t683s LIKE LINE OF gt_t683s
       ,gt_tbd05 TYPE STANDARD TABLE OF tt_tbd05
       ,gs_tbd05 LIKE LINE OF gt_tbd05
       ,gt_alvout TYPE STANDARD TABLE OF tt_alvout
       ,gs_alvout LIKE LINE OF gt_alvout
       ,gt_alvout_detail TYPE STANDARD TABLE OF tt_alvout_detail
       ,gt_alvout_detail_filter TYPE STANDARD TABLE OF tt_alvout_detail
       ,gs_alvout_detail LIKE LINE OF gt_alvout_detail
       ,gv_own_logical_system TYPE tbdls-logsys
       ,gt_tbdba TYPE STANDARD TABLE OF tt_tbdba
       ,gs_tbdba LIKE LINE OF gt_tbdba
       ,gt_tbd06 TYPE STANDARD TABLE OF tt_tbd06
       ,gs_tbd06 LIKE LINE OF gt_tbd06
       ,gt_edp21 TYPE STANDARD TABLE OF tt_edp21
       ,gt_edp21_copy TYPE STANDARD TABLE OF tt_edp21
       ,gs_edp21 LIKE LINE OF gt_edp21
       ,gt_tbd52 TYPE STANDARD TABLE OF tt_tbd52
       ,gs_tbd52 LIKE LINE OF gt_tbd52
       ,gt_rfcdes TYPE STANDARD TABLE OF tt_rfcdes
       ,gs_rfcdes LIKE LINE OF gt_rfcdes
       ,gt_ediport TYPE STANDARD TABLE OF tt_ediport
       ,gs_ediport LIKE LINE OF gt_ediport
       ,gt_tbda2 TYPE STANDARD TABLE OF tt_tbda2
       ,gs_tbda2 LIKE LINE OF gt_tbda2
       ,gt_tbdme TYPE STANDARD TABLE OF tt_tbdme
       ,gs_tbdme LIKE LINE OF gt_tbdme
       .
DATA : gs_tbdls TYPE tbdls,
        gs_edidc TYPE edidc,
        lt_sort_detail TYPE LVC_T_SORT,
        ls_sort_detail TYPE LVC_s_SORT.
DATA:
       lcl_container TYPE REF TO cl_gui_custom_container,
       lcl_container_detail TYPE REF TO cl_gui_custom_container,
       lcl_grid_display TYPE REF TO cl_gui_alv_grid,
       lcl_grid_display_detail TYPE REF TO cl_gui_alv_grid,
       ls_fieldcat TYPE lvc_s_fcat,
       ls_fieldcat_detail TYPE lvc_s_fcat,
       lt_fieldcat TYPE lvc_t_fcat,
       lt_fieldcat_detail TYPE lvc_t_fcat,
       ls_variant TYPE disvariant,
       ls_layout TYPE lvc_s_layo.
************************************************************************
*                     Event handler definition                         *
************************************************************************
CLASS gcl_event_receiver DEFINITION DEFERRED.
DATA  gt_event_receiver TYPE REF TO gcl_event_receiver.
************************************************************************
*                    CLASS DEFINATION                                  *
************************************************************************
CLASS gcl_event_receiver DEFINITION.
   PUBLIC SECTION.
     METHODS handle_hotspot_click
             FOR EVENT hotspot_click OF cl_gui_alv_grid
               IMPORTING e_row_id e_column_id
                 .
ENDCLASS.                    "gcl_event_receiver DEFINITION
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_logsys FOR gs_tbdls-logsys OBLIGATORY NO INTERVALS.
PARAMETERS: p_direct TYPE edi_direct OBLIGATORY.
SELECT-OPTIONS: s_mestyp FOR gs_edidc-mestyp, "EDI_MESTYP,
                 s_mescod FOR gs_edidc-mescod, "EDI_MESCOD,
                 s_mesfct FOR gs_edidc-mesfct. "EDI_MESFCT.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
*  perform validations
START-OF-SELECTION.
"Fetch OutB details
IF p_direct EQ 1. "OutB
   PERFORM:
     fecth_edp13_data, "EDIPORT, EDIPOA, RFCDES, TBDA2, TBDME
     fecth_edp12_data, "TEDE1, T683S
     "Distribution model data in detail screen
     fetch_tbd05_data,
     fetch_tbd06_data.
ELSEIF p_direct EQ 2. "InB
   PERFORM:
     fetch_data_edp21.
ENDIF.
*Fetch InB details
END-OF-SELECTION.
PERFORM:
   process_outb_data,
   process_inb_data.
PERFORM:
   dispaly_alv.
*&---------------------------------------------------------------------*
*&      Form  FECTH_EDP13_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM fecth_edp13_data .
   SELECT rcvprn rcvprt mestyp mescod mesfct outmod
          rcvpor idoctyp cimtyp stdmes pcksiz
     FROM edp13
     INTO TABLE gt_edp13
    WHERE rcvprn IN s_logsys
      AND mestyp IN s_mestyp
      AND mescod IN s_mescod
      AND mesfct IN s_mesfct.
   IF sy-subrc EQ 0.
*Port types
     gt_edp13_copy = gt_edp13.
     SORT gt_edp13_copy BY rcvpor.
     DELETE ADJACENT DUPLICATES FROM gt_edp13_copy COMPARING rcvpor.
      IF gt_edp13_copy IS NOT INITIAL.
       SELECT port porttyp descri FROM ediport
         INTO TABLE gt_ediport
          FOR ALL ENTRIES IN gt_edp13_copy
        WHERE port = gt_edp13_copy-rcvpor.
        IF sy-subrc EQ 0.
        ENDIF.
      ENDIF.
*Fetch RFC connection data - Table EDIPOA
     gt_edp13_copy = gt_edp13.
     SORT gt_edp13_copy BY rcvpor.
     DELETE ADJACENT DUPLICATES FROM gt_edp13_copy COMPARING rcvpor.
     IF gt_edp13_copy IS NOT INITIAL.
       SELECT port logdes FROM edipoa
         INTO TABLE gt_edipoa
         FOR ALL ENTRIES IN gt_edp13_copy
         WHERE port = gt_edp13_copy-rcvpor.
         IF sy-subrc EQ 0.
*RFC Details
           CLEAR gt_edipoa_copy[].
           gt_edipoa_copy[] = gt_edipoa[].
           SORT gt_edipoa_copy BY logdes.
           DELETE ADJACENT DUPLICATES FROM gt_edipoa_copy COMPARING logdes.
           IF gt_edipoa_copy IS NOT INITIAL.
             SELECT rfcdest rfctype FROM rfcdes
               INTO TABLE gt_rfcdes
                FOR ALL ENTRIES IN gt_edipoa_copy
              WHERE rfcdest = gt_edipoa_copy-logdes.
           ENDIF.
         ENDIF.
     ENDIF.
*Check change pointers active -  BD50; Table - TBDA2
     CLEAR gt_edp13_copy[].
     gt_edp13_copy = gt_edp13.
     SORT gt_edp13_copy BY mestyp.
     DELETE ADJACENT DUPLICATES FROM gt_edp13_copy COMPARING mestyp.
     IF gt_edp13_copy IS NOT INITIAL.
       SORT gt_edp13_copy by mestyp.
       SELECT MESTYP ACTIVE FROM TBDA2 INTO TABLE gt_tbda2
         FOR ALL ENTRIES IN gt_edp13_copy
         WHERE mestyp = gt_edp13_copy-mestyp.
       IF gt_tbda2 IS NOT INITIAL.
         DELETE gt_tbda2 WHERE ACTIVE IS INITIAL.
       ENDIF.
     ENDIF.
*Get FM name for change pointer messages
     IF gt_tbda2 IS NOT INITIAL.
       SELECT MESTYP IDOCFBNAME FROM TBDME INTO TABLE gt_tbdme
         FOR ALL ENTRIES IN gt_tbda2
         WHERE MESTYP = gt_tbda2-mestyp.
     ENDIF.
   ENDIF.
*FM - RFC_READ_TCPIP_DESTINATION - for Program ID
*FM - CAT_CHECK_RFC_DESTINATION - Check connection status
*FM - TREX_RFC_CONNECTION_CHECK
ENDFORM.                    " FECTH_EDP13_DATA
*&---------------------------------------------------------------------*
*&      Form  FECTH_EDP12_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM fecth_edp12_data .
   SELECT rcvprn rcvprt kappl kschl aende
          evcoda mestyp mescod mesfct
     FROM edp12
     INTO TABLE gt_edp12
    WHERE rcvprn IN s_logsys.
    DELETE gt_edp12 WHERE mestyp NOT IN s_mestyp
                      AND mescod NOT IN s_mescod
                      AND mesfct NOT IN s_mesfct.
    IF gt_edp12 IS NOT INITIAL.
      "Get Process code FM - TEDE1
      CLEAR gt_edp12_copy[].
      gt_edp12_copy = gt_edp12.
      SORT gt_edp12_copy BY evcoda.
      DELETE ADJACENT DUPLICATES FROM gt_edp12_copy COMPARING evcoda.
      IF gt_edp12_copy IS NOT INITIAL.
        SELECT evcode routid
          FROM tede1
          INTO TABLE gt_tede1
           FOR ALL ENTRIES IN gt_edp12_copy
         WHERE evcode = gt_edp12_copy-evcoda.
      ENDIF.
     "Get VOFM routine assigned to KSCHL - T683S
     CLEAR gt_edp12_copy[].
     gt_edp12_copy = gt_edp12.
     SORT gt_edp12_copy BY kappl kschl.
     DELETE ADJACENT DUPLICATES FROM gt_edp12_copy COMPARING kappl kschl.
     IF gt_edp12_copy IS NOT INITIAL.
       SELECT kappl kschl kobed FROM t683s
         INTO TABLE gt_t683s
          FOR ALL ENTRIES IN gt_edp12_copy
        WHERE kvewe = 'B'
          AND kappl = gt_edp12_copy-kappl
          AND kschl = gt_edp12_copy-kschl. "non-key ~ check performance
     ENDIF.
    ENDIF.
ENDFORM.                    " FECTH_EDP12_DATA
*&---------------------------------------------------------------------*
*&      Form  PROCESS_OUTB_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM process_outb_data .
   SORT:
    gt_edp13 BY rcvprn rcvprt mestyp mescod mesfct,
    gt_ediport BY port,
    gt_edipoa BY port,
    gt_rfcdes BY rfcdest,
    gt_tbdba BY mestype,
    gt_t683s BY kappl kschl,
    gt_tede1 BY evcode,
    gt_tbda2 BY mestyp,
    gt_tbdme BY mestyp
    .
LOOP AT gt_edp13 INTO gs_edp13.
   gs_alvout-parnum = gs_edp13-rcvprn.
   gs_alvout-partyp = gs_edp13-rcvprt.
   gs_alvout-mestyp = gs_edp13-mestyp.
   gs_alvout-mescod = gs_edp13-mescod.
   gs_alvout-mesfct = gs_edp13-mesfct.
   gs_alvout-outmod = gs_edp13-outmod.
   gs_alvout-rcvpor = gs_edp13-rcvpor.
   READ TABLE gt_ediport INTO gs_ediport WITH KEY port = gs_edp13-rcvpor BINARY SEARCH.
   IF sy-subrc EQ 0.
     gs_alvout-porttyp = gs_ediport-porttyp.
   ENDIF.
   READ TABLE gt_edipoa INTO gs_edipoa WITH KEY port = gs_edp13-rcvpor BINARY SEARCH.
   IF sy-subrc EQ 0.
     gs_alvout-logdes = gs_edipoa-logdes. "RFC
     READ TABLE gt_rfcdes INTO gs_rfcdes WITH KEY rfcdest = gs_edipoa-logdes BINARY SEARCH.
     IF sy-subrc EQ 0.
       gs_alvout-rfctype = gs_rfcdes-rfctype.
*Get destination details
       CASE gs_rfcdes-rfctype.
         WHEN 'I'. "Connection to Application Server with Same Database
         WHEN '3'. "Connection to ABAP System
           CALL FUNCTION 'DEST_RFC_ABAP_READ'
             EXPORTING
               name                           = gs_rfcdes-rfcdest
            IMPORTING
              description                    = gs_alvout-rfc_description
*             UI_LOCK                        =
*             LOAD_BALANCING                 =
*             SYSTEM_IDENTIFIER              =
              system_number                  = gs_alvout-rfc_system_number
              server_name                    = gs_alvout-rfc_server_name
*             GROUP_NAME                     =
*             SAVE_AS_HOSTNAME               =
*             ENABLE_TRACE                   =
*             EXPORT_TRACE                   =
*             TRUSTED_SYSTEM                 =
*             RFCLOGON_GUI                   =
              logon_language                 = gs_alvout-rfc_logon_language
              logon_client                   = gs_alvout-rfc_logon_client
              logon_user                     = gs_alvout-rfc_logon_user
              password_status                = gs_alvout-rfc_password_status
*             SAME_USER                      =
              gateway_host                   = gs_alvout-rfc_gateway_host
              gateway_service                = gs_alvout-rfc_gateway_service
*             TRFC_BG_SUPRESS                =
*             TRFC_BG_REPETITIONS            =
*             TRFC_BG_DELAY                  =
*             ARFC_ACTIVE                    =
*             ARFC_METHOD                    =
*             ARFC_CYCLE                     =
*             SNC_ACTIVE                     =
*             SNC_PARAMETER                  =
*             CONVERSION_MODE                =
*             CONVERSION_BYTES               =
*             UNICODE_BYTES                  =
*             RFC_BITMAP                     =
*             RFC_WAN                        =
*             MDMP_SETTINGS_ACTIVE           =
*             MDMP_LIST                      =
*             AUTHORIZATION_PARAMETER        =
*             QRFC_VERSION                   =
*             KEEPALIVE_TIMEOUT              =
*             BASXML_ACTIVE                  =
*             CATEGORY                       =
*             EXPLICIT_CODEPAGE_ACTIVE       =
*             LANGUAGE_CODEPAGE_ACTIVE       =
*             CLIENT_CODEPAGE_ACTIVE         =
*             EXPLICIT_CODEPAGE              =
            EXCEPTIONS
              read_failure                   = 1
              OTHERS                         = 2
                     .
           IF sy-subrc <> 0.
* Implement suitable error handling here
           ENDIF.
         WHEN '2'. "Connection to R/2 System
         WHEN 'T'. "Start External Program Using TCP/IP
           CALL FUNCTION 'DEST_RFC_TCPIP_READ'
             EXPORTING
               name                           = gs_rfcdes-rfcdest
            IMPORTING
              description                     = gs_alvout-rfc_description
*             UI_LOCK                        =
*             SERVER_NAME                    =
*             SAVE_AS_HOSTNAME               =
*             ENABLE_TRACE                   =
*             EXPORT_TRACE                   =
              gateway_host                   = gs_alvout-rfc_gateway_host
              gateway_service                = gs_alvout-rfc_gateway_service
*             TRFC_BG_SUPRESS                =
*             TRFC_BG_REPETITIONS            =
*             TRFC_BG_DELAY                  =
*             CONVERSION_MODE                =
*             CONVERSION_BYTES               =
*             UNICODE_BYTES                  =
*             RFC_BITMAP                     =
*             RFC_WAN                        =
*             AUTHORIZATION_PARAMETER        =
*             QRFC_VERSION                   =
*             KEEPALIVE_TIMEOUT              =
*             SNC_ACTIVE                     =
*             SNC_PARAMETER                  =
*             METHOD                         =
              program                        = gs_alvout-rfc_program
*             SSO_TICKET                     =
*             START_TYPE                     =
*             CPIC_TIMEOUT                   =
*             TRACE_SETTINGS                 =
*             BASXML_ACTIVE                  =
*             CATEGORY                       =
*             ASSERTION_TICKET               =
*             ASSERTION_TICKET_SYSID         =
*             ASSERTION_TICKET_CLIENT        =
*             CLIENT_CODEPAGE_ACTIVE         =
*             EXPLICIT_CODEPAGE_ACTIVE       =
*             EXPLICIT_CODEPAGE              =
            EXCEPTIONS
              read_failure                   = 1
              OTHERS                         = 2
                     .
           IF sy-subrc <> 0.
* Implement suitable error handling here
           ENDIF.
         WHEN 'L'. "Reference Entry (Refers to Other Destination)
         WHEN 'S'. "Start External Program Using SNA or APPC
         WHEN 'X'. "RFC Using Special ABAP Driver Routines
         WHEN 'M'. "CMC Connection
         WHEN 'H'. "HTTP Connection to ABAP System
         WHEN 'G'. "HTTP Connection to External Server
         WHEN OTHERS.
       ENDCASE.
     ENDIF.
   ENDIF.
   gs_alvout-idoctyp = gs_edp13-idoctyp.
   gs_alvout-cimtyp  = gs_edp13-cimtyp.
   gs_alvout-stdmes  = gs_edp13-stdmes.
   gs_alvout-pcksiz  = gs_edp13-pcksiz.
   READ TABLE gt_tbdba INTO gs_tbdba WITH KEY mestype = gs_edp13-mestyp BINARY SEARCH.
   IF sy-subrc EQ 0.
     gs_alvout-objecttype  = gs_tbdba-objecttype.
     gs_alvout-method  = gs_tbdba-method.
   ENDIF.
   READ TABLE gt_tbda2 INTO gs_tbda2 WITH KEY mestyp = gs_edp13-mestyp BINARY SEARCH.
   IF sy-subrc eq 0.
     gs_alvout-active = gs_tbda2-active.
     READ TABLE gt_tbdme INTO gs_tbdme WITH KEY mestyp = gs_edp13-mestyp BINARY SEARCH.
     IF sy-subrc eq 0.
       gs_alvout-routid = gs_tbdme-idocfbname. "Change pointer FM
     ENDIF.
   ENDIF.
    LOOP AT gt_edp12 INTO gs_edp12 WHERE rcvprn = gs_edp13-rcvprn
                                     AND mestyp = gs_edp13-mestyp
                                     AND mescod = gs_edp13-mescod
                                     AND mesfct = gs_edp13-mesfct.
     gs_alvout-kappl = gs_edp12-kappl.
     gs_alvout-kschl = gs_edp12-kschl.
     READ TABLE gt_t683s INTO gs_t683s WITH KEY kappl = gs_edp12-kappl
                                                kschl = gs_edp12-kschl
                                                BINARY SEARCH.
     IF sy-subrc EQ 0.
       gs_alvout-kobed = gs_t683s-kobed.
     ENDIF.
     gs_alvout-aende =  gs_edp12-aende. "Better to have description
     gs_alvout-evcoda = gs_edp12-evcoda.
     READ TABLE gt_tede1 INTO gs_tede1 WITH KEY evcode = gs_edp12-evcoda
                                       BINARY SEARCH.
     IF sy-subrc EQ 0.
       gs_alvout-routid = gs_tede1-routid.
     ENDIF.
     APPEND gs_alvout TO gt_alvout.
     CLEAR: gs_alvout-kappl, gs_alvout-kschl, gs_alvout-kobed,
            gs_alvout-aende, gs_alvout-evcoda, gs_alvout-routid.
     ENDLOOP.
     IF sy-subrc NE 0. "IDoc Messages without NACE o/p types. ex.: Master data/std.alone programs/Enh. triggers
       APPEND gs_alvout TO gt_alvout.
       CLEAR gs_alvout.
     ENDIF.
     AT NEW  mestyp. "Same msg type with multiple partner functions/codes
     LOOP AT gt_tbd05 INTO gs_tbd05 WHERE mestyp = gs_edp13-mestyp
                                      AND rcvsystem = gs_edp13-rcvprn.
        gs_alvout_detail-custmodel = gs_tbd05-custmodel.
        gs_alvout_detail-sndsystem = gs_tbd05-sndsystem.
        gs_alvout_detail-mestyp = gs_tbd05-mestyp.
        gs_alvout_detail-rcvsystem = gs_tbd05-rcvsystem.
        gs_alvout_detail-fobjtype = gs_tbd05-fobjtype.
        gs_alvout_detail-fobjvalue = gs_tbd05-fobjvalue.
        APPEND gs_alvout_detail TO gt_alvout_detail.
        CLEAR gs_alvout_detail.
       ENDLOOP.
       READ TABLE gt_tbdba INTO gs_tbdba WITH KEY mestype = gs_edp13-mestyp BINARY SEARCH.
       IF sy-subrc eq 0.
         LOOP AT gt_tbd06 INTO gs_tbd06 WHERE bobjtype = gs_tbdba-objecttype
                                          AND method  = gs_tbdba-method
                                          AND rcvsystem = gs_edp13-rcvprn.
           gs_alvout_detail-custmodel = gs_tbd06-custmodel.
           gs_alvout_detail-sndsystem = gs_tbd06-sndsystem.
           gs_alvout_detail-mestyp = gs_edp13-mestyp.
           gs_alvout_detail-rcvsystem = gs_tbd06-rcvsystem.
           gs_alvout_detail-fobjtype = gs_tbd06-fobjtype.
           gs_alvout_detail-fobjvalue = gs_tbd06-fobjvalue.
           APPEND gs_alvout_detail TO gt_alvout_detail.
           CLEAR gs_alvout_detail.
        ENDLOOP.
       ENDIF.
     ENDAT.
ENDLOOP.
ENDFORM.                    " PROCESS_OUTB_DATA
*&---------------------------------------------------------------------*
*&      Form  DISPALY_ALV
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM dispaly_alv .
   IF gt_alvout IS NOT INITIAL.
     CALL SCREEN 9000.
   ELSE.
     MESSAGE text-m01 TYPE 'S'.
   ENDIF.
ENDFORM.                    " DISPALY_ALV
*&---------------------------------------------------------------------*
*&      Module  STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
   SET PF-STATUS 'IDOCDB'.
   SET TITLEBAR 'IDOCDB'.
   IF lcl_container IS INITIAL .
     PERFORM create_objects.
     PERFORM field_catalog.
     PERFORM alv_layout.
     PERFORM alv_display.
   ENDIF.
ENDMODULE.                 " STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*&      Form  CREATE_OBJECTS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM create_objects .
   CREATE OBJECT lcl_container
     EXPORTING
*      parent                      =
       container_name              = 'GC_IDOCDB'
*      style                       =
*      lifetime                    = lifetime_default
*      repid                       =
*      dynnr                       =
*      no_autodef_progid_dynnr     =
     EXCEPTIONS
       cntl_error                  = 1
       cntl_system_error           = 2
       create_error                = 3
       lifetime_error              = 4
       lifetime_dynpro_dynpro_link = 5
       OTHERS                      = 6.
   IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.
   CREATE OBJECT lcl_grid_display
     EXPORTING
*      i_shellstyle      = 0
*      i_lifetime        =
       i_parent          = lcl_container
*      i_appl_events     = space
*      i_parentdbg       =
*      i_applogparent    =
*      i_graphicsparent  =
*      i_name            =
*      i_fcat_complete   = space
     EXCEPTIONS
       error_cntl_create = 1
       error_cntl_init   = 2
       error_cntl_link   = 3
       error_dp_create   = 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.
ENDFORM.                    " CREATE_OBJECTS
*&---------------------------------------------------------------------*
*&      Form  FIELD_CATALOG
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM field_catalog .  "Key Hotspot Empha hide
IF p_direct = 1.
  PERFORM prepare_catalog USING:
         'EDPP1'   'PARNUM'  'X' 'X' ' ' ' ' ' ' ' ',
         'EDPP1'   'PARTYP'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP13'   'MESTYP'  'X' 'X' ' ' ' ' ' ' ' ',
         'EDP13'   'MESCOD'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP13'   'MESFCT'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP13'   'OUTMOD'  ' ' ' ' ' ' ' ' ' ' ' ',
         'EDP13'   'RCVPOR'  ' ' 'X' 'X' ' ' ' ' ' ',
         'EDIPORT' 'PORTTYP' ' ' ' ' ' ' ' ' ' ' ' ',
         'EDP13'  'IDOCTYP' ' ' 'X' 'X' ' ' ' ' '2',
         'EDP13'  'CIMTYP'  ' ' 'X' 'X' ' ' ' ' '2',
         'EDP13'  'STDMES'  ' ' ' ' ' ' ' ' ' ' '2',
         'TBDA2'  'ACTIVE'  ' ' ' ' ' ' ' ' 'Chg.Pointer'(f10) '2', "Change pointer active
         'EDP13'  'PCKSIZ'  ' ' ' ' ' ' ' ' ' ' ' ',
         'EDP12'  'KAPPL'   ' ' ' ' 'X' ' ' ' ' '3',
         'EDP12'  'KSCHL'   ' ' ' ' 'X' ' ' ' ' '3',
         'T683S'  'KOBED'   ' ' 'X' 'X' ' ' ' ' '3',
         'EDP12'  'AENDE'   ' ' ' ' ' ' ' ' ' ' '3',
         'EDP12'  'EVCODA'  ' ' ' ' 'X' ' ' ' ' '4',
         'TEDE1'  'ROUTID'  ' ' 'X' 'X' ' ' ' ' '4',
         'EDP21'  'EVCODE'      ' ' ' ' ' ' 'X' ' ' ' ', "InB
         'TBD52'  'FUNCNAME'    ' ' ' ' ' ' 'X' ' ' ' ', "InB
         'TBD52'  'MAXRETRIES'  ' ' ' ' ' ' 'X' ' ' ' ', "InB
         'TBDBA'  'OBJECTTYPE'  ' ' ' ' ' ' ' ' ' ' '5',
         'TBDBA'  'METHOD'      ' ' ' ' ' ' ' ' ' ' '5',
         'EDIPOA' 'LOGDES'              ' ' 'X' 'X' ' ' ' '           '1',
         'RFCDES' 'RFCTYPE'             ' ' ' ' ' ' ' ' ' '           '1',
         ' '      'RFC_DESCRIPTION'     ' ' ' ' ' ' ' ' 'Description'(f01) '1',
         ' '      'RFC_SYSTEM_NUMBER'   ' ' ' ' ' ' ' ' 'Sys.No'(f02)      '1',
         ' '      'RFC_SERVER_NAME'     ' ' ' ' ' ' ' ' 'Server name'(f03) '1',
*        ' '      'RFC_LOGON_LANGUAGE'  ' ' ' ' ' ' ' '  ,
         ' '      'RFC_GATEWAY_HOST'    ' ' ' ' ' ' ' ' 'GW_Host'(f07)      '1',
         ' '      'RFC_GATEWAY_SERVICE' ' ' ' ' ' ' ' ' 'GW_Service'(f08)   '1',
         ' '      'RFC_PROGRAM'         ' ' ' ' ' ' ' ' 'Program ID'(f09)   '1',
         ' '      'RFC_LOGON_CLIENT'    ' ' ' ' ' ' ' ' 'Logon Client'(f04) '1',
         ' '      'RFC_LOGON_USER'      ' ' ' ' ' ' ' ' 'Logon User'(f05)   '1',
         ' '      'RFC_PASSWORD_STATUS' ' ' ' ' ' ' ' ' 'Pwd.Status'(f06)   '1'.
ELSEIF p_direct = 2.
  PERFORM prepare_catalog USING:
         'EDPP1'  'PARNUM'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDPP1'  'PARTYP'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP21'  'MESTYP'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP21'  'MESCOD'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP21'  'MESFCT'  'X' ' ' ' ' ' ' ' ' ' ',
         'EDP13'  'OUTMOD'  ' ' ' ' ' ' 'X' ' ' ' ',
         'EDP13'  'RCVPOR'  ' ' 'X' 'X' 'X' ' ' ' ',
         'EDIPOA' 'LOGDES'  ' ' 'X' 'X' 'X' ' ' ' ',
         'EDP13'  'IDOCTYP' ' ' 'X' 'X' 'X' ' ' ' ', "Check this if possible in WE57
         'EDP13'  'CIMTYP'  ' ' 'X' 'X' 'X' ' ' ' ', "Check this if possible in WE57
         'EDP13'  'STDMES'  ' ' ' ' ' ' 'X' ' ' ' ',
         'EDP13'  'PCKSIZ'  ' ' ' ' ' ' 'X' ' ' ' ',
         'EDP12'  'KAPPL'   ' ' ' ' 'X' 'X' ' ' ' ',
         'EDP12'  'KSCHL'   ' ' ' ' 'X' 'X' ' ' ' ',
         'T683S'  'KOBED'   ' ' 'X' 'X' 'X' ' ' ' ',
         'EDP12'  'AENDE'   ' ' ' ' ' ' 'X' ' ' ' ',
         'EDP12'  'EVCODA'  ' ' ' ' 'X' 'X' ' ' ' ',
         'TEDE1'  'ROUTID'  ' ' 'X' 'X' 'X' ' ' ' ',
         'EDP21'  'EVCODE'      ' ' ' ' ' ' ' ' ' ' ' ', "InB
         'TBD52'  'FUNCNAME'    ' ' 'X' 'X' ' ' ' ' ' ', "InB
         'TBD52'  'MAXRETRIES'  ' ' ' ' 'X' ' ' ' ' ' ', "InB
         'TBDBA'  'OBJECTTYPE'  ' ' ' ' 'X' 'X' ' ' ' ',
         'TBDBA'  'METHOD'      ' ' ' ' 'X' 'X' ' ' ' '.
ENDIF.
ENDFORM.                    " FIELD_CATALOG
*&---------------------------------------------------------------------*
*&      Form  ALV_DISPLAY
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM alv_display .
   CREATE OBJECT gt_event_receiver.
   SET HANDLER gt_event_receiver->handle_hotspot_click FOR lcl_grid_display.
  CALL METHOD lcl_grid_display->set_table_for_first_display
   EXPORTING
*   i_buffer_active               =
*   i_bypassing_buffer            =
*   i_consistency_check           =
*   i_structure_name              =
     is_variant                    = ls_variant
     i_save                        = 'A'
*   i_default                     = 'X'
     is_layout                     = ls_layout
*   is_print                      =
*   it_special_groups             =
*   it_toolbar_excluding          = lt_toolbar_excluding
*   it_hyperlink                  =
*   it_alv_graphics               =
*   it_except_qinfo               =
*   ir_salv_adapter               =
   CHANGING
     it_outtab                     = gt_alvout
     it_fieldcatalog               = lt_fieldcat
*   it_sort                       =
*   it_filter                     =
   EXCEPTIONS
     invalid_parameter_combination = 1
     program_error                 = 2
     too_many_lines                = 3
     OTHERS                        = 4.
IF sy-subrc <> 0.
   MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.                    " ALV_DISPLAY
*&---------------------------------------------------------------------*
*&      Form  ALV_LAYOUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM alv_layout .
   ls_variant-report = sy-repid.
   ls_layout-cwidth_opt = 'X'.
   ls_layout-no_rowmark = 'X'.
   ls_layout-no_rowins = 'X'.
*  ls_layout-no_rowmark = 'X'.
   ls_layout-zebra = 'X'.
   ls_layout-col_opt = 'X'.
*  ls_layout-no_keyfix = 'X'.
ENDFORM.                    " ALV_LAYOUT
*&---------------------------------------------------------------------*
*&       Class (Implementation)  gcl_event_receiver
*&---------------------------------------------------------------------*
*        Text
*----------------------------------------------------------------------*
CLASS gcl_event_receiver IMPLEMENTATION.
   METHOD handle_hotspot_click.
     DATA : "lt_rspar_tab  TYPE TABLE OF rsparams,
            "ls_rspar_line TYPE rsparams,
            lv_routine_prog TYPE rs38m-programm.
     CASE e_column_id.
       WHEN 'PARNUM'. "WE20
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         SET PARAMETER ID 'PN1' FIELD gs_alvout-parnum.
         SET PARAMETER ID 'PT1' FIELD gs_alvout-partyp.
         CALL TRANSACTION 'WE20'.       "#EC CI_CALLTA
       WHEN 'RCVPOR'. "WE21
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         "No Parameter ID
         CALL TRANSACTION 'WE21'.       "#EC CI_CALLTA
       WHEN 'LOGDES'. "SM59
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         "Pending
         IF gs_alvout-logdes IS NOT INITIAL.
           SET PARAMETER ID 'RFC' FIELD gs_alvout-logdes.
           CALL TRANSACTION 'SM59' AND SKIP FIRST SCREEN.       "#EC CI_CALLTA
         ENDIF.
       WHEN 'MESTYP'. "Detail screen with Distribution model filters
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         IF gs_alvout-mestyp IS NOT INITIAL.
           SORT gt_alvout_detail BY mestyp.
           READ TABLE gt_alvout_detail INTO gs_alvout_detail WITH KEY mestyp = gs_alvout-mestyp
                                                             BINARY SEARCH.
           IF sy-subrc EQ 0.
             CLEAR gt_alvout_detail_filter[].
             gt_alvout_detail_filter[] = gt_alvout_detail[].
             DELETE gt_alvout_detail_filter WHERE mestyp NE gs_alvout-mestyp.
             DELETE gt_alvout_detail_filter WHERE rcvsystem NE gs_alvout-parnum.
             IF gt_alvout_detail_filter IS NOT INITIAL.
               CALL SCREEN 9001.
             ELSE.
               MESSAGE 'Filter value(s) not found'(002) TYPE 'S'.
             ENDIF.
           ELSE.
             MESSAGE 'Filter value(s) not found'(002) TYPE 'S'.
           ENDIF.
         ENDIF.
       WHEN 'IDOCTYP'. "WE30
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         IF gs_alvout-idoctyp IS NOT INITIAL.
           SET PARAMETER ID 'EDD' FIELD gs_alvout-idoctyp.
           CALL TRANSACTION 'WE30'.       "#EC CI_CALLTA
         ENDIF.
       WHEN 'CIMTYP'.  "WE30
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         IF gs_alvout-cimtyp IS NOT INITIAL.
           SET PARAMETER ID 'EDD' FIELD gs_alvout-cimtyp.
           CALL TRANSACTION 'WE30'.       "#EC CI_CALLTA
         ENDIF.
       WHEN 'ROUTID'. "OutB - SE37 "or workflow
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         IF gs_alvout-routid IS NOT INITIAL.
           SET PARAMETER ID 'LIB' FIELD gs_alvout-routid.
           CALL TRANSACTION 'SE37'.       "#EC CI_CALLTA
         ENDIF.
       WHEN 'FUNCNAME'. "InB - SE37 "or workflow
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         IF gs_alvout-funcname IS NOT INITIAL.
           SET PARAMETER ID 'LIB' FIELD gs_alvout-funcname.
           CALL TRANSACTION 'SE37'.       "#EC CI_CALLTA
         ENDIF.
       WHEN 'KOBED'. "VOFM o/p control routines
         READ TABLE gt_alvout INTO gs_alvout INDEX e_row_id.
         IF gs_alvout-kobed IS NOT INITIAL.
           IF gs_alvout-kobed < '600'.
             CONCATENATE 'LV61B' gs_alvout-kobed INTO lv_routine_prog.
           ELSE.
             CONCATENATE 'RV61B' gs_alvout-kobed INTO lv_routine_prog.
           ENDIF.
           SET PARAMETER ID 'RID' FIELD lv_routine_prog.
           CALL TRANSACTION 'SE38'.       "#EC CI_CALLTA
         ENDIF.
       WHEN OTHERS.
     ENDCASE.
   ENDMETHOD.                    "handle_hotspot_click
ENDCLASS.               "gcl_event_receiver
*&---------------------------------------------------------------------*
*&      Form  PREPARE_CATALOG
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM prepare_catalog  USING    value(lv_ref_table)
                                value(lv_ref_field)
                                value(lv_key)
                                value(lv_hotspot)
                                value(lv_emphasize)
                                value(lv_no_out)
                                lv_coltext
                                value(lv_sp_group).
   ADD 1 TO ls_fieldcat-col_pos.
   ls_fieldcat-fieldname = lv_ref_field.
   ls_fieldcat-tabname = 'GT_ALVOUT'.
   ls_fieldcat-key = lv_key.
   ls_fieldcat-hotspot = lv_hotspot.
   ls_fieldcat-ref_table = lv_ref_table.
   ls_fieldcat-ref_field = lv_ref_field.
   ls_fieldcat-emphasize = lv_emphasize.
   ls_fieldcat-no_out = lv_no_out.
   ls_fieldcat-coltext = lv_coltext.
   ls_fieldcat-sp_group = lv_sp_group.
   APPEND ls_fieldcat TO lt_fieldcat.
   CLEAR ls_fieldcat.
ENDFORM.                    " PREPARE_CATALOG
*&---------------------------------------------------------------------*
*&      Module  EXIT_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE exit_command_9000 INPUT.
CASE sy-ucomm.
   WHEN 'BACK'.
     PERFORM free_objects.
     SET SCREEN '0'.
     LEAVE SCREEN.
   WHEN 'EXIT' OR 'CANCEL'.
     PERFORM free_objects.
     LEAVE PROGRAM.
   WHEN OTHERS.
ENDCASE.
ENDMODULE.                 " EXIT_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*&      Form  FREE_OBJECTS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM free_objects .
   CALL METHOD lcl_grid_display->free
     EXCEPTIONS
       cntl_error        = 1
       cntl_system_error = 2
       OTHERS            = 3.
   IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.
   CALL METHOD lcl_container->free
     EXCEPTIONS
       cntl_error        = 1
       cntl_system_error = 2
       OTHERS            = 3.
   IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.
ENDFORM.                    " FREE_OBJECTS
*&---------------------------------------------------------------------*
*&      Form  FETCH_TBD05_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM fetch_tbd05_data .
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
  IMPORTING
    own_logical_system                   = gv_own_logical_system
  EXCEPTIONS
    own_logical_system_not_defined       = 1
    OTHERS                               = 2
           .
IF sy-subrc <> 0.
* Implement suitable error handling here
ELSE.
   gt_edp13_copy[] = gt_edp13[].
   SORT gt_edp13_copy BY mestyp rcvprn.
   DELETE ADJACENT DUPLICATES FROM gt_edp13_copy COMPARING mestyp rcvprn.
   IF gt_edp13_copy IS NOT INITIAL.
     SELECT custmodel sndsystem mestyp rcvsystem fobjtype fobjvalue
       FROM tbd05 INTO TABLE gt_tbd05
        FOR ALL ENTRIES IN gt_edp13_copy
      WHERE sndsystem = gv_own_logical_system
        AND mestyp = gt_edp13_copy-mestyp
        AND rcvsystem = gt_edp13_copy-rcvprn.
      IF sy-subrc EQ 0.
        DELETE gt_tbd05 WHERE fobjtype IS INITIAL OR fobjvalue IS INITIAL.
      ENDIF.
   ENDIF.
ENDIF.
ENDFORM.                    " FETCH_TBD05_DATA
*&---------------------------------------------------------------------*
*&      Form  FETCH_TBD06_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM fetch_tbd06_data .
CLEAR gt_edp13_copy[].
gt_edp13_copy[] = gt_edp13[].
SORT gt_edp13_copy BY mestyp.
DELETE ADJACENT DUPLICATES FROM gt_edp13_copy COMPARING mestyp.
IF gt_edp13_copy IS NOT INITIAL.
  SELECT mestype objecttype method
    FROM tbdba INTO TABLE gt_tbdba
     FOR ALL ENTRIES IN gt_edp13_copy
   WHERE mestype = gt_edp13_copy-mestyp.
   IF sy-subrc EQ 0.
     SELECT custmodel sndsystem bobjtype method rcvsystem fobjtype fobjvalue
       FROM tbd06 INTO TABLE gt_tbd06
*      FOR ALL ENTRIES IN gt_tbdba
       FOR ALL ENTRIES IN gt_edp13_copy
       WHERE sndsystem = gv_own_logical_system
*        AND BOBJTYPE = gt_tbdba-objecttype
*        AND METHOD = gt_tbdba-method
         AND rcvsystem = gt_edp13_copy-rcvprn.
       IF sy-subrc EQ 0.
         DELETE gt_tbd06 WHERE fobjtype IS INITIAL OR fobjvalue IS INITIAL.
       ENDIF.
   ENDIF.
ENDIF.
ENDFORM.                    " FETCH_TBD06_DATA
*&---------------------------------------------------------------------*
*&      Module  STATUS_9001  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_9001 OUTPUT.
   SET PF-STATUS 'IDOCBD64'.
   SET TITLEBAR 'IDOCBD64'.
   IF lcl_container_detail IS INITIAL .
     PERFORM create_objects_detail.
     PERFORM field_catalog_detail.
   ENDIF.
     PERFORM alv_display_detail.
ENDMODULE.                 " STATUS_9001  OUTPUT
*&---------------------------------------------------------------------*
*&      Form  CREATE_OBJECTS_DETAIL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM create_objects_detail .
   CREATE OBJECT lcl_container_detail
     EXPORTING
*      parent                      =
       container_name              = 'GC_DETAIL'
*      style                       =
*      lifetime                    = lifetime_default
*      repid                       =
*      dynnr                       =
*      no_autodef_progid_dynnr     =
     EXCEPTIONS
       cntl_error                  = 1
       cntl_system_error           = 2
       create_error                = 3
       lifetime_error              = 4
       lifetime_dynpro_dynpro_link = 5
       OTHERS                      = 6.
   IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.
   CREATE OBJECT lcl_grid_display_detail
     EXPORTING
*      i_shellstyle      = 0
*      i_lifetime        =
       i_parent          = lcl_container_detail
*      i_appl_events     = space
*      i_parentdbg       =
*      i_applogparent    =
*      i_graphicsparent  =
*      i_name            =
*      i_fcat_complete   = space
     EXCEPTIONS
       error_cntl_create = 1
       error_cntl_init   = 2
       error_cntl_link   = 3
       error_dp_create   = 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.
ENDFORM.                    " CREATE_OBJECTS_DETAIL
*&---------------------------------------------------------------------*
*&      Form  FIELD_CATALOG_DETAIL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM field_catalog_detail .
  PERFORM prepare_catalog_detail USING:
         'TBD05' 'CUSTMODEL' ' ' ' ' ' ',
         'TBD05' 'SNDSYSTEM' ' ' ' ' ' ',
         'TBD05' 'MESTYP' ' ' ' ' ' ',
         'TBD05' 'RCVSYSTEM' ' ' ' ' ' ',
         'TBD05' 'FOBJTYPE' ' ' ' ' ' ',
         'TBD05' 'FOBJVALUE' ' ' ' ' ' '.
CLEAR lt_sort_detail[].
ls_sort_detail-spos =   '1'.
ls_sort_detail-fieldname = 'FOBJTYPE'.
ls_sort_detail-up = 'X'.
ls_sort_detail-group = 'F'.
APPEND ls_sort_detail TO lt_sort_detail.
CLEAR ls_sort_detail.
ls_sort_detail-spos =   '2'.
ls_sort_detail-fieldname = 'FOBJVALUE'.
ls_sort_detail-up = 'X'.
ls_sort_detail-group = 'F'.
APPEND ls_sort_detail TO lt_sort_detail.
CLEAR ls_sort_detail.
ENDFORM.                    " FIELD_CATALOG_DETAIL
*&---------------------------------------------------------------------*
*&      Form  ALV_DISPLAY_DETAIL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM alv_display_detail .
  CALL METHOD lcl_grid_display_detail->set_table_for_first_display
   EXPORTING
*   i_buffer_active               =
*   i_bypassing_buffer            =
*   i_consistency_check           =
*   i_structure_name              =
     is_variant                    = ls_variant
     i_save                        = 'A'
*   i_default                     = 'X'
     is_layout                     = ls_layout
*   is_print                      =
*   it_special_groups             =
*   it_toolbar_excluding          = lt_toolbar_excluding
*   it_hyperlink                  =
*   it_alv_graphics               =
*   it_except_qinfo               =
*   ir_salv_adapter               =
   CHANGING
     it_outtab                     = gt_alvout_detail_filter
     it_fieldcatalog               = lt_fieldcat_detail
    it_sort                        = lt_sort_detail
*   it_filter                     =
   EXCEPTIONS
     invalid_parameter_combination = 1
     program_error                 = 2
     too_many_lines                = 3
     OTHERS                        = 4.
IF sy-subrc <> 0.
   MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.                    " ALV_DISPLAY_DETAIL
*&---------------------------------------------------------------------*
*&      Form  PREPARE_CATALOG_DETAIL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM prepare_catalog_detail  USING    value(lv_ref_table)
                                       value(lv_ref_field)
                                       value(lv_key)
                                       value(lv_hotspot)
                                       value(lv_emphasize).
   ADD 1 TO ls_fieldcat_detail-col_pos.
   ls_fieldcat_detail-fieldname = lv_ref_field.
   ls_fieldcat_detail-tabname = 'GT_ALVOUT_DETAIL'.
   ls_fieldcat_detail-key = lv_key.
   ls_fieldcat_detail-hotspot = lv_hotspot.
   ls_fieldcat_detail-ref_table = lv_ref_table.
   ls_fieldcat_detail-ref_field = lv_ref_field.
   ls_fieldcat_detail-emphasize = lv_emphasize.
   APPEND ls_fieldcat_detail TO lt_fieldcat_detail.
   CLEAR ls_fieldcat_detail.
ENDFORM.                    " PREPARE_CATALOG_DETAIL
*&---------------------------------------------------------------------*
*&      Module  EXIT_COMMAND_9001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE exit_command_9001 INPUT.
CASE sy-ucomm.
   WHEN 'BACK'.
     SET SCREEN 0.
     LEAVE SCREEN.
   WHEN 'EXIT' OR 'CANCEL'.
     LEAVE PROGRAM.
   WHEN OTHERS.
ENDCASE.
ENDMODULE.                 " EXIT_COMMAND_9001  INPUT
*&---------------------------------------------------------------------*
*&      Form  FETCH_DATA_EDP21
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM fetch_data_edp21 .
SELECT sndprn sndprt mestyp mescod mesfct evcode
   FROM edp21
   INTO TABLE gt_edp21
   WHERE sndprn IN s_logsys
     AND mestyp IN s_mestyp
     AND mescod IN s_mescod
     AND mesfct IN s_mesfct.
  IF sy-subrc EQ 0.
    gt_edp21_copy[] = gt_edp21[].
    SORT gt_edp21_copy[] BY evcode.
    DELETE ADJACENT DUPLICATES FROM gt_edp21_copy COMPARING evcode.
    SELECT evcode funcname maxretries FROM tbd52
      INTO TABLE gt_tbd52
       FOR ALL ENTRIES IN gt_edp21_copy
     WHERE evcode = gt_edp21_copy-evcode.
  ENDIF.
ENDFORM.                    " FETCH_DATA_EDP21
*&---------------------------------------------------------------------*
*&      Form  PROCESS_INB_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM process_inb_data .
   SORT gt_tbd52 BY evcode.
LOOP AT gt_edp21 INTO gs_edp21.
   gs_alvout-parnum = gs_edp21-sndprn.
   gs_alvout-partyp = gs_edp21-sndprt .
   gs_alvout-mestyp = gs_edp21-mestyp.
   gs_alvout-mescod = gs_edp21-mescod.
   gs_alvout-mesfct = gs_edp21-mesfct.
*  gs_alvout-idoctyp = gs_edp21-
   gs_alvout-evcode = gs_edp21-evcode.
   READ TABLE gt_tbd52 INTO gs_tbd52 WITH KEY evcode = gs_edp21-evcode BINARY SEARCH.
   IF sy-subrc EQ 0.
     gs_alvout-funcname = gs_tbd52-funcname.
     gs_alvout-maxretries = gs_tbd52-maxretries.
   ENDIF.
   APPEND gs_alvout TO gt_alvout.
   CLEAR gs_alvout.
ENDLOOP.
ENDFORM.                    " PROCESS_INB_DATA

Text Symbols:


001 Input
002 Filter value(s) not found
F01 Description
F02 Sys.No
F03 Server name
F04 Logon Client
F05 Logon User
F06 Pwd.Status
F07 GW_Host
F08 GW_Service
F09 Program ID
F10 Chg.Pointer
M01 No data found

Selection texts:

P_DIRECT Direction for IDoc
S_LOGSYS Logical system
S_MESCOD Message Variant
S_MESFCT Message function
S_MESTYP Message Type

Conclusion:

Working as ALE IDoc Interface developer for quite some time, I believe this report will be helpful to check relevant technical configuration details during post go-live setup and also to monitor existing configuration for support projects.

Please share your comments/feedback/suggestions to make the report better.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply