Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
 *======================================================================*
*======================================================================*
* PROGRAM....: REPORT  ZENHANCEMENT_DETAIL.
*----------------------------------------------------------------------*
* OBJETIVE...: FIND USER-ECITS, BADI'S, FIELD-EXITS, BTE'S AND         *
*              SUBSTITUTIONS IN A SPECIFIED TRANSACTION OR PROGRAM.    *
*              THEY ARE SHOWN IN AN ALV AND A LINK IS CREATED TO THE   *
*              PROGRAM WHERE THE EXTENSION IS FOUND.
*
*----------------------------------------------------------------------*
* PARAMETERS.: P_PROG  = NAME OF THE PROGRAM TO BE CHECKED
*              P_TCODE = TRANSACTION TO BE CHECKED
*              OBS.: ONE OF THESE PARAMETERS MUST BE SPECIFIED
*......................................................................
*
*              P_UE    = CONSIDER USER EXITS.
*              P_BADI  = CONSIDER BADI'S.
*              P_BTE   = CONSIDER BTE.
*              P_SUST  = CONSIDER SUBSTITUTIONS.
*              P_FDEX  = CONSIDER FIELD-EXITS.
*              OBS.: ONE OF THESE PARAMETERS MUST BE SPECIFIED
*......................................................................
*
*              P_INCL  = CONSIDER INCLUDES.
*              P_FUNC  = CONSIDER FUNCIONES.
*              P_SUBMIT= CONSIDER SUBMIT TO PROGAMS.
*......................................................................
*
*              P_NIVEL = DEPTH OF THE TREE.
*
*              OBS.: P_NIVEL SHOULD BE SMALL
*----------------------------------------------------------------------*

REPORT  zenhancement_detail      LINE-SIZE 255
                                 NO STANDARD PAGE HEADING.

TYPE-POOLS:
  icon,
  slis.

TABLES:
  d010inc,                                                  "#EC NEEDED
*dd03l,                                                    "#EC NEEDED
  modact,                                                   "#EC NEEDED
  modsap,                                                   "#EC NEEDED
  sxs_inter,                                                "#EC NEEDED
  sscrfields,                                               "#EC NEEDED
  tddir,                                                    "#EC NEEDED
  tddirs,                                                   "#EC NEEDED
*tftit,                                                    "#EC NEEDED
*trdirt,                                                   "#EC NEEDED
  tstc.                                                     "#EC NEEDED
*tstct.                                                    "#EC NEEDED

*----------------------------------------------------------------------*
* CONSTANTS
*----------------------------------------------------------------------*
CONSTANTS:
*c_sust(22)      TYPE c VALUE 'SUBSTITUTION',              "#EC NEEDED
  c_user_exit(22) TYPE c VALUE 'PERFORM USEREXIT_',         "#EC NEEDED
  c_badi(22)      TYPE c VALUE 'BADI',                      "#EC NEEDED
*c_handler(30)   TYPE c VALUE 'CL_EXITHANDLER=%GT%GET_INSTANCE',
                                                            "#EC NEEDED
  c_method(22)    TYPE c VALUE 'CALL METHOD',               "#EC NEEDED
  c_type_ref(22)  TYPE c VALUE 'TYPE REF TO',               "#EC NEEDED
*c_perform(22)   TYPE c VALUE 'PERFORM',                   "#EC NEEDED
*c_form(22)      TYPE c VALUE 'FORM',                      "#EC NEEDED
*c_endform(22)   TYPE c VALUE 'ENDFORM',                   "#EC NEEDED
  c_bte(22)       TYPE c VALUE 'OPEN_FI_PERFORM',           "#EC NEEDED
  c_bte1(22)      TYPE c VALUE 'OUTBOUND_CALL',             "#EC NEEDED
  c_enhance(22)   TYPE c VALUE 'CALL CUSTOMER-FUNCTION',    "#EC NEEDED
  c_funcao_1(13)  TYPE c VALUE 'CALLFUNCTION''',            "#EC NEEDED
  c_funcao_2(13)  TYPE c VALUE 'CALL FUNCTION',             "#EC NEEDED
  c_enh(11)       TYPE c VALUE 'ENHANCEMENT',               "#EC NEEDED
  c_enh1(17)      TYPE c VALUE 'ENHANCEMENT-POINT',         "#EC NEEDED
  c_enh2(19)      TYPE c VALUE 'ENHANCEMENT-SECTION',       "#EC NEEDED
  c_endenh(14)    TYPE c VALUE 'ENDENHANCEMENT',            "#EC NEEDED
  c_endenh1(23)   TYPE c VALUE 'END-ENHANCEMENT-SECTION',   "#EC NEEDED
  c_include(07)   TYPE c VALUE 'INCLUDE',                   "#EC NEEDED
  c_submit(06)    TYPE c VALUE 'SUBMIT',                    "#EC NEEDED
  c_struct(11)    TYPE c VALUE ' STRUCTURE ',               "#EC NEEDED
  c_comentario    TYPE c VALUE '*',                         "#EC NEEDED
  c_ponto         TYPE c VALUE '.',                         "#EC NEEDED
  c_aspa          TYPE c VALUE '''',                        "#EC NEEDED
*c_igual(3)      TYPE c VALUE ' = ',                       "#EC NEEDED
  c_x             TYPE c VALUE 'X'.                         "#EC NEEDED

CONSTANTS:
  c_ue(4)   TYPE c VALUE 'EXIT',                            "#EC NEEDED
  c_ce(4)   TYPE c VALUE 'CUEX',                            "#EC NEEDED
  c_b(4)    TYPE c VALUE 'BADI',                            "#EC NEEDED
  c_bt(4)   TYPE c VALUE 'BTE',                             "#EC NEEDED
  c_st(4)   TYPE c VALUE 'SUST',                            "#EC NEEDED
  c_fdex(4) TYPE c VALUE 'FDEX',                            "#EC NEEDED
  c_enht(4) TYPE c VALUE 'ENH',                             "#EC NEEDED
  c_operation(4) TYPE c VALUE 'SHOW',                       "#EC NEEDED
  c_type    TYPE euobj-id VALUE 'PROG',
  c_0(1)      TYPE c VALUE '0'.                             "#EC NEEDED

CONSTANTS:
* c_std_definition(3) TYPE c VALUE 'SAP',
  c_std_implmnt(3)    TYPE c VALUE 'KUN'.

*----------------------------------------------------------------------*
* TABLAS INTERNAS
*----------------------------------------------------------------------*


*TYPES: BEGIN OF ty_tadir,                                   "#EC NEEDED
*          obj_name TYPE sobj_name,
*          devclass TYPE devclass,
*       END OF ty_tadir.

TYPES: BEGIN OF ty_slog,                                    "#EC NEEDED
          obj_name TYPE sobj_name,
       END OF ty_slog.

TYPES: BEGIN OF ty_programa,                                "#EC NEEDED
        cf(500) TYPE c,
      END OF ty_programa.

DATA: t_programa TYPE STANDARD TABLE OF ty_programa WITH HEADER LINE,
      wa_programa TYPE ty_programa.

TYPES: BEGIN OF ty_includes,                                "#EC NEEDED
        nome     TYPE sy-repid,
        nivel(2) TYPE n,
      END   OF ty_includes.

DATA: t_includes TYPE STANDARD TABLE OF ty_includes WITH HEADER LINE,
      wa_includes TYPE ty_includes.

TYPES: BEGIN OF tp_user_exit,                               "#EC NEEDED
        programa  TYPE sy-repid,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
        break     TYPE icon_d,
        sel(1)    TYPE c,
      END   OF tp_user_exit.

DATA: BEGIN OF t_user_exit OCCURS 0,                        "#EC NEEDED
*        programa  LIKE sy-repid,
        programa(40) TYPE c,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
*        sel(1)    TYPE C,
      END   OF t_user_exit.

DATA: BEGIN OF t_cust_exit OCCURS 0,                        "#EC NEEDED
        programa(40) TYPE c,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
        sel(1)    TYPE c,
      END   OF t_cust_exit.

DATA: wa_user_exit TYPE tp_user_exit.

TYPES: BEGIN OF tp_badi,                                    "#EC NEEDED
        programa  TYPE sy-repid,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
        sel(1)    TYPE c,
      END   OF tp_badi.


DATA: BEGIN OF t_badi OCCURS 0,                             "#EC NEEDED
        programa(40) TYPE c,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
*        sel(1)    TYPE C,
      END   OF t_badi.


* DATA: t_badi TYPE STANDARD TABLE OF ty_badi,
DATA: wa_badi TYPE tp_badi.

TYPES: BEGIN OF tp_bte,                                     "#EC NEEDED
        programa  TYPE sy-repid,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
        sel(1)    TYPE c,
      END   OF tp_bte.

DATA: BEGIN OF t_bte OCCURS 0,                              "#EC NEEDED
        programa  TYPE sy-repid,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
        sel(1)    TYPE c,
      END   OF t_bte.


* DATA: t_bte TYPE STANDARD TABLE OF ty_bte,
DATA: wa_bte TYPE tp_bte.

TYPES: BEGIN OF tp_enh,                                     "#EC NEEDED
        programa  TYPE sy-repid,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
        sel(1)    TYPE c,
      END   OF tp_enh.

DATA: BEGIN OF t_enh OCCURS 0,                              "#EC NEEDED
        programa  TYPE sy-repid,
        tipo(4)   TYPE c,
        linea(10) TYPE n,
        cf(500)   TYPE c,
        nivel(2)  TYPE n,
*        break     TYPE ICON_D,
        sel(1)    TYPE c,
      END   OF t_enh.

* DATA: t_enh TYPE STANDARD TABLE OF ty_enh,
DATA: wa_enh TYPE tp_enh.


*TYPES: BEGIN OF tp_enhobJ,                                  "#EC NEEDED
*        enhname  TYPE enhname,
*        version  TYPE R3STATE,
*        obj_type TYPE TROBJTYPE,
*        obj_name TYPE TROBJ_NAME,
*        sel(1)   TYPE C,
*      END   OF tp_enhobj.
*
*DATA: BEGIN OF t_enhobj occurs 0,                           "#EC NEEDED
*        enhname  TYPE enhname,
*        version  TYPE R3STATE,
*        obj_type TYPE TROBJTYPE,
*        obj_name TYPE TROBJ_NAME,
*        sel(1)   TYPE C,
*      END   OF t_enhobj.
*
*
** DATA: t_enhobj TYPE STANDARD TABLE OF ty_enhobJ,
*DATA: wa_enhobj TYPE tp_enhobj.

TYPES: BEGIN OF tp_fdex,                                    "#EC NEEDED
        tipo(4) TYPE c,
        cf(500) TYPE c,
*        sel(1)  TYPE C,
      END   OF tp_fdex.


DATA: BEGIN OF t_fdex OCCURS 0,                             "#EC NEEDED
        tipo(4) TYPE c,
        cf(500) TYPE c,
*        sel(1)  TYPE C,
      END   OF t_fdex.

* DATA: t_fdex TYPE STANDARD TABLE OF ty_fdex with header line,
DATA: wa_fdex TYPE tp_fdex.

*TYPES: BEGIN OF tp_final,                                   "#EC NEEDED
*          name     TYPE SMODNAME,
*          member   TYPE MODMEMBER,
*          include  TYPE PROGNAME,
*          stext    TYPE RS38L_FTXT,
*          programa TYPE PROGNAME,
*          sel(1) type c,
*      END OF tp_final.
*
*DATA: BEGIN OF t_final OCCURS 0, "#EC NEEDED
*          name     LIKE modsap-name,
*          member   LIKE modsap-member,
*          include  LIKE rs38l-include, "(15), "Include name
*          stext    LIKE tftit-stext,
*          programa LIKE rs38l-include,
*          sel(1) type c,
*      END OF t_final.


*DATA: BEGIN OF t_final occurs 0,                           "#EC NEEDED
*          name     TYPE SMODNAME,
*          member   TYPE MODMEMBER,
*          include  TYPE PROGNAME,
*          stext    TYPE RS38L_FTXT,
*          programa TYPE PROGNAME,
*          sel(1) type c,
*      END OF t_final.

* DATA: t_final TYPE STANDARD TABLE OF ty_final,
*DATA: wa_final TYPE tp_final.

*DATA:
*  ty_tadir TYPE STANDARD TABLE OF ty_tadir,     "#EC NEEDED
*  wa_tadir type ty_tadir,                       "#EC NEEDED
*  ty_jtab  TYPE STANDARD TABLE OF ty_slog,      "#EC NEEDED
*  wa_itab type ty_slog.


TYPES: BEGIN OF ty_sust,                                    "#EC NEEDED
          substid   TYPE subst_id,
          subseqnr  TYPE subseqnr,
          conseqnr  TYPE seqnr2,
          substab   TYPE substab,
          subsfield TYPE subsfield,
          subsval   TYPE subsval,
          exitsubst TYPE exitsubst,
*          sel(1)    TYPE C,
      END OF ty_sust.

DATA: t_sust TYPE STANDARD TABLE OF ty_sust,
      wa_sust TYPE ty_sust.


TYPES: BEGIN OF ty_val,                                     "#EC NEEDED
          valid    TYPE valid,
          valseqnr TYPE valseqnr,
          condid   TYPE cond_id,
          checkid  TYPE check_id,
*          sel(1)   TYPE C,
      END OF ty_val.

DATA: t_val TYPE STANDARD TABLE OF ty_val,
      wa_val TYPE ty_val.


TYPES : BEGIN OF ty_bdcdata.                                "#EC NEEDED
INCLUDE TYPE bdcdata.
TYPES : END OF ty_bdcdata.

DATA: t_bdcdata TYPE STANDARD TABLE OF ty_bdcdata,          "#EC NEEDED
      wa_bdcdata TYPE ty_bdcdata.

DATA: t_gb31t TYPE STANDARD TABLE OF gb31t.                 "#EC NEEDED

*TYPES: BEGIN OF ty_cimp,                                    "#EC NEEDED
*        enhname    TYPE ENHNAME,
*        obj_type   TYPE TROBJTYPE,
*        obj_name   TYPE TROBJ_NAME,
*        elemusage  TYPE ENHELEMUSAGE,
*        enhinclude(40) TYPE C,
*      END   OF ty_cimp.
*
*DATA: t_cimp TYPE STANDARD TABLE OF ty_cimp,                "#EC NEEDED
*      wa_cimp TYPE ty_cimp.



*----------------------------------------------------------------------*
* VARIABLE GLOBALES
*----------------------------------------------------------------------*
DATA:
  v_functxt      TYPE smp_dyntxt,                           "#EC NEEDED
  v_tini         TYPE systtimlo,
  v_caracter     TYPE c,
  v_palavra(50)  TYPE c,
  v_inicial      TYPE sy-index,
  v_conta_aspa   TYPE n,
  v_pname        TYPE   tfdir-pname,
  v_texto(50)    TYPE c,
  v_contador     TYPE sy-tfill,
  v_nivel(2)     TYPE n,
  v_ini_contagem TYPE c, " INDICA QUE DEBE SER INICIADO EL CONTADOR
  v_conta_espaco TYPE n. " TOTAL DE ESPACIOS ( MÁXIMO 2 )

*----------------------------------------------------------------------*
* DEFINICION DE Estructuras y tablas para ALV (FM).
*----------------------------------------------------------------------*
DATA:
*  wa_tstc    TYPE tstc,
  wa_cat     TYPE slis_fieldcat_alv,                        "#EC NEEDED
  ty_cat     TYPE slis_t_fieldcat_alv,                      "#EC NEEDED
  wa_layout  TYPE slis_layout_alv,                          "#EC NEEDED
  ti_header  TYPE slis_t_listheader,                        "#EC NEEDED
  wa_header  TYPE slis_listheader,                          "#EC NEEDED
  wa_events  TYPE slis_alv_event,                           "#EC NEEDED
  ty_events  TYPE slis_t_event,                             "#EC NEEDED
  wa_sort    TYPE slis_sortinfo_alv,                        "#EC NEEDED
  ty_sort    TYPE slis_t_sortinfo_alv,                      "#EC NEEDED
  wa_print   TYPE slis_print_alv.                           "#EC NEEDED

*----------------------------------------------------------------------*
* SELECTION SCREEN
*----------------------------------------------------------------------*
* Block bl01
SELECTION-SCREEN BEGIN OF BLOCK bl01 WITH FRAME TITLE text-001 .

SELECTION-SCREEN: BEGIN OF LINE,
                  COMMENT 1(18) text-004,
                  POSITION 20.
PARAMETERS: p_tcode TYPE tcode.
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,
                  COMMENT 1(15) text-003,
                  POSITION 20.
PARAMETERS: p_prog  TYPE sy-repid.
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN END   OF BLOCK bl01.

* Block bl02
SELECTION-SCREEN BEGIN OF BLOCK bl02
                 WITH FRAME TITLE text-002 .

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_ue AS CHECKBOX.
SELECTION-SCREEN COMMENT (15) text-008 FOR FIELD p_ue.
SELECTION-SCREEN POSITION 40.
PARAMETERS: p_badi AS CHECKBOX.
SELECTION-SCREEN COMMENT (15) text-009 FOR FIELD p_badi.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_custx AS CHECKBOX.
SELECTION-SCREEN: COMMENT (15) text-039 FOR FIELD p_custx.
SELECTION-SCREEN POSITION 40.
PARAMETERS: p_bte AS CHECKBOX.
SELECTION-SCREEN: COMMENT (15) text-010 FOR FIELD p_bte.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_enh AS CHECKBOX.
SELECTION-SCREEN: COMMENT (20) text-015 FOR FIELD p_enh.
SELECTION-SCREEN POSITION 40.
PARAMETERS: p_sust AS CHECKBOX.
SELECTION-SCREEN: COMMENT (15) text-011 FOR FIELD p_sust.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_val AS CHECKBOX.
SELECTION-SCREEN: COMMENT (15) text-014 FOR FIELD p_val.
SELECTION-SCREEN POSITION 40.
PARAMETERS: p_fdex AS CHECKBOX.
SELECTION-SCREEN: COMMENT (15) text-012 FOR FIELD p_fdex.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END   OF BLOCK bl02.

* Block bl03
SELECTION-SCREEN BEGIN OF BLOCK bl03 WITH FRAME TITLE text-033.

SELECTION-SCREEN: BEGIN OF LINE,
                  COMMENT 1(15) text-005,
                  POSITION 20.
PARAMETERS: p_incl AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,
                  COMMENT 1(15) text-006,
                  POSITION 20.
PARAMETERS: p_func AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,
                  COMMENT 1(15) text-007,
                  POSITION 20.
PARAMETERS: p_submit AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,
                  COMMENT 1(15) text-016,
                  POSITION 20.

PARAMETERS: p_class AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN: END OF LINE.

PARAMETERS: p_nivel(2) TYPE n DEFAULT '04'.

SELECTION-SCREEN END   OF BLOCK bl03.

*-----------------------------------------------------------------------
* INITIALIZATION
*-----------------------------------------------------------------------
INITIALIZATION.


*-----------------------------------------------------------------------
* AT SELECTION-SCREEN
*-----------------------------------------------------------------------

AT SELECTION-SCREEN.

  PERFORM validate_data.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prog.

  PERFORM repid_f4.

*----------------------------------------------------------------------*
* INICIO
*----------------------------------------------------------------------*
START-OF-SELECTION.

  PERFORM get_main_include.

* Check for Includes, Function Module calls, Submit programs and Method
* Calls
  PERFORM verify_incl_func_submit_meth.

* Analyse all includes found and look for User-Exits, Customer-Exits,
* BADIs, BTEs and Enhancement-points in those includes
  PERFORM search_exits_badi_bte_enh.

* Search for Validations
  PERFORM search_validations.

* Search for Substitutions
  PERFORM search_sustituciones.

* Search for Field-exits
  PERFORM search_field_exit.

*- GET THE EXIT OF THE TRANSACTION's.
*  PERFORM search_user_exit.

*- GET POINTS ON THE INCREASE.
* PERFORM search_enh.


*----------------------------------------------------------------------*
* FIN
*----------------------------------------------------------------------*
END-OF-SELECTION.
  PERFORM display_enhancements.


*&---------------------------------------------------------------------*
*&      Form  VALIDATE_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM validate_data.

  IF p_nivel IS INITIAL.
    MOVE 1 TO p_nivel.
  ENDIF.

  IF p_prog IS INITIAL AND p_tcode IS INITIAL.
    MESSAGE ID '00' TYPE 'E' NUMBER '398'
    WITH 'Enter a program name or transaction code'(022).
    LEAVE LIST-PROCESSING.
  ENDIF.

  IF NOT p_prog IS INITIAL AND NOT p_tcode IS INITIAL.
    MESSAGE ID '00' TYPE 'E' NUMBER '398'
    WITH 'Enter a program name or transaction code'(022).
    LEAVE LIST-PROCESSING.
  ENDIF.

  IF p_ue IS INITIAL    AND p_badi IS INITIAL AND p_bte IS INITIAL
  AND p_sust IS INITIAL AND p_val IS INITIAL  AND p_fdex IS INITIAL
  AND p_enh  IS INITIAL.
    MESSAGE ID '00' TYPE 'E' NUMBER '398'
    WITH 'Select a type of Enhancement'(023).
    LEAVE LIST-PROCESSING.
  ENDIF.

ENDFORM.                               " VALIDATE_DATA


*&---------------------------------------------------------------------*
*&      Form  asignar_campo_a_catalogo
*&---------------------------------------------------------------------*
*       Asignar campo al catalogo ALV
*----------------------------------------------------------------------*
FORM asignar_campo_a_catalogo TABLES pt_cat STRUCTURE wa_cat"#EC NEEDED
  USING p_fieldname    TYPE slis_fieldcat_alv-fieldname     "#EC NEEDED
        p_key          TYPE slis_fieldcat_alv-key           "#EC NEEDED
        p_col_pos      TYPE slis_fieldcat_alv-col_pos       "#EC NEEDED
        p_fix_column   TYPE slis_fieldcat_alv-fix_column    "#EC NEEDED
        p_hotspot      TYPE slis_fieldcat_alv-hotspot       "#EC NEEDED
        p_do_sum       TYPE slis_fieldcat_alv-do_sum        "#EC NEEDED
        p_input        TYPE slis_fieldcat_alv-input         "#EC NEEDED
        p_checkbox     TYPE slis_fieldcat_alv-checkbox      "#EC NEEDED
        p_no_out       TYPE slis_fieldcat_alv-no_out        "#EC NEEDED
        p_icon         TYPE slis_fieldcat_alv-icon          "#EC NEEDED
        p_reptext_ddic TYPE slis_fieldcat_alv-reptext_ddic. "#EC NEEDED

  STATICS l_col_pos TYPE sy-cucol.

* Assign attributes field in the catalog header ALV
  CLEAR wa_cat.
  READ TABLE pt_cat INTO wa_cat
             WITH KEY fieldname = p_fieldname.

  CHECK sy-subrc EQ 0.

  IF NOT p_reptext_ddic IS INITIAL.
    wa_cat-seltext_l = wa_cat-seltext_m =
    wa_cat-seltext_s = wa_cat-reptext_ddic = p_reptext_ddic.
  ENDIF.

*  IF p_col_pos EQ 'X'.
** Initializes the count to sort the column.
*    l_col_pos = 1.
*  ELSE.
*    ADD 1 TO l_col_pos.
*  ENDIF.

  wa_cat-fieldname     = p_fieldname.
  wa_cat-key           = p_key.
  wa_cat-col_pos       = l_col_pos.
  wa_cat-fix_column    = p_fix_column.
  wa_cat-hotspot       = p_hotspot.
  wa_cat-do_sum        = p_do_sum.
  wa_cat-edit = wa_cat-input = p_input.
  wa_cat-checkbox      = p_checkbox.
  wa_cat-no_out        = p_no_out.
  wa_cat-icon          = p_icon.

  MODIFY pt_cat FROM wa_cat INDEX sy-tabix.

ENDFORM.                    " asignar_campo_a_catalogo

*&---------------------------------------------------------------------*
*&      Form  definir_layout
*&---------------------------------------------------------------------*
*       Definir atributos del layout de reporte
*----------------------------------------------------------------------*
FORM definir_layout USING    p_table  TYPE slis_layout_alv-box_tabname
                    CHANGING p_layout TYPE slis_layout_alv .

  CLEAR p_layout.

  IF p_table NE 'T_CIMP'.
* Framework for selecting the field
    p_layout-box_fieldname         = 'SEL'.
    p_layout-box_tabname           = p_table.
  ENDIF.
  p_layout-zebra                 = 'X'.
  p_layout-colwidth_optimize     = 'X'.
  p_layout-no_vline              = ' '.
  p_layout-no_colhead            = ' '.
  p_layout-lights_condense       = 'X'.
  p_layout-detail_popup          = 'X'.
  p_layout-detail_initial_lines  = 'X'.
  p_layout-flexible_key          = ' '.
  p_layout-key_hotspot           = ' '.
  p_layout-confirmation_prompt   = 'X'.

ENDFORM.                    " definir_layout
*
*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page.                                           "#EC CALLED

  DATA:
    l_tfill_inc(20)  TYPE c,                                "#EC NEEDED
    l_tfill_cant(20) TYPE c.                                "#EC NEEDED

  DESCRIBE TABLE t_includes.
  WRITE sy-tfill TO l_tfill_inc.
  CONDENSE l_tfill_inc NO-GAPS.

  DESCRIBE TABLE t_user_exit.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Build the report header
  PERFORM set_header USING l_tfill_cant
                              l_tfill_inc
                              'User-Exits'.                 "#EC NOTEXT

ENDFORM.                    "top_of_page

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_UEXIT
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_uexit.                                     "#EC CALLED


  DATA:
    l_tfill_inc(20)  TYPE c,                                "#EC NEEDED
    l_tfill_cant(20) TYPE c.                                "#EC NEEDED

  DESCRIBE TABLE t_cust_exit.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Building header report

  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'Customer Exits'.                "#EC NOTEXT

ENDFORM.                    "TOP_OF_PAGE_UEXIT

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_FDEX
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_fdex.                                      "#EC CALLED


  DATA:
    l_tfill_inc(20)  TYPE c,                                "#EC NEEDED
    l_tfill_cant(20) TYPE c.                                "#EC NEEDED

  DESCRIBE TABLE t_fdex.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Building header report
  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'FIELD-EXITs'.                   "#EC NOTEXT

ENDFORM.                    "TOP_OF_PAGE_FDEX

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_BADI
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_badi.                                      "#EC CALLED


  DATA:
    l_tfill_inc(20)  TYPE c,                                "#EC NEEDED
    l_tfill_cant(20) TYPE c.                                "#EC NEEDED

  DESCRIBE TABLE t_includes.
  WRITE sy-tfill TO l_tfill_inc.
  CONDENSE l_tfill_inc NO-GAPS.

  DESCRIBE TABLE t_badi.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Build the report header

  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'BADIs'.                         "#EC NOTEXT

ENDFORM.                    "TOP_OF_PAGE_BADI

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_BTE
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_bte.                                       "#EC CALLED


  DATA:
    l_tfill_inc(20)  TYPE c,                                "#EC NEEDED
    l_tfill_cant(20) TYPE c.                                "#EC NEEDED

  DESCRIBE TABLE t_includes.
  WRITE sy-tfill TO l_tfill_inc.
  CONDENSE l_tfill_inc NO-GAPS.

  DESCRIBE TABLE t_bte.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Building header report
  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'BTEs'.                          "#EC NOTEXT

ENDFORM.                    "TOP_OF_PAGE_BTE

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_ENH
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_enh.                                       "#EC CALLED


  DATA:
    l_tfill_inc(20)  TYPE c,                                "#EC NEEDED
    l_tfill_cant(20) TYPE c.                                "#EC NEEDED

  DESCRIBE TABLE t_includes.
  WRITE sy-tfill TO l_tfill_inc.
  CONDENSE l_tfill_inc NO-GAPS.

  DESCRIBE TABLE t_enh.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Build the report header
  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'Enhancement Point'.             "#EC NOTEXT

ENDFORM.                    "TOP_OF_PAGE_ENH

*&---------------------------------------------------------------------*
*&      Form  sort
*&---------------------------------------------------------------------*
*       Creo el sort del ALV (FM).
*----------------------------------------------------------------------*
*      --%GT%PT_sort     Tabla
*      --%GT%P_tabname   Nombre de la tabla
*----------------------------------------------------------------------*
FORM sort  TABLES   pt_sort
           USING    p_tabname TYPE any.

  CLEAR:  pt_sort, wa_sort.                                 "#EC NEEDED
  REFRESH pt_sort.                                          "#EC NEEDED

  CASE p_tabname.
    WHEN 'T_SUST'.

      wa_sort-fieldname = 'SUBSTID'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

      CLEAR:  pt_sort, wa_sort.

      wa_sort-fieldname = 'SUBSEQNR'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

      CLEAR:  pt_sort, wa_sort.

      wa_sort-fieldname = 'CONSEQNR'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

    WHEN 'T_VAL'.

      wa_sort-fieldname = 'VALID'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

      CLEAR:  pt_sort, wa_sort.

      wa_sort-fieldname = 'VALSEQNR'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

    WHEN 'T_ENHOBJ'.

      wa_sort-fieldname = 'ENHNAME'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

      CLEAR:  pt_sort, wa_sort.

      wa_sort-fieldname = 'VERSION'.
      wa_sort-tabname   = p_tabname.
      wa_sort-up        = 'X'.
      wa_sort-comp      = 'X'.
      APPEND wa_sort TO pt_sort.

    WHEN OTHERS.

      IF p_tabname NE 'T_FINAL'.

        wa_sort-fieldname = 'TIPO'.
        wa_sort-tabname   = p_tabname.
        wa_sort-up        = 'X'.
        wa_sort-comp      = 'X'.
        APPEND wa_sort TO pt_sort.

        CLEAR:  pt_sort, wa_sort.

        IF p_tabname NE 'T_FDEX'.

          wa_sort-fieldname = 'NIVEL'.
          wa_sort-tabname   = p_tabname.
          wa_sort-up        = 'X'.
          wa_sort-comp      = 'X'.
          APPEND wa_sort TO pt_sort.

          CLEAR:  pt_sort, wa_sort.

          wa_sort-fieldname = 'PROGRAMA'.
          wa_sort-tabname   = p_tabname.
          wa_sort-up        = 'X'.
          wa_sort-comp      = 'X'.
          APPEND wa_sort TO pt_sort.

          CLEAR:  pt_sort, wa_sort.

          wa_sort-fieldname = 'LINEA'.
          wa_sort-tabname   = p_tabname.
          wa_sort-up        = 'X'.
          wa_sort-comp      = 'X'.
          APPEND wa_sort TO pt_sort.

        ENDIF.

      ELSE.

        wa_sort-fieldname = 'NAME'.
        wa_sort-tabname   = p_tabname.
        wa_sort-up        = 'X'.
        wa_sort-comp      = 'X'.
        APPEND wa_sort TO pt_sort.

        CLEAR:  pt_sort, wa_sort.

        wa_sort-fieldname = 'MEMBER'.
        wa_sort-tabname   = p_tabname.
        wa_sort-up        = 'X'.
        wa_sort-comp      = 'X'.
        APPEND wa_sort TO pt_sort.
      ENDIF.
  ENDCASE.

ENDFORM.                    " sort


*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
*       Evaluar acciones del usuario
*----------------------------------------------------------------------
FORM user_command USING ucomm   TYPE sy-ucomm               "#EC CALLED
                        sfields TYPE slis_selfield.

*DATA l_break TYPE c.                                      "#EC NEEDED


*  CASE sfields-tabname.
*    WHEN 'T_USER_EXIT'.
*      READ TABLE t_user_exit INDEX sfields-tabindex.
*    WHEN 'T_BADI'.
*      READ TABLE t_badi INDEX sfields-tabindex.
*    WHEN 'T_BTE'.
*      READ TABLE ty_bte INDEX sfields-tabindex.
*    WHEN 'T_ENH'.
*      READ TABLE t_enh INDEX sfields-tabindex.
*    WHEN 'T_ENHOBJ'.
*      READ TABLE t_enhobJ INDEX sfields-tabindex.
*    WHEN 'T_FDEX'.
*      READ TABLE t_fdex INDEX sfields-tabindex.
*    WHEN 'T_FINAL'.
*      READ TABLE t_final INDEX sfields-tabindex.
*    WHEN 'T_SUST'.
*      READ TABLE t_sust INDEX sfields-tabindex.
*    WHEN 'T_VAL'.
*      READ TABLE t_val INDEX sfields-tabindex.
*    WHEN 'T_CIMP'.
*      READ TABLE t_cimp INDEX sfields-tabindex.
*  ENDCASE.


  CASE sfields-tabname.
    WHEN 'T_USER_EXIT'.
      READ TABLE t_user_exit INTO wa_user_exit INDEX sfields-tabindex.
    WHEN 'T_BADI'.
      READ TABLE t_badi INTO wa_badi INDEX sfields-tabindex.
    WHEN 'T_BTE'.
      READ TABLE t_bte INTO wa_bte INDEX sfields-tabindex.
    WHEN 'T_ENH'.
      READ TABLE t_enh INTO wa_enh INDEX sfields-tabindex.
*    WHEN 'T_ENHOBJ'.
*      READ TABLE t_enhobJ into wa_enhobj INDEX sfields-tabindex.
    WHEN 'T_FDEX'.
      READ TABLE t_fdex INTO wa_fdex INDEX sfields-tabindex.
    WHEN 'T_CUST_EXIT'.
      READ TABLE t_cust_exit INTO wa_user_exit INDEX sfields-tabindex.
    WHEN 'T_SUST'.
      READ TABLE t_sust INTO wa_sust INDEX sfields-tabindex.
    WHEN 'T_VAL'.
      READ TABLE t_val INTO wa_val INDEX sfields-tabindex.
*    WHEN 'T_CIMP'.
*      READ TABLE t_cimp into wa_cimp INDEX sfields-tabindex.
  ENDCASE.


* Seleccion option.
  CASE ucomm.
*   DOUBLE CLICK.
    WHEN '&IC1'.

      CHECK NOT sfields-value IS INITIAL.

      CASE sfields-tabname.
        WHEN 'T_USER_EXIT'.
*       USER-EXIT.
          IF wa_user_exit-tipo EQ sfields-value(4).
            SEARCH wa_user_exit-cf FOR c_enhance.
            CHECK sy-subrc EQ 0.
            PERFORM visualizar_exit USING wa_user_exit-programa
                                          wa_user_exit-cf.
          ELSEIF wa_user_exit-cf(60) EQ sfields-value.
            PERFORM visualizar_linea USING wa_user_exit-programa
                                           wa_user_exit-linea.
*            MOVE 'X' TO l_break.
*          ELSEIF wa_user_exit-break EQ sfields-value(4)
*              OR wa_user_exit-break+1(2) EQ sfields-value(2).
*            PERFORM asignar_break USING wa_user_exit-programa
*                                        wa_user_exit-linea
*                                        wa_user_exit-break.
*            MOVE 'X' TO l_break.
          ENDIF.

*        WHEN 'T_FINAL'.
**       USER-EXIT Tx. CMOD.
*          IF wa_final-name EQ sfields-value.
*            CALL FUNCTION 'MOD_SAP_HEAD'
*              EXPORTING
*                mode          = 'SHOM'
*                modname       = wa_final-name
*              EXCEPTIONS
*                attr_enqueued = 1
*                text_enqueued = 2
*                OTHERS        = 3.
*
*            check sy-subrc = 0.
*
*          ELSEIF wa_final-include EQ sfields-value.
*            PERFORM visualizar_linea USING wa_final-programa
*                                           '1'.
**            MOVE 'X' TO l_break.
*          ENDIF.

        WHEN 'T_BADI'.
*       Badi.
          IF wa_badi-tipo EQ sfields-value(4).
            PERFORM visualizar_badi USING wa_badi-cf.
          ELSEIF wa_badi-cf(60) EQ sfields-value.
            PERFORM visualizar_linea USING wa_badi-programa
                                           wa_badi-linea.
*            MOVE 'X' TO l_break.
*          ELSEIF wa_badi-break EQ sfields-value(4)
*              OR wa_badi-break+1(2) EQ sfields-value(2).
*            PERFORM asignar_break USING wa_badi-programa
*                                        wa_badi-linea
*                                        wa_badi-break.
*            MOVE 'X' TO l_break.
          ENDIF.

        WHEN 'T_BTE'.
*       BTE.
          IF wa_bte-tipo EQ sfields-value(4).
            PERFORM fibf USING wa_bte-cf.
          ELSEIF wa_bte-cf(60) EQ sfields-value.
            PERFORM visualizar_linea USING wa_bte-programa
                                           wa_bte-linea.
*            MOVE 'X' TO l_break.
*          ELSEIF wa_bte-break EQ sfields-value(4)
*              OR wa_bte-break+1(2) EQ sfields-value(2).
*            PERFORM asignar_break USING wa_bte-programa
*                                        wa_bte-linea
*                                        wa_bte-break.
*            MOVE 'X' TO l_break.
          ENDIF.

        WHEN 'T_ENH'.
*       Punto de ampliación.
          IF wa_enh-cf(60) EQ sfields-value.
            PERFORM visualizar_linea USING wa_enh-programa
                                           wa_enh-linea.
*            MOVE 'X' TO l_break.
          ELSEIF wa_enh-tipo EQ sfields-value(4).
            PERFORM bi_se18 USING wa_enh-cf.
          ENDIF.

*        WHEN 'T_ENHOBJ'.
**       Punto de ampliación.
*          IF wa_enhobJ-enhname EQ sfields-value(30).
*            PERFORM bi_se19 USING wa_enhobJ-enhname.
*          ENDIF.

        WHEN 'T_SUST'.
*       Sustituciones.
          IF wa_sust-substid  EQ sfields-value(7) OR
             wa_sust-subseqnr EQ sfields-value(3).
            PERFORM visualizar_sust USING wa_sust-substid
                                          wa_sust-subseqnr.
          ENDIF.

        WHEN 'T_VAL'.
*       Validaciones.
          IF wa_val-valid    EQ sfields-value(7) OR
             wa_val-valseqnr EQ sfields-value(3).
            PERFORM visualizar_val USING wa_val-valid
                                         wa_val-valseqnr.
          ENDIF.


        WHEN 'T_FDEX'.
*       Field-exit.
          IF wa_fdex-tipo EQ sfields-value.
            SUBMIT rsmodprf AND RETURN.
          ELSEIF wa_fdex-cf(60) EQ sfields-value.
* Visualizo el field-exit.
            CALL FUNCTION 'RS_FUNCTION_SHOW'
              EXPORTING
                funcname = wa_fdex-cf.

            CALL FUNCTION 'RS_NAVIGATION_MONITOR'.
          ENDIF.

*        WHEN 'T_CIMP'.
**       Customer implementation.
*
*          CASE sfields-fieldname.
*            WHEN 'ENHNAME'.
*              PERFORM bi_se19 USING wa_cimp-enhname.
*            WHEN 'ENHINCLUDE'.
*              PERFORM visualizar_enh_cf USING wa_cimp-enhinclude.
*            WHEN OTHERS.
* DO NOTHING !!!
*          ENDCASE.

        WHEN OTHERS.
* DO NOTHING !!!
      ENDCASE.

    WHEN OTHERS.
*     DO NOTHING !!!
  ENDCASE.

ENDFORM.                    "user_command

*&---------------------------------------------------------------------*
*&      Form  visualizar_linea
*&---------------------------------------------------------------------*
*       Visualizo la linea de código del programa.
*----------------------------------------------------------------------*
FORM visualizar_linea USING p_programa TYPE sy-repid        "#EC CALLED
                            p_linea TYPE any.               "#EC *

* * Displays the selected line in the program..
  CALL FUNCTION 'RS_TOOL_ACCESS'                            "#EC *
    EXPORTING
      operation           = c_operation
      object_name         = p_programa
      object_type         = c_type
      position            = p_linea                         "#EC *
    EXCEPTIONS
      not_executed        = 1
      invalid_object_type = 2
      OTHERS              = 3.

ENDFORM.                    " visualizar_linea



*&---------------------------------------------------------------------*
*&      Form  repid_f4
*&---------------------------------------------------------------------*
*       Ejecuto el F4 para buscar programas.
*----------------------------------------------------------------------*
FORM repid_f4 .

  CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'                 "#EC *
    EXPORTING
      object_type          = c_type "'PROG'
      object_name          = p_prog
      suppress_selection   = c_x "'X'
    IMPORTING
      object_name_selected = p_prog
    EXCEPTIONS
      cancel               = 1
      wrong_type           = 2
      OTHERS               = 3.

ENDFORM.                                                    " repid_f4

*&---------------------------------------------------------------------*
*&      Form  visualizar_badi
*&---------------------------------------------------------------------*
*       Visualizo las definiciones de la BADI.
*-------------------#--------------------------------------------------*
FORM visualizar_badi  USING p_cf TYPE tp_badi-cf.           "#EC CALLED

  DATA:
    l_answer(1),
    l_inter_name TYPE sxs_inter-inter_name,
    l_cf TYPE i.

  DATA: wa_sxs_inter TYPE sxs_inter.

  DATA: BEGIN OF lt_cf OCCURS 0,
          linea(500) TYPE c,
        END OF lt_cf.

  SEARCH p_cf FOR c_type_ref.

  CHECK sy-subrc IS INITIAL.

  REFRESH lt_cf.

  l_cf = 500 - sy-fdpos.

  SPLIT p_cf+sy-fdpos(l_cf) AT space INTO TABLE lt_cf.

  CHECK sy-subrc IS INITIAL.

  READ TABLE lt_cf INDEX 4 TRANSPORTING NO FIELDS.

  TRANSLATE lt_cf-linea TO UPPER CASE.
  TRANSLATE lt_cf-linea USING '. , '.

  MOVE lt_cf-linea TO l_inter_name.

* get the interface from the definition of BADI
  SELECT SINGLE *                                           "#EC *
    INTO wa_sxs_inter
    FROM sxs_inter
    WHERE inter_name EQ l_inter_name.

  CHECK sy-subrc IS INITIAL.

* POP-UP * Sampling for selection if you want to display the definition
* Or the implementation of BADI.
  CALL FUNCTION 'POPUP_WITH_2_BUTTONS_TO_CHOOSE'
    EXPORTING
      defaultoption = '1'
      diagnosetext1 = 'Definition BADI:'                    "#EC NOTEXT
      diagnosetext2 = wa_sxs_inter-exit_name
      diagnosetext3 = '.'
      textline1     = ' '
      textline2     = 'Define a visualizatión:'             "#EC NOTEXT
      textline3     = ' '
      text_option1  = 'Definitión BADI'                     "#EC NOTEXT
      text_option2  = 'Implementatión BADI'                 "#EC NOTEXT
      titel         = 'Seleccion type:'                     "#EC NOTEXT
    IMPORTING
      answer        = l_answer.

  CASE l_answer.
    WHEN '1'.
* Displays the definition of BADI. .
      CALL FUNCTION 'SXO_BADI_SHOW'                         "#EC *
        EXPORTING
          exit_name         = wa_sxs_inter-exit_name
        EXCEPTIONS
          action_canceled   = 1
          access_failure    = 2
          badi_not_exixting = 3
          OTHERS            = 4.

    WHEN '2'.
* View the implementation of BADI.
      CALL FUNCTION 'SXO_IMPL_FOR_BADI_OVER'                "#EC *
        EXPORTING
          exit_name         = wa_sxs_inter-exit_name
        EXCEPTIONS
          no_imps_existing  = 1
          badi_not_existing = 2
          action_canceled   = 3
          OTHERS            = 4.

      IF sy-subrc = 1.
        MESSAGE s380(enhancement) WITH sxs_inter-exit_name.
      ENDIF.

    WHEN OTHERS.
* Do Nothing !!
  ENDCASE.

ENDFORM.                    " visualizar_badi

*&---------------------------------------------------------------------*
*&      Form  visualizar_exit
*&---------------------------------------------------------------------*
*       Visualizo el USER-EXIT.
*----------------------------------------------------------------------*
*      --%GT%P_REPID Nombre del programa.
*      --%GT%P_CF    Linea de código del programa.
*----------------------------------------------------------------------*
FORM visualizar_exit USING p_repid TYPE sy-repid            "#EC CALLED
                           p_cf    TYPE tp_user_exit-cf.

  DATA:
    l_exit        TYPE rs38l-name,
    l_modname     TYPE modact-name,
    l_standard(3) TYPE c,
    l_cf          TYPE i,
    l_linea(500)  TYPE c.

  DATA: BEGIN OF lt_cf OCCURS 0,
          linea(500) TYPE c,
        END OF lt_cf.

  DATA: wa_d010inc TYPE d010inc.
  DATA: wa_modsap TYPE modsap,
        wa_modact TYPE modact.

  CLEAR: d010inc, modsap, modact.


  SELECT SINGLE *                                           "#EC *
    INTO wa_d010inc
    FROM d010inc
    WHERE include EQ p_repid.

  IF sy-subrc NE 0.

    MOVE p_repid TO wa_d010inc-master.
  ENDIF.

  SEARCH p_cf FOR c_enhance.

  CHECK sy-subrc IS INITIAL.

  REFRESH lt_cf.

  l_cf = 500 - sy-fdpos.

  MOVE p_cf+sy-fdpos(l_cf) TO l_linea.

  SPLIT l_linea AT space INTO TABLE lt_cf.

  READ TABLE lt_cf INDEX 3 TRANSPORTING NO FIELDS.

  TRANSLATE lt_cf USING ''' '.
  CONDENSE lt_cf NO-GAPS.


  CONCATENATE 'EXIT' wa_d010inc-master lt_cf INTO l_exit
    SEPARATED BY '_'.


  SELECT SINGLE *                                           "#EC *
    INTO wa_modsap
    FROM modsap
    WHERE member EQ l_exit.

  CHECK sy-subrc IS INITIAL.


  SELECT SINGLE *                                           "#EC *
    INTO wa_modact
    FROM modact
    WHERE member EQ modsap-name.

  IF sy-subrc IS INITIAL.

    MOVE:
      wa_modact-name   TO l_modname,
      c_std_implmnt TO l_standard.

    CALL FUNCTION 'MOD_COMPONENTS'                          "#EC *
      EXPORTING
        mode               = 'SHOM'
        modname            = l_modname
        p_standard         = l_standard
      EXCEPTIONS
        permission_failure = 1
        not_found          = 2
        OTHERS             = 3.

  ELSE.

    MOVE:
      wa_modsap-name      TO l_modname.

    CALL FUNCTION 'MOD_SAP_HEAD'                            "#EC *
      EXPORTING
        mode          = 'SHOM'
        modname       = l_modname
      EXCEPTIONS
        attr_enqueued = 1
        text_enqueued = 2
        OTHERS        = 3.

  ENDIF.

ENDFORM.                    " visualizar_exit

*&---------------------------------------------------------------------*
*&      Form  fibf
*&---------------------------------------------------------------------*
*       Visualizo la BTE.
*----------------------------------------------------------------------*
*      --%GT%P_CF  Código fuente
*----------------------------------------------------------------------*
FORM fibf  USING p_cf TYPE tp_bte-cf.                       "#EC CALLED

  DATA:
    l_fdpos       TYPE sy-fdpos,
    l_cf          TYPE i,
    l_tipo        TYPE c,
    l_linea(500)  TYPE c.

  SEARCH p_cf FOR c_bte.

  IF sy-subrc IS INITIAL.
* 'OPEN_FI_PERFORM'.
    l_fdpos = sy-fdpos + 16.

    l_cf = 500 - l_fdpos.

    MOVE p_cf+l_fdpos(l_cf) TO l_linea.

    MOVE l_linea+9(1) TO l_tipo.

  ELSE.

    SEARCH p_cf FOR c_bte1.

    CHECK sy-subrc IS INITIAL.
* 'OUTBOUND_CALL'.
    l_fdpos = sy-fdpos + 14.

    l_cf = 500 - l_fdpos.

    MOVE p_cf+l_fdpos(l_cf) TO l_linea.

    MOVE l_linea+9(1) TO l_tipo.

  ENDIF.

  IF l_tipo IS NOT INITIAL.

    PERFORM visualizar_bte USING l_tipo
                                 l_linea.

  ELSE.
    CALL TRANSACTION 'FIBF'.
  ENDIF.

ENDFORM.                    " fibf

*&---------------------------------------------------------------------*
*&      Form  asignar_break
*&---------------------------------------------------------------------*
*       Asigno el break a la linea.
*----------------------------------------------------------------------*
*      --%GT%P_PROGRAMA  text
*      --%GT%P_LINEA  text
*      --%GT%P_BREAK  text
*----------------------------------------------------------------------*
FORM asignar_break  USING p_programa TYPE sy-repid          "#EC CALLED
                          p_linea    TYPE tp_bte-linea
                          p_break    TYPE icon-id.          "#EC NEEDED

  TYPES: BEGIN OF showbreakpointstruc.                      "#EC NEEDED
  INCLUDE TYPE breakpoint.                                  "#EC NEEDED
  TYPES:   mainprog TYPE trdir-name,                        "#EC NEEDED
          text(72) TYPE c,
          mark(1)  TYPE c.
  TYPES: END OF showbreakpointstruc.
  DATA: showbreakpointtab TYPE TABLE OF showbreakpointstruc."#EC NEEDED
  DATA: wa_d010inc TYPE d010inc.

  DATA:
    l_tabix   TYPE sy-tabix,                                "#EC NEEDED
    l_line    TYPE breakpoint-line,                         "#EC NEEDED
    l_program TYPE breakpoint-program,                      "#EC NEEDED
    wa_break  TYPE showbreakpointstruc,                     "#EC NEEDED
    lt_break  TYPE TABLE OF showbreakpointstruc.            "#EC NEEDED

* Obtengo todos los breakpoints marcados.
  CALL FUNCTION 'RS_GET_ALL_BREAKPOINTS'
    TABLES
      breakpointtab = lt_break.

  SELECT SINGLE *                                           "#EC *
    INTO wa_d010inc
    FROM d010inc
    WHERE include = p_programa.

  IF sy-subrc IS NOT INITIAL.
    MOVE p_programa TO d010inc-master.
  ENDIF.

  MOVE:
    p_linea    TO l_line,
    p_programa TO l_program.

  READ TABLE lt_break INTO wa_break
                      WITH KEY program = l_program
                               line    = l_line.

  IF sy-subrc IS INITIAL.
* Borro el break.
    CALL FUNCTION 'RS_DELETE_BREAKPOINT'                    "#EC *
      EXPORTING
        index    = p_linea
        mainprog = d010inc-master
        program  = p_programa.
  ELSE.
* Seteo el breakpoint.
    CALL FUNCTION 'RS_SET_BREAKPOINT'                       "#EC *
      EXPORTING
        index        = p_linea
        program      = p_programa
        mainprogram  = d010inc-master
      EXCEPTIONS
        not_executed = 1
        OTHERS       = 2.
  ENDIF.

* Visualizo todos los breakpoint.
  CALL FUNCTION 'RS_SHOW_BREAKPOINTS'                       "#EC *
    EXPORTING
      objektinfp  = '*'
      objekttypp  = 'PG'
      text1p      = ' '
      text2p      = ' '
      text3p      = ' '
    TABLES
      breakpoints = showbreakpointtab.

ENDFORM.                    " asignar_break

*&---------------------------------------------------------------------*
*& Form get_objects
*&---------------------------------------------------------------------*
* Get Objects
*----------------------------------------------------------------------*
*FORM get_objects.
*
*  DATA:
*    l_fname TYPE rs38l-name,                                "#EC NEEDED
*    l_group TYPE rs38l-area,                                "#EC NEEDED
*    l_include TYPE rs38l-include,                           "#EC NEEDED
*    l_namespace TYPE rs38l-namespace,                       "#EC NEEDED
*    l_str_area TYPE rs38l-str_area.                         "#EC NEEDED
*
*  DATA: v_include TYPE rodiobj-iobjnm.
*  DATA: e_t_include TYPE STANDARD TABLE OF abapsource WITH HEADER LINE.
*  DATA: wa_e_t_include TYPE abapsource.
*  DATA:
*    l_line TYPE string,
*    l_tabix TYPE sy-tabix.
*
*
*  SELECT obj_name devclass
*    INTO TABLE ty_tadir
*    FROM tadir
*    WHERE pgmid    = 'R3TR' AND
*          object   = 'PROG' AND
*          obj_name = p_prog.
*
*  IF sy-subrc = 0.
*
************************************************
**MOD-001
************************************************
*    SORT ty_tadir BY obj_name devclass.
************************************************
**MOD-001
************************************************
*    if p_nivel %GT% 01.
*
*      SELECT obj_name
*        INTO TABLE ty_jtab
*        FROM tadir
*        FOR ALL ENTRIES IN ty_tadir
*        WHERE pgmid    = 'R3TR' AND
*              object   = 'SMOD' AND
*              devclass = ty_tadir-devclass.
*
*
*      IF sy-subrc = 0.
*        SORT ty_jtab BY obj_name.
*      ENDIF.
*    ENDIF.
*  ENDIF.
*
**- Get UserExit names
*  LOOP AT ty_jtab into wa_itab.
*
*    SELECT name member
*      INTO (wa_final-name, wa_final-member)
*      FROM modsap
*      WHERE name = wa_itab-obj_name AND
*            typ  = 'E'.
*
*      APPEND wa_final to t_final.
*      CLEAR: wa_final.
*    ENDSELECT.
*  ENDLOOP.
**- Process it_final contents.
*  LOOP AT t_final into wa_final.
*    l_tabix = sy-tabix.
*    CLEAR:
*      l_fname, l_group, l_include, l_namespace, l_str_area.
*
*    l_fname = wa_final-member.
*
*    CALL FUNCTION 'FUNCTION_EXISTS'                         "#EC *
*      EXPORTING
*        funcname           = l_fname
*      IMPORTING
*        group              = l_group
*        include            = l_include
*        namespace          = l_namespace
*        str_area           = l_str_area
*      EXCEPTIONS
*        function_not_exist = 1
*        OTHERS             = 2.
*
*    IF sy-subrc = 0.
*      IF NOT l_include IS INITIAL.
**- Get Source code of include.
*        CLEAR: v_include, e_t_include, e_t_include[].
*        v_include = l_include.
*        CALL FUNCTION 'MU_INCLUDE_GET'
*          EXPORTING
*            i_include   = v_include
*          TABLES
*            e_t_include = e_t_include.
*
*        LOOP AT e_t_include into wa_e_t_include.
*          IF wa_e_t_include-line CS 'INCLUDE'.
*            CLEAR l_line.
*            l_line = wa_e_t_include-line.
*            CONDENSE l_line NO-GAPS.
*            TRANSLATE l_line USING '. '.
*            l_line = l_line+7.
*            wa_final-include  = l_line.
*            wa_final-programa = l_include.
*            if not wa_final-include is initial.
*              MODIFY t_final from wa_final INDEX l_tabix
*                TRANSPORTING include programa.
*            endif.
*          ENDIF.
*        ENDLOOP.
*
*        CLEAR tftit.
*        SELECT SINGLE stext
*          INTO wa_final-stext
*          FROM tftit
*          WHERE spras = sy-langu AND
*                funcname = wa_final-member.
*        if not wa_final-stext is initial.
*          MODIFY t_final from wa_final INDEX l_tabix
*TRANSPORTING stext.
*        endif.
*      ENDIF.
*    ENDIF.
*  ENDLOOP.
*
*ENDFORM.                                         " get_objects

*&---------------------------------------------------------------------*
*&      Form  visualizar_ampliacion
*&---------------------------------------------------------------------*
*       Visualizo la ampliación de un exit.
*----------------------------------------------------------------------*
*FORM visualizar_ampliacion .                                "#EC CALLED
*
*  DATA:
*    l_ret     TYPE c,
*    l_member  TYPE modsap-member,
*    lt_fields TYPE STANDARD TABLE OF SVAL WITH HEADER LINE.
*
*  MOVE:
*    'MODSAP'    TO lt_fields-tabname,
*    'MEMBER'    TO lt_fields-fieldname,
*    'User-Exit'(023) TO lt_fields-fieldtext.
*
*  APPEND lt_fields.
*
*  CALL FUNCTION 'POPUP_GET_VALUES'                          "#EC *
*    EXPORTING
**      popup_title     = 'Ingrese user-exit:'
*       popup_title     = 'Enter user-exit:'(017)
*    IMPORTING
*      returncode      = l_ret
*    TABLES
*      fields          = lt_fields
*    EXCEPTIONS
*      error_in_fields = 1
*      OTHERS          = 2.
*
** Verifico que no haya cancelado.
*  CHECK l_ret NE 'A'.
*
*  READ TABLE lt_fields INDEX 1 TRANSPORTING NO fIELDS.
*
*  CHECK sy-subrc IS INITIAL.
*
*  IF lt_fields-value IS INITIAL.
**   El exit de función & no existe
*    MESSAGE e015(enhancement) WITH lt_fields-value.
*  ELSE.
*    MOVE lt_fields-value TO l_member.
*  ENDIF.
*
*  SELECT SINGLE *                                           "#EC *
*    FROM modsap
*    WHERE member EQ l_member.
*
*  IF sy-subrc IS INITIAL.
*
** Visualizo la ampliación.
*    CALL FUNCTION 'MOD_SAP_HEAD'                            "#EC *
*      EXPORTING
*        mode          = 'SHOM'
*        modname       = modsap-name
*      EXCEPTIONS
*        attr_enqueued = 1
*        text_enqueued = 2
*        OTHERS        = 3.
*
*  ELSE.
**   El exit de función & no existe
*    MESSAGE e015(enhancement) WITH l_member.
*  ENDIF.
*
*ENDFORM.                    " visualizar_ampliacion

*&---------------------------------------------------------------------*
*&      Form  visualizar_bte
*&---------------------------------------------------------------------*
*       Visualizo la BTE.
*----------------------------------------------------------------------*
*      --%GT%P_TIPO   Tipo de BTE
*      --%GT%P_LINEA  Evento o proceso.
*----------------------------------------------------------------------*
FORM visualizar_bte  USING p_tipo  TYPE c                   "#EC CALLED
                           p_linea TYPE any.                "#EC *

*  RANGES:
*    r_event FOR tbe01-event,
*    r_procs FOR tps01-procs.

  DATA: r_event TYPE RANGE OF tbe01-event,
        r_procs TYPE RANGE OF tps01-procs,
        r_event_line LIKE LINE OF r_event,
        r_procs_line LIKE LINE OF r_procs.

  REFRESH: r_event, r_procs.

  CASE p_tipo.
    WHEN 'E'.
* Interface de publicación y suscripción.
*      MOVE:
*        'I'          TO r_event-sign,
*        'EQ'         TO r_event-option,
*        p_linea(8)   TO r_event-low.
*      APPEND r_event.

      r_event_line-sign   = 'I'.
      r_event_line-option = 'BT'.
      r_event_line-low    = 'AA'.
      r_event_line-high   = 'LH'.
      APPEND r_event_line TO r_event.


      SUBMIT rfopfi00
             WITH event IN r_event
             WITH xonlk = ' '
             AND RETURN.
    WHEN 'P'.
* Interface de proceso.
*      MOVE:
*        'I'          TO r_procs-sign,
*        'EQ'         TO r_procs-option,
*        p_linea(8)   TO r_procs-low.
*      APPEND r_procs.

      r_procs_line-sign   = 'I'.
      r_procs_line-option = 'BT'.
      r_procs_line-low    = 'AA'.
      r_procs_line-high   = 'LH'.
      APPEND r_procs_line TO r_procs.


      SUBMIT rfopfi01
             WITH procs IN r_procs
             WITH xonlk = ' '
             AND RETURN.
    WHEN OTHERS.
* Do nothing !!
  ENDCASE.

ENDFORM.                    " visualizar_bte

*&---------------------------------------------------------------------*
*&      Form  cargar_bte
*&---------------------------------------------------------------------*
*       Ingreso la BTE que quiero visualizar.
*----------------------------------------------------------------------*
*      --%GT%P_TIPO   Tipo de BTE
*----------------------------------------------------------------------*
FORM cargar_bte  USING p_tipo TYPE c.                       "#EC CALLED

  DATA:
    l_linea(500)  TYPE c.

  DATA:
    l_ret     TYPE c,
    lt_fields TYPE STANDARD TABLE OF sval, " WITH HEADER LINE.
    wa_lt_fields TYPE sval.

  CASE p_tipo.
    WHEN 'E'.
* Interface de publicación y suscripción.
      MOVE:
        'TBE01' TO wa_lt_fields-tabname,
        'EVENT' TO wa_lt_fields-fieldname.
    WHEN 'P'.
* Interface de proceso.
      MOVE:
        'TPS01' TO wa_lt_fields-tabname,
        'PROCS' TO wa_lt_fields-fieldname.
    WHEN OTHERS.
* Do nothing !!
  ENDCASE.
  APPEND wa_lt_fields TO lt_fields.

  CALL FUNCTION 'POPUP_GET_VALUES'                          "#EC *
    EXPORTING
      popup_title     = 'Enter BTE:'(026)
    IMPORTING
      returncode      = l_ret
    TABLES
      fields          = lt_fields
    EXCEPTIONS
      error_in_fields = 1
      OTHERS          = 2.

* Verifico que no haya cancelado.
  CHECK l_ret NE 'A'.

  READ TABLE lt_fields INTO wa_lt_fields INDEX 1.

  CHECK sy-subrc IS INITIAL.

  MOVE wa_lt_fields-value TO l_linea.

  PERFORM visualizar_bte USING p_tipo
                               l_linea.

ENDFORM.                    " cargar_bte

*&---------------------------------------------------------------------*
*&      Form  visualizar_interface
*&---------------------------------------------------------------------*
*       Visualizo la definición de la BADI que corresponde a la
*       interface.
*----------------------------------------------------------------------*
*FORM visualizar_interface .                                 "#EC CALLED
*
*  DATA:
*    l_linea(500)  TYPE c.
*
*  DATA:
*    l_ret        TYPE c,
*    l_inter_name TYPE sxs_inter-inter_name,
*    lt_fields    TYPE sval OCCURS 0 WITH HEADER LINE.
*
** Interface.
*  MOVE:
*    'SXS_INTER'  TO lt_fields-tabname,
*    'INTER_NAME' TO lt_fields-fieldname.
*  APPEND lt_fields.
*
*  CALL FUNCTION 'POPUP_GET_VALUES'                          "#EC *
*    EXPORTING
*      popup_title     = 'Ingrese interface:'(027)
*    IMPORTING
*      returncode      = l_ret
*    TABLES
*      fields          = lt_fields
*    EXCEPTIONS
*      error_in_fields = 1
*      OTHERS          = 2.
*
** Verifico que no haya cancelado.
*  CHECK l_ret NE 'A'.
*
*  READ TABLE lt_fields INDEX 1.
*
*  CHECK sy-subrc IS INITIAL.
*
*  TRANSLATE lt_fields-value TO UPPER CASE.               "#EC TRANSLANG
*  MOVE lt_fields-value TO l_inter_name.
*
** Obtengo a partir de la interface la definición de la BADI.
*  SELECT SINGLE *                                           "#EC *
*    FROM sxs_inter
*    WHERE inter_name EQ l_inter_name.
*
*  IF sy-subrc IS INITIAL.
** Visualizo la definición de la BADI.
*    CALL FUNCTION 'SXO_BADI_SHOW'                           "#EC *
*      EXPORTING
*        exit_name         = sxs_inter-exit_name
*      EXCEPTIONS
*        action_canceled   = 1
*        access_failure    = 2
*        badi_not_exixting = 3
*        OTHERS            = 4.
*
*  ELSE.
**   El interface & es erróneo.
*    MESSAGE e226(enhancement) WITH l_inter_name.
*  ENDIF.
*
*ENDFORM.                    "visualizar_interface
*
*&---------------------------------------------------------------------*
*&      Form  buscar_sustituciones
*&---------------------------------------------------------------------*
*       Obtengo las sustituciones creadas.
*----------------------------------------------------------------------*
*FORM buscar_sustituciones .
*
*  CHECK p_sust IS NOT INITIAL.
*
*  SELECT *
*    INTO CORRESPONDING FIELDS OF TABLE t_sust
*    FROM gb922.
*
*ENDFORM.                    " buscar_sustituciones

*&---------------------------------------------------------------------*
*&      Form  construir_catalogo_sust
*&---------------------------------------------------------------------*
*       Construir catalogo de campos para ALV.
*----------------------------------------------------------------------*
*FORM construir_catalogo_sust .                              "#EC CALLED
*
*  DATA:
*    l_repid  TYPE sy-repid.
*
*  REFRESH: ty_cat.
*
*  l_repid = sy-repid.
*
*  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
*    EXPORTING
*      i_program_name         = l_repid
*      i_internal_tabname     = 'T_SUST'
*      i_inclname             = l_repid
*    CHANGING
*      ct_fieldcat            = ty_cat
*    EXCEPTIONS
*      inconsistent_interface = 1
*      program_error          = 2
*      OTHERS                 = 3.
*
** Asignar atributos de campo en el catalogo de reporte ALV
*  PERFORM asignar_campo_a_catalogo TABLES ty_cat
*                                   USING:
*
*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
*  'SUBSTID'   'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'SUBSEQNR'  'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'CONSEQNR'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'SUBSTAB'   ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'SUBSFIELD' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'SUBSVAL'   ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'EXITSUBST' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.
*
*ENDFORM.                    " construir_catalogo_sust

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_SUST
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_sust.                                      "#EC CALLED

  DATA:
    l_tfill_inc(20)  TYPE c,
    l_tfill_cant(20) TYPE c.

  DESCRIBE TABLE t_sust.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Construir encabezado del reporte
  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'Sustituciones'(028).

ENDFORM.                    "TOP_OF_PAGE_SUST

*&---------------------------------------------------------------------*
*&      Form  visualizar_sust
*&---------------------------------------------------------------------*
*       Visualizo la sustitución.
*----------------------------------------------------------------------*
*      --%GT%P_SUBSTID  Nombre de la sustitución
*      --%GT%P_SUBSEQNR Número de paso de la sustitución
*----------------------------------------------------------------------*
FORM visualizar_sust  USING p_substid  TYPE gb922-substid   "#EC CALLED
                            p_subseqnr TYPE gb922-subseqnr.

  DATA:
    l_valuser TYPE gb31-valuser,
    l_valeven TYPE gb31-valevent.

  CALL FUNCTION 'G_BOOL_EXIST_SUBSTITUTION'                 "#EC *
    EXPORTING
      substitution = p_substid
    IMPORTING
      valevent_fnd = l_valeven
      valuser_fnd  = l_valuser
    EXCEPTIONS
      not_found    = 1
      OTHERS       = 4.

  CALL FUNCTION 'G_SUBSTITUTION_ENVIRONMENT'                "#EC *
    EXPORTING
      bsubevent         = 'X'
      bsubuser          = 'X'
      subevent          = l_valeven
      substid           = p_substid
      subuser           = l_valuser
      view_only         = 'X'
      action_mode       = 'V'
      skip_first_screen = 'X'
      step              = p_subseqnr
    EXCEPTIONS
      not_found         = 1
      OTHERS            = 2.

ENDFORM.                    " visualizar_sust

*&---------------------------------------------------------------------*
*&      Form  buscar_validaciones
*&---------------------------------------------------------------------*
*       Obtengo las validaciones creadas.
*----------------------------------------------------------------------*
*FORM buscar_validaciones .
*
*  CHECK p_val IS NOT INITIAL.
*
*  SELECT *
*    INTO CORRESPONDING FIELDS OF TABLE t_val
*    FROM gb931.
*
*ENDFORM.                    " buscar_validaciones

*&---------------------------------------------------------------------*
*&      Form  construir_catalogo_val
*&---------------------------------------------------------------------*
*       Construir catalogo de campos para ALV.
*----------------------------------------------------------------------*
*FORM construir_catalogo_val .                               "#EC CALLED
*
*  DATA:
*    l_repid  TYPE sy-repid.
*
*  REFRESH: ty_cat.
*
*  l_repid = sy-repid.
*
*  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
*    EXPORTING
*      i_program_name         = l_repid
*      i_internal_tabname     = 'T_VAL'
*      i_inclname             = l_repid
*    CHANGING
*      ct_fieldcat            = ty_cat
*    EXCEPTIONS
*      inconsistent_interface = 1
*      program_error          = 2
*      OTHERS                 = 3.
*
** Asignar atributos de campo en el catalogo de reporte ALV
*  PERFORM asignar_campo_a_catalogo TABLES ty_cat
*                                   USING:
*
*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
*  'VALID'     'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'VALSEQNR'  'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'CONDID'    ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'CHECKID'   ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.
*
*ENDFORM.                    " construir_catalogo_val

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_VAL
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
FORM top_of_page_val.                                       "#EC CALLED

  DATA:
    l_tfill_inc(20)  TYPE c,
    l_tfill_cant(20) TYPE c.

  DESCRIBE TABLE t_val.
  WRITE sy-tfill TO l_tfill_cant.
  CONDENSE l_tfill_cant NO-GAPS.

* Construir encabezado del reporte
  PERFORM set_header USING l_tfill_cant
                           l_tfill_inc
                           'Validations'(029).

ENDFORM.                    "TOP_OF_PAGE_VAL
*&---------------------------------------------------------------------*
*&      Form  visualizar_val
*&---------------------------------------------------------------------*
*       Visualizo la validación.
*----------------------------------------------------------------------*
*      --%GT%P_VALID    Validación
*      --%GT%P_VALSEQNR Número secuencial de una etapa de validación
*----------------------------------------------------------------------*
FORM visualizar_val  USING p_valid    TYPE gb931-valid      "#EC CALLED
                           p_valseqnr TYPE gb931-valseqnr.

  DATA:
    l_valuser TYPE gb31-valuser,
    l_valeven TYPE gb31-valevent.

  CALL FUNCTION 'G_BOOL_EXIST_VALIDATION'                   "#EC *
    EXPORTING
      validation   = p_valid
    IMPORTING
      valuser_fnd  = l_valuser
      valevent_fnd = l_valeven
    EXCEPTIONS
      not_found    = 1
      null_id      = 2.

  CALL FUNCTION 'G_VALIDATION_ENVIRONMENT'                  "#EC *
    EXPORTING
      action_mode       = 'V'
      skip_first_screen = 'X'
      bvalevent         = 'X'
      bvaluser          = 'X'
      valid             = p_valid
      valuser           = l_valuser
      valevent          = l_valeven
      view_only         = 'X'
      step              = p_valseqnr
    EXCEPTIONS
      not_found         = 1
      OTHERS            = 2.

ENDFORM.                    " visualizar_val

*&---------------------------------------------------------------------*
*&      Form  visualizar_proyecto
*&---------------------------------------------------------------------*
*       Visualizo el proyecto asosiado a una ampliación.
*----------------------------------------------------------------------*
*FORM visualizar_proyecto .                                  "#EC CALLED
*
*  DATA:
*    l_ret     TYPE c,
*    l_name    TYPE modsap-name,
*    l_member  TYPE modact-member,
*    l_modname TYPE modact-name,
*    l_standard(3) TYPE c,
*    lt_fields TYPE sval OCCURS 0 WITH HEADER LINE.
*
*  MOVE:
*    'MODSAP' TO lt_fields-tabname,
*    'NAME'   TO lt_fields-fieldname.
*
*  APPEND lt_fields.
*
*  CALL FUNCTION 'POPUP_GET_VALUES'                          "#EC *
*    EXPORTING
*      popup_title     = 'Enter extension:'(030)
*    IMPORTING
*      returncode      = l_ret
*    TABLES
*      fields          = lt_fields
*    EXCEPTIONS
*      error_in_fields = 1
*      OTHERS          = 2.
*
** Verifico que no haya cancelado.
*  CHECK l_ret NE 'A'.
*
*  READ TABLE lt_fields INDEX 1.
*
*  CHECK sy-subrc IS INITIAL.
*
*  IF lt_fields-value IS INITIAL.
**   La ampliación & no existe
*    MESSAGE e012(enhancement) WITH lt_fields-value.
*  ELSE.
*    MOVE lt_fields-value TO l_name.
*  ENDIF.
*
*  SELECT SINGLE *                                           "#EC *
*    FROM modsap
*    WHERE name EQ l_name.
*
*  IF sy-subrc IS INITIAL.
*
*    MOVE l_name TO l_member.
*
*    SELECT SINGLE *                                         "#EC *
*      FROM modact
*      WHERE member EQ l_member.
*
*    IF sy-subrc IS INITIAL.
** Se encontró el proyecto para la ampliación.
*      MOVE:
*        modact-name   TO l_modname,
*        c_std_implmnt TO l_standard.
*
*      CALL FUNCTION 'MOD_COMPONENTS'                        "#EC *
*        EXPORTING
*          mode               = 'SHOM'
*          modname            = l_modname
*          p_standard         = l_standard
*        EXCEPTIONS
*          permission_failure = 1
*          not_found          = 2
*          OTHERS             = 3.
*    ELSE.
**   Indicar un proyecto de ampliación
*      MESSAGE e398(00)
*        WITH 'La ampliación ' l_name ' no tiene proyecto.'. "#EC *
*
*    ENDIF.
*
*  ELSE.
**   La ampliación & no existe
*    MESSAGE e012(enhancement) WITH lt_fields-value.
*  ENDIF.
*
*ENDFORM.                    " visualizar_proyecto
*
*&---------------------------------------------------------------------*
*&      Form  construir_catalogo_enh
*&---------------------------------------------------------------------*
*       Construir catalogo de campos para ALV.
*----------------------------------------------------------------------*
*FORM construir_catalogo_enh .                               "#EC CALLED
*
*  DATA:
*    l_repid  TYPE sy-repid.
*
*  REFRESH: ty_cat.
*
*  l_repid = sy-repid.
*
*  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
*    EXPORTING
*      i_program_name         = l_repid
*      i_internal_tabname     = 'T_ENH'
*      i_inclname             = l_repid
*    CHANGING
*      ct_fieldcat            = ty_cat
*    EXCEPTIONS
*      inconsistent_interface = 1
*      program_error          = 2
*      OTHERS                 = 3.
*
** Asignar atributos de campo en el catalogo de reporte ALV
*  PERFORM asignar_campo_a_catalogo TABLES ty_cat
*                                   USING:
*
*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
*  'PROGRAMA'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' c_text_01,
*  'TIPO'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' c_text_05,
*  'NIVEL'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' c_text_02,
*  'BREAK'     'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' 'X' c_text_07,
*  'LINEA'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' c_text_03,
*  'CF'        ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' c_text_04.
*
*ENDFORM.                    " construir_catalogo_enh

*&---------------------------------------------------------------------*
*&      Form  buscar_enh
*&---------------------------------------------------------------------*
*       Busco los puntos de ampliación del programa.
*----------------------------------------------------------------------*
*FORM buscar_enh .
*
**  DATA:
**    l_obj_name TYPE enhobj-obj_name.
*
*  DATA: BEGIN OF lt_obj_name OCCURS 0,
*          obj_name TYPE enhobj-obj_name,
*        END OF lt_obj_name.
*
*  CHECK p_enh IS NOT INITIAL.
*
*
*  REFRESH lt_obj_name.
*
*  LOOP AT t_includes.
*    APPEND t_includes-nome TO lt_obj_name.
*  ENDLOOP.
*
*  SELECT enhname version obj_type obj_name
*    INTO CORRESPONDING FIELDS OF TABLE t_enhobJ
*    FROM enhobj
*    FOR ALL ENTRIES IN lt_obj_name
*    WHERE obj_type EQ 'PROG'
*      AND obj_name EQ lt_obj_name-obj_name.
*
*ENDFORM.                    " buscar_enh

*&---------------------------------------------------------------------*
*&      Form  construir_catalogo_enhobj
*&---------------------------------------------------------------------*
*       Construir catalogo de campos para ALV.
*----------------------------------------------------------------------*
*FORM construir_catalogo_enhobj .
*
*  DATA:
*    l_repid  TYPE sy-repid.
*
*  REFRESH: ty_cat.
*
*  l_repid = sy-repid.
*
*  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' "#EC *
*    EXPORTING
*      i_program_name         = l_repid
*      i_internal_tabname     = 't_enhobJ'
*      i_inclname             = l_repid
*    CHANGING
*      ct_fieldcat            = ty_cat
*    EXCEPTIONS
*      inconsistent_interface = 1
*      program_error          = 2
*      OTHERS                 = 3.
*
** Asignar atributos de campo en el catalogo de reporte ALV
*  PERFORM asignar_campo_a_catalogo TABLES ty_cat
*                                   USING:
*
*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
*  'ENHNAME'   'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'VERSION'   'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'OBJ_TYPE'  ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'X' ' ' ' ',
*  'OBJ_NAME'  ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.
*
*ENDFORM.                    " construir_catalogo_enhobj

*&---------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE_ENHOBJ
*&---------------------------------------------------------------------*
*       Mostrar cabecera de página
*----------------------------------------------------------------------
*FORM top_of_page_enhobj.                                    "#EC CALLED
*
*  DATA:
*    l_tfill_inc(20)  TYPE c,
*    l_tfill_cant(20) TYPE c.
*
*  DESCRIBE TABLE t_enhobJ.
*  WRITE sy-tfill TO l_tfill_cant.
*  CONDENSE l_tfill_cant NO-GAPS.
*
** Construir encabezado del reporte
*  PERFORM set_header USING l_tfill_cant
*                           l_tfill_inc
*                           'Enhancement-Object'(031).
*
*ENDFORM.                    "TOP_OF_PAGE_ENHOBJ

*&---------------------------------------------------------------------*
*&      Form  bi_se19
*&---------------------------------------------------------------------*
*       Visualizo el punto de ampliación implementado.
*----------------------------------------------------------------------*
*      --%GT%P_ENHNAME  Punto de ampliación implementado.
*----------------------------------------------------------------------*
FORM bi_se19  USING p_enhname TYPE enhobj-enhname .

* Visualizo la linea seleccionada en el programa.
  CALL FUNCTION 'RS_TOOL_ACCESS'                            "#EC *
    EXPORTING
      operation           = c_operation
      object_name         = p_enhname
      object_type         = 'ENHO'(032)
    EXCEPTIONS
      not_executed        = 1
      invalid_object_type = 2
      OTHERS              = 3.

ENDFORM.                                                    " bi_se19

*&---------------------------------------------------------------------*
*&      Form  BDC_DYNPRO
*&---------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.                       "#EC *

  CLEAR wa_bdcdata.
  wa_bdcdata-program  = program.
  wa_bdcdata-dynpro   = dynpro.
  wa_bdcdata-dynbegin = 'X'.
  APPEND wa_bdcdata TO t_bdcdata.

ENDFORM.                               " BDC_DYNPRO

*&---------------------------------------------------------------------*
*&      Form  BDC_FIELD
*&---------------------------------------------------------------------*
FORM bdc_field USING fnam fval.                             "#EC *

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam = fnam.
  wa_bdcdata-fval = fval.
  APPEND wa_bdcdata TO t_bdcdata.

ENDFORM.                    "BDC_FIELD

*&---------------------------------------------------------------------*
*&      Form  texto_tope
*&---------------------------------------------------------------------*
*       Encabezado que explica la funcionalidad de algunas columnas
*       del reporte.
*----------------------------------------------------------------------*
FORM texto_tope .                                           "#EC CALLED

  STATICS l_flag TYPE c.

  DATA l_tit(65) TYPE c.

  CHECK l_flag IS INITIAL.

  l_flag = 'X'.

  IF p_tcode IS INITIAL.

    CONCATENATE 'Enhancements Found in Transaction/Program:   '(038)
                              p_prog INTO l_tit.
  ELSE.

    CONCATENATE 'Enhancements Found in Transaction/Program:  '(038)
                             p_tcode
                             INTO l_tit.
  ENDIF.


  WRITE:
* Título.
*  /(70)   sy-uline,
*  /1(1)   sy-vline,
   3      l_tit CENTERED COLOR = 1.
*   70(1)  sy-vline,
*  /(70)   sy-uline.

  SKIP.


ENDFORM.                    " texto_tope

*&---------------------------------------------------------------------*
*&      Form  bi_se18
*&---------------------------------------------------------------------*
*       Visualizo la definición del enhancement point.
*&---------------------------------------------------------------------*
FORM bi_se18  USING  p_cf.                                  "#EC *

  DATA:
    l_enhspotname TYPE enhspotname,
    l_off TYPE i,
    l_cf  TYPE i.

*  DATA: BEGIN OF lt_cf OCCURS 0,
*          linea(500) TYPE C,
*        END OF lt_cf.

  TYPES: BEGIN OF ty_cf,
          linea(500) TYPE c,
         END OF ty_cf.

  DATA: t_lt_cf TYPE STANDARD TABLE OF ty_cf INITIAL SIZE 0,
        wa_lt_cf TYPE ty_cf.


  FIND FIRST OCCURRENCE OF ' SPOT ' IN p_cf MATCH OFFSET l_off.

  CHECK l_off IS NOT INITIAL.

  ADD 7 TO l_off.
  l_cf = 500 - l_off.

  SPLIT p_cf+l_off(l_cf) AT space INTO TABLE t_lt_cf.

  CHECK sy-subrc IS INITIAL.

  READ TABLE t_lt_cf INTO wa_lt_cf INDEX 1.

  TRANSLATE wa_lt_cf-linea TO UPPER CASE.
  TRANSLATE wa_lt_cf-linea USING '. , '.

  MOVE wa_lt_cf-linea TO l_enhspotname.

  CALL FUNCTION 'RS_TOOL_ACCESS'                            "#EC *
    EXPORTING
      operation           = c_operation
      object_name         = l_enhspotname
      object_type         = 'ENHS'
    EXCEPTIONS
      not_executed        = 1
      invalid_object_type = 2
      OTHERS              = 3.

ENDFORM.                                                    " bi_se18

*&---------------------------------------------------------------------*
*&      Form  visualizar_fm_exit
*&---------------------------------------------------------------------*
*       Se visualiza el módulo de funciones del user-exit's que
*       contiene al include Z indicado.
*----------------------------------------------------------------------*
*FORM visualizar_fm_exit .
*
*  DATA:
*    l_ret     TYPE c,
*    l_flag    TYPE c,
*    l_name    TYPE trdir-name,
*    lt_fields TYPE sval OCCURS 0 WITH HEADER LINE,
*    lt_tfdir  TYPE tfdir OCCURS 0 WITH HEADER LINE.
*
*  DATA:
*    v_include TYPE rodiobj-iobjnm,
*    l_fname TYPE rs38l-name,
*    l_group TYPE rs38l-area,
*    l_include TYPE rs38l-include,
*    l_namespace TYPE rs38l-namespace,
*    l_str_area TYPE rs38l-str_area,
*    lt_incl TYPE STANDARD TABLE OF abapsource WITH HEADER LINE.
*
*  MOVE:
*    'RS38L'   TO lt_fields-tabname,
*    'INCLUDE' TO lt_fields-fieldname,
*    'Include'(036) TO lt_fields-fieldtext.
*
*  APPEND lt_fields.
*
*  CALL FUNCTION 'POPUP_GET_VALUES' "#EC *
*    EXPORTING
*      popup_title     = 'Ingrese ampliación:'(037)
*    IMPORTING
*      returncode      = l_ret
*    TABLES
*      fields          = lt_fields
*    EXCEPTIONS
*      error_in_fields = 1
*      OTHERS          = 2.
*
** Verifico que no haya cancelado.
*  CHECK l_ret NE 'A'.
*
*  READ TABLE lt_fields INDEX 1.
*
*  CHECK sy-subrc IS INITIAL.
*
*  IF lt_fields-value IS INITIAL OR lt_fields-value(1) NE 'Z'.
**   La ampliación & no existe
*    MESSAGE e012(enhancement) WITH lt_fields-value.
*  ELSE.
*    MOVE lt_fields-value TO l_name.
*  ENDIF.
*
** Obtengo los FM de los exit's.
*  SELECT *
*    INTO TABLE lt_tfdir
*    FROM tfdir
*    WHERE funcname TYPE 'EXIT_%'.
*
*  LOOP AT lt_tfdir.
*
*    CLEAR:
*      l_group, l_include, l_namespace, l_str_area.
*
*    l_fname = lt_tfdir-funcname.
** Obtengo el include del user-exti's.
*    CALL FUNCTION 'FUNCTION_EXISTS' "#EC *
*      EXPORTING
*        funcname           = l_fname
*      IMPORTING
*        group              = l_group
*        include            = l_include
*        namespace          = l_namespace
*        str_area           = l_str_area
*      EXCEPTIONS
*        function_not_exist = 1
*        OTHERS             = 2.
*
*    IF sy-subrc = 0.
*      IF NOT l_include IS INITIAL.
**- Obtengo el código fuente del user-exit's.
*        CLEAR: v_include, lt_incl, lt_incl[].
*        v_include = l_include.
*        CALL FUNCTION 'MU_INCLUDE_GET' "#EC *
*          EXPORTING
*            i_include   = v_include
*          TABLES
*            e_t_include = lt_incl.
*
*        IF lt_incl[] IS NOT INITIAL.
** Verifico si alguna de las líneas contiene el include.
*          FIND FIRST OCCURRENCE OF l_name
*            IN TABLE lt_incl.
*
*          CHECK sy-subrc IS INITIAL.
*
** Visualizo el FM del user-exit.
*          PERFORM visualizar_linea USING l_include
*                                         '01'.
*          l_flag = 'X'.
*          EXIT.
*        ENDIF.
*      ENDIF.
*    ENDIF.
*  ENDLOOP.
*
*  CHECK l_flag IS INITIAL.
*
**   La ampliación & no existe
*  MESSAGE e012(enhancement) WITH lt_fields-value.
*
*ENDFORM.                    " visualizar_fm_exit

*&---------------------------------------------------------------------*
*&      Form  def_text_parameter
*&---------------------------------------------------------------------*
*       Defino los textos de los parámetros de selección.
*----------------------------------------------------------------------*
*FORM def_text_parameter .
*
*  tit1   = 'Parameters:'(001).
*  tit2   = 'Search for: '(002).
*  tit3   = 'Search for: '(002).
*  text1  = 'Program'(003).
*  text2  = 'Transaction Code'(004).
*  text3  = 'Includes'(005).
*  text4  = 'Function Modules'(006).
*  text5  = 'Submit Programs'(007).
*  text7  = 'User-exit'(008).
*  text8  = 'Badi'(009).
*  text9  = 'BTE'(010).
*  text10 = 'Substitution'(011).
*  text11 = 'Field-exit'(012).
**  text12 = 'Class Handler'.
*  text12 = 'Customer-Exit'(039).
*  text13 = 'Validation'(014).
*  text14 = 'Enhancement Point'(015).
*  text15 = 'Class Methods'(016).
*
*
*ENDFORM.                    " def_text_parameter

*&---------------------------------------------------------------------*
*&      Form  def_botones
*&---------------------------------------------------------------------*
*       Defino los textos de las botoneras de la pantalla de selección.
*----------------------------------------------------------------------*
*FORM def_botones .
*
** Agrego el boton de marcar todo en STATUS GUI.
*  v_functxt-icon_id   = icon_select_all.
*  v_functxt-quickinfo = c_text_08.
*  sscrfields-functxt_01 = v_functxt.
*
** Agrego el boton de desmarcar todo en STATUS GUI.
*  v_functxt-icon_id   = icon_deselect_all.
*  v_functxt-quickinfo = c_text_09.
*  sscrfields-functxt_02 = v_functxt.
*
** Agrego el boton de Breakpoint en STATUS GUI.
*  v_functxt-icon_id   = icon_message_critical.
*  v_functxt-quickinfo = c_text_06.
*  v_functxt-icon_text = c_text_06.
*  sscrfields-functxt_03 = v_functxt.
*
*
*ENDFORM.                    " def_botones

*&---------------------------------------------------------------------*
*&      Form  set_header
*&---------------------------------------------------------------------*
*       Creo el encabezado del ALV correspondiente.
*----------------------------------------------------------------------*
FORM set_header  USING p_cant                               "#EC *
                       p_inc                                "#EC *
                       p_text.                              "#EC *

  DATA:
    l_tit(65) TYPE c.

  STATICS l_col TYPE i.

  PERFORM texto_tope.

  IF l_col IS INITIAL OR l_col EQ 7.
    l_col = 3.
  ELSE.
    ADD 1 TO l_col.
  ENDIF.

  FORMAT COLOR = l_col.

  WRITE p_text TO l_tit CENTERED.

*  TRANSLATE l_tit USING ' *'.

  WRITE:
* Título.
*  /(70)   sy-uline,
*  /1(1)   sy-vline,
   3      l_tit.
*   70(1)  sy-vline,
*  /(70)   sy-uline.

  FORMAT COLOR = 2.

  SKIP.

ENDFORM.                    " set_header

*&---------------------------------------------------------------------*
*&      Form  visualizar_imp_enh
*&---------------------------------------------------------------------*
*       Visualizo las implementaciones del cliente de los enhancement
*       de cualquier tipo.
*----------------------------------------------------------------------*
*FORM visualizar_imp_enh .                                   "#EC CALLED
*
*  DATA:
*    l_repid TYPE sy-repid.
*
*  l_repid = sy-repid.
*
*  PERFORM get_imp_enh.
*  PERFORM construir_catalogo_cimp.
*  PERFORM definir_layout  USING    'T_CIMP'
*                          CHANGING wa_layout.
*
*  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'                    "#EC *
*    EXPORTING
*      i_callback_program      = l_repid
*      i_callback_user_command = 'USER_COMMAND'
*      is_layout               = wa_layout
*      it_fieldcat             = ty_cat
*      i_default               = 'X'
*      i_save                  = 'A'
*    TABLES
*      t_outtab                = t_cimp
*    EXCEPTIONS
*      program_error           = 1
*      OTHERS                  = 2.
*
*ENDFORM.                    " visualizar_imp_enh

*&---------------------------------------------------------------------*
*&      Form  construir_catalogo_cimp
*&---------------------------------------------------------------------*
*       Construir catalogo de campos para ALV
*----------------------------------------------------------------------*
FORM construir_catalogo_cimp .                              "#EC CALLED

  DATA:
    l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_CIMP'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

  'ENHNAME'    'X' '1' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
  'OBJ_TYPE'   ' ' '2' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'OBJ_NAME'   ' ' '3' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'ELEMUSAGE'  ' ' '4' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'ENHINCLUDE' ' ' '5' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' '.

ENDFORM.                    " construir_catalogo_cimp

*&---------------------------------------------------------------------*
*&      Form  get_imp_enh
*&---------------------------------------------------------------------*
*       Obtengo las implementaciones creadas.
*----------------------------------------------------------------------*
*FORM get_imp_enh .                                          "#EC CALLED
*
* SELECT enhobj~enhname enhobj~obj_type enhobj~obj_name enhobj~elemusage
*        enhincinx~enhinclude
*   FROM enhobj LEFT OUTER JOIN enhincinx ON
*     enhobj~enhname = enhincinx~enhname
*   INTO TABLE t_cimp
*   WHERE enhobj~enhname LIKE 'Z%' OR
*         enhobj~enhname LIKE 'Y%' AND
*         enhobj~version EQ 'A'.
*
*  SORT t_cimp BY enhname obj_type.
*
*ENDFORM.                    " get_imp_enh

*&---------------------------------------------------------------------*
*&      Form  visualizar_enh_cf
*&---------------------------------------------------------------------*
*       Visualizo el código fuente del enhancement.
*----------------------------------------------------------------------*
FORM visualizar_enh_cf  USING p_enhinclude TYPE any.        "#EC CALLED

  DATA:
  l_changed TYPE s38e-buf_varied,                           "#EC NEEDED
  l_subrc   TYPE sy-subrc,                                  "#EC NEEDED
  lt_source TYPE TABLE OF string.                           "#EC NEEDED

  CHECK p_enhinclude IS NOT INITIAL.

  READ REPORT p_enhinclude INTO lt_source.

  CHECK sy-subrc IS INITIAL.

  CALL FUNCTION 'EDITOR_TABLE'
    EXPORTING
      display = 'X'
      name    = p_enhinclude
    IMPORTING
      changed = l_changed
      subrc   = l_subrc
    TABLES
      content = lt_source.

ENDFORM.                    " visualizar_enh_cf
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Form  GET_MAIN_INCLUDE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM get_main_include.

  DATA: l_tcode  TYPE sy-tcode,
        lwa_tstc TYPE tstc.
  REFRESH t_includes.

  IF NOT p_prog IS INITIAL.

    MOVE: p_prog TO wa_includes-nome,
          c_0    TO wa_includes-nivel.
    APPEND wa_includes TO t_includes.

* Check if program can be read
    READ REPORT t_includes-nome INTO t_programa.

    IF sy-subrc EQ 0.
      REFRESH t_programa.
    ELSE.

      MESSAGE s893(pz)
      WITH 'Program'(003) p_prog 'does not exist'(043).
      LEAVE LIST-PROCESSING.
    ENDIF.

  ELSEIF NOT p_tcode IS INITIAL.

    SELECT SINGLE *
      INTO lwa_tstc
      FROM tstc
      WHERE tcode EQ p_tcode.

    IF sy-subrc EQ 0.

      IF lwa_tstc-pgmna IS NOT INITIAL.
        MOVE: lwa_tstc-pgmna TO wa_includes-nome,
              c_0            TO wa_includes-nivel.
        APPEND wa_includes TO t_includes.
        CLEAR: wa_includes.
      ELSE.
* This is a transaction parameter. Get the transaction
* Associated.
        CALL FUNCTION 'RS_TRANSACTION_SINGLE_GET'
          EXPORTING
            parameter_tcode = p_tcode
          IMPORTING
            tcode           = l_tcode.

* Get the program name
        SELECT SINGLE *
          INTO lwa_tstc
          FROM tstc
          WHERE tcode EQ l_tcode.

        IF sy-subrc EQ 0.
          MOVE: lwa_tstc-pgmna TO wa_includes-nome,
                c_0            TO wa_includes-nivel.
          APPEND wa_includes TO t_includes.
          CLEAR: wa_includes.
        ELSE.
          MESSAGE s893(pz)
          WITH 'Transaction '(042) p_tcode 'does not exist'(043).
        ENDIF.
      ENDIF.
    ELSE.
      MESSAGE s893(pz)
      WITH 'Transaction '(042) p_tcode 'does not exist'(043).
      LEAVE LIST-PROCESSING.
    ENDIF.
  ENDIF.

  GET TIME FIELD v_tini.
ENDFORM.                    " GET_MAIN_INCLUDE
*&---------------------------------------------------------------------*
*&      Form  VERIFY_INCL_FUNC_SUBMIT_METH
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM verify_incl_func_submit_meth .

  CHECK p_ue  IS NOT INITIAL OR p_badi IS NOT INITIAL
     OR p_bte IS NOT INITIAL OR p_enh  IS NOT INITIAL.

  LOOP AT t_includes.

    ADD 1 TO v_contador.
    DESCRIBE TABLE t_includes.

    PERFORM avoid_time_out USING sy-tfill.

    MOVE t_includes-nivel TO v_nivel.
    ADD 1 TO v_nivel.

    REFRESH t_programa.

*   Read each include
    READ REPORT t_includes-nome INTO t_programa.

    LOOP AT t_programa INTO wa_programa.

     check wa_programa-cf+0(1) NE c_comentario.
* Search Includes
      IF p_incl EQ c_x.
        PERFORM get_include.
      ENDIF.

* Search Function Module Calls
      IF p_func EQ c_x.
        PERFORM get_function.
      ENDIF.

* Search Submit Programs
      IF p_submit EQ c_x.
        PERFORM get_submit.
      ENDIF.

* Search Class Methods
      IF p_class EQ c_x.
        PERFORM get_method.
      ENDIF.
      CLEAR wa_programa.
    ENDLOOP.

  ENDLOOP.



ENDFORM.                    " VERIFY_INCL_FUNC_SUBMIT_METH
*&---------------------------------------------------------------------*
*&      Form  SEARCH_EXITS_BADI_BTE_ENH
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_exits_badi_bte_enh .

*- CHECK IF THERE IN SELECT INCLUDES Exits. .
  LOOP AT t_includes.

    DESCRIBE TABLE t_includes.
*   PERFORM evitar_time_out USING sy-tfill.

    PERFORM avoid_time_out USING sy-tfill.


*- CLEAR THE TABLE INSIDE.
    REFRESH t_programa.

*- MAKE READING INCLUDE STORAGE CHART HOUSE
    READ REPORT t_includes-nome INTO t_programa.

    LOOP AT t_programa INTO wa_programa.
      check wa_programa+0(1) NE c_comentario.

      IF p_ue EQ 'X'.
        PERFORM search_exit.
*       PERFORM search_enhancements.
      ENDIF.

      IF p_custx EQ 'X'.
        PERFORM search_customer_exits.
      ENDIF.

      IF p_badi EQ 'X'.
        PERFORM search_badi.
      ENDIF.

      IF p_bte EQ 'X'.
        PERFORM search_bte.
      ENDIF.

      IF p_enh EQ 'X'.
        PERFORM search_enh_point.
      ENDIF.

    ENDLOOP.
  ENDLOOP.


ENDFORM.                    " SEARCH_EXITS_BADI_BTE_ENH
*&---------------------------------------------------------------------*
*&      Form  SEARCH_FIELD_EXIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_field_exit .


  TYPES: BEGIN OF ty_campo,                                 " OCCURS 0,
           repid     TYPE sy-repid,
           dnum      TYPE d020s-dnum,
           tabname   TYPE dd03l-tabname,
           fieldname TYPE dd03l-fieldname,
         END OF ty_campo.

  DATA: lt_campo TYPE STANDARD TABLE OF ty_campo INITIAL SIZE 0,
        wa_lt_campo TYPE ty_campo.

*
*  DATA: BEGIN OF lt_fe OCCURS 0,
*          cf(500) TYPE C,
*        END OF lt_fe.
*
  TYPES: BEGIN OF ty_fe,
           cf(500) TYPE c,
         END OF ty_fe.

  DATA: lt_fe TYPE STANDARD TABLE OF ty_fe INITIAL SIZE 0,
        wa_fe TYPE ty_fe,
        wa_fe1 TYPE ty_fe.


  DATA:
    l_prog   TYPE sy-repid,
*    lt_d020s TYPE d020s OCCURS 0 WITH HEADER LINE,
*    lt_d021s TYPE d021s OCCURS 0 WITH HEADER LINE,
*    lt_dd03l TYPE dd03l OCCURS 0 WITH HEADER LINE.
*
lt_d020s TYPE STANDARD TABLE OF d020s INITIAL SIZE 0,
lt_d021s TYPE STANDARD TABLE OF d021s INITIAL SIZE 0,
lt_dd03l TYPE STANDARD TABLE OF dd03l INITIAL SIZE 0.

  DATA: wa_lt_d020s TYPE d020s,
        wa_lt_d021s TYPE d021s,
        wa_lt_dd03l TYPE dd03l.

  DATA: wa_tddir TYPE tddir,
        wa_tddirs TYPE tddirs.


  CHECK p_fdex IS NOT INITIAL.

  CLEAR: t_fdex, wa_fdex.
  REFRESH: lt_d020s, lt_d021s, lt_dd03l, lt_fe.

  MOVE: c_fdex TO wa_fdex-tipo.
  APPEND wa_fdex TO t_fdex.

  IF p_prog IS NOT INITIAL.
    MOVE p_prog   TO l_prog.
  ELSE.
    MOVE tstc-pgmna TO l_prog.
  ENDIF.

* Get DYNPRO program.
  SELECT *
    FROM d020s
    INTO CORRESPONDING FIELDS OF TABLE lt_d020s
    WHERE prog EQ l_prog.

  LOOP AT lt_d020s INTO wa_lt_d020s.

    DESCRIBE TABLE t_includes.
*   PERFORM evitar_time_out USING sy-tfill.

    PERFORM avoid_time_out USING sy-tfill.

    REFRESH lt_d021s.

* get the fields of DYNPRO

    CALL FUNCTION 'RS_SCRP_GET_SCREEN_INFOS'                "#EC *
      EXPORTING
        dynnr                 = wa_lt_d020s-dnum
        progname              = wa_lt_d020s-prog
      TABLES
        fieldlist             = lt_d021s
      EXCEPTIONS
        dynpro_does_not_exist = 1
        no_field_list         = 2
        cancelled             = 3
        OTHERS                = 4.

* the fields of input / output.
    LOOP AT lt_d021s INTO wa_lt_d021s WHERE ityp = 'C'
                        OR ityp = 'N'
                        OR ityp = 'X'.

      SEARCH wa_lt_d021s-fnam FOR '-'.

      IF sy-subrc IS INITIAL.

        MOVE:
          wa_lt_d020s-prog TO wa_lt_campo-repid,
          wa_lt_d020s-dnum TO wa_lt_campo-dnum.


        SPLIT wa_lt_d021s-fnam AT '-' INTO wa_lt_campo-tabname
                                        wa_lt_campo-fieldname.

        APPEND wa_lt_campo TO lt_campo.

      ENDIF.

    ENDLOOP.
  ENDLOOP.

  CHECK lt_campo[] IS NOT INITIAL.

  SORT lt_campo BY repid dnum tabname fieldname.
  DELETE ADJACENT DUPLICATES FROM lt_campo.

  SELECT *
    FROM dd03l
    INTO CORRESPONDING FIELDS OF TABLE lt_dd03l
    FOR ALL ENTRIES IN lt_campo
    WHERE tabname   EQ lt_campo-tabname
      AND fieldname EQ lt_campo-fieldname.

  SORT lt_dd03l BY rollname.
  DELETE ADJACENT DUPLICATES FROM lt_dd03l.

  LOOP AT lt_dd03l INTO wa_lt_dd03l.

    CLEAR: tddir, tddirs.

    SELECT SINGLE *
      INTO wa_tddir
      FROM tddir
      WHERE de EQ wa_lt_dd03l-rollname.

    CHECK sy-subrc IS INITIAL.

    DESCRIBE TABLE t_includes.
*   PERFORM evitar_time_out USING sy-tfill.

    PERFORM avoid_time_out USING sy-tfill.


    IF wa_tddir-activ EQ 'S'.

      SELECT SINGLE *                                       "#EC *
        INTO wa_tddirs
        FROM tddirs
        WHERE de    EQ wa_lt_dd03l-rollname
          AND prog  EQ wa_lt_d020s-prog.

      CHECK sy-subrc IS INITIAL.

    ENDIF.


    CONCATENATE 'FIELD_EXIT_' wa_lt_dd03l-rollname INTO wa_fe-cf.
    APPEND wa_fe TO lt_fe.

    IF wa_tddirs-exitnr IS NOT INITIAL.
      CONCATENATE wa_user_exit-cf wa_tddirs-exitnr INTO wa_fe-cf
        SEPARATED BY '_'.
      APPEND wa_fe TO lt_fe.
    ENDIF.

    READ TABLE lt_fe INTO wa_fe1
          WITH KEY cf = wa_fe-cf. "transporting no fields.

    CHECK sy-subrc IS NOT INITIAL.

    APPEND wa_fe1 TO lt_fe.
    CLEAR: wa_fe1.
  ENDLOOP.

  LOOP AT lt_fe INTO wa_fe.

    MOVE:
      c_fdex   TO wa_fdex-tipo,
      wa_fe-cf TO wa_fdex-cf.
    APPEND wa_fdex TO t_fdex.

  ENDLOOP.


ENDFORM.                    " SEARCH_FIELD_EXIT
*&---------------------------------------------------------------------*
*&      Form  SEARCH_USER_EXIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
*FORM SEARCH_USER_EXIT .
*
*  IF p_prog IS INITIAL.
*    MOVE wa_tstc-pgmna TO p_prog.
*  ENDIF.
*
*  PERFORM get_objects.     "Get Objects
*
*
*ENDFORM.                    " SEARCH_USER_EXIT
*&---------------------------------------------------------------------*
*&      Form  SEARCH_ENH
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
*FORM SEARCH_ENH .
*
*
*  DATA: BEGIN OF lt_obj_name OCCURS 0,
*          obj_name TYPE enhobj-obj_name,
*        END OF lt_obj_name.
*
*  CHECK p_enh IS NOT INITIAL.
*
*
*  REFRESH lt_obj_name.
*
*  LOOP AT t_includes.
*    APPEND t_includes-nome TO lt_obj_name.
*  ENDLOOP.
*
*  SELECT enhname version obj_type obj_name
*    INTO CORRESPONDING FIELDS OF TABLE t_enhobJ
*    FROM enhobj
*    FOR ALL ENTRIES IN lt_obj_name
*    WHERE obj_type EQ 'PROG'
*      AND obj_name EQ lt_obj_name-obj_name.
*
*
*
*ENDFORM.                    " SEARCH_ENH
*&---------------------------------------------------------------------*
*&      Form  SEARCH_SUSTITUCIONES
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_sustituciones .                                 "#EC CALLED

  CHECK p_sust IS NOT INITIAL.

  SELECT *
    INTO CORRESPONDING FIELDS OF TABLE t_sust
    FROM gb922.


ENDFORM.                    " SEARCH_SUSTITUCIONES
*&---------------------------------------------------------------------*
*&      Form  SEARCH_VALIDATIONS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_validations .                                   "#EC CALLED


  CHECK p_val IS NOT INITIAL.

  SELECT *
    INTO CORRESPONDING FIELDS OF TABLE t_val
    FROM gb931.


ENDFORM.                    " SEARCH_VALIDATIONS
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_ENHANCEMENTS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM display_enhancements.                                  "#EC CALLED

* PERFORM armar_alv.
  PERFORM append_alv.
* PERFORM mostrar_listado.

  PERFORM alv_block_list_display.


ENDFORM.                    " DISPLAY_ENHANCEMENTS
*&---------------------------------------------------------------------*
*&      Form  SEARCH_EXIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_exit .                                          "#EC CALLED


*- CHECK IF THE LINE IS THERE ANY USER OF THE PROGRAM-EXIT.
  SEARCH wa_programa FOR c_user_exit.
*- There was a USER-EXIT AND CHECK IF THE LINE IS NO COMMENT
  IF  sy-subrc EQ 0.
*  AND wa_programa+0(1) NE c_comentario.

**- CHECK THE ENDFORM.
*    SEARCH t_programa-cf FOR c_endform.
*    CHECK sy-subrc NE 0.
*
**- CHECK PERFORM..
*    SEARCH t_programa-cf FOR c_perform.
*    CHECK sy-subrc NE 0.
*
**- CHECK allocations. .
*    SEARCH t_programa-cf FOR c_igual.
*    CHECK sy-subrc NE 0.

    CLEAR wa_user_exit.
*- REMOVE SPACES IN THE START OF THE STRING
    SHIFT wa_programa LEFT DELETING LEADING space.
    MOVE: t_includes-nome  TO wa_user_exit-programa,
          c_ue              TO wa_user_exit-tipo,
          sy-tabix          TO wa_user_exit-linea,
          wa_programa-cf    TO wa_user_exit-cf,
          t_includes-nivel TO wa_user_exit-nivel.
    APPEND wa_user_exit TO t_user_exit.
  ENDIF.


ENDFORM.                    " SEARCH_EXIT
*&---------------------------------------------------------------------*
*&      Form  SEARCH_CUSTOMER_EXITS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_customer_exits.

*- CHECK IS IN THE LINE OF ENHANCEMENT PROGRAM exists somewhere
* SEARCH t_programa-cf FOR c_enhance.

  SEARCH wa_programa FOR c_enhance.

*- We found ENHANCEMENT AND THE LINE IS NOT COMENTADA
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.
    CLEAR wa_user_exit.
*- REMOVE SPACES IN THE BEGINNING OF STRING
    SHIFT wa_programa-cf LEFT DELETING LEADING space.
    MOVE: t_includes-nome  TO wa_user_exit-programa,
          c_ce              TO wa_user_exit-tipo,
          sy-tabix          TO wa_user_exit-linea,
          wa_programa-cf    TO wa_user_exit-cf,
          t_includes-nivel TO wa_user_exit-nivel.
    APPEND wa_user_exit TO t_cust_exit.
  ENDIF.


ENDFORM.                    " SEARCH_CUSTOMER_EXITS
*&---------------------------------------------------------------------*
*&      Form  SEARCH_BADI
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_badi .

  DATA:
    l_subrc TYPE sy-subrc.

*- CHECK IS IN THE LINE OF THE PROGRAM IS THERE ANY BADI.

* SEARCH t_programa-cf FOR c_badi.
  SEARCH wa_programa FOR c_badi.

*- We found a BADI AND CHECK IF THE LINE IS NOT COMENTADA.
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.

    SEARCH wa_programa FOR c_include.
    IF sy-subrc NE 0.
      CLEAR l_subrc.
      SEARCH wa_programa FOR c_method.
      IF sy-subrc NE 0.
*        SEARCH t_programa-cf FOR c_funcao_2.
*        IF sy-subrc NE 0.
*          SEARCH t_programa-cf FOR c_perform.
*          IF sy-subrc NE 0.
*            SEARCH t_programa-cf FOR c_type_ref.
*            IF sy-subrc NE 0.
*              SEARCH t_programa-cf FOR c_form.
        MOVE '4' TO l_subrc.
*            ENDIF.
*          ENDIF.
*        ENDIF.
      ENDIF.

      IF l_subrc EQ 0.
        CLEAR t_badi.
*- REMOVE SPACES IN THE BEGINNING OF STRING.
        SHIFT wa_programa-cf LEFT DELETING LEADING space.
        MOVE: t_includes-nome  TO wa_badi-programa,
              c_b               TO wa_badi-tipo,
              sy-tabix          TO wa_badi-linea,
              wa_programa-cf    TO wa_badi-cf,
              t_includes-nivel TO wa_badi-nivel.
        APPEND wa_badi TO t_badi.
      ENDIF.
    ENDIF.
*  ELSE.
*    CHECK p_handl IS NOT INITIAL.
**- CHECK IS IN THE LINE OF THE PROGRAM IS THERE ANY INSTANCE OF
**- BADI.
*    SEARCH t_programa-cf FOR c_handler.
**- There was an instance of IMPLEMENACIÓN AND CHECK IF THE LINE NO
**- commenting.
*    IF  sy-subrc EQ 0
*    AND t_programa-cf+0(1) NE c_comentario.
*
*      SEARCH t_programa-cf FOR c_include.
*      CHECK sy-subrc NE 0.
*      CLEAR t_badi.
**- REMOVE SPACES IN THE BEGINNING OF STRING..
*      SHIFT t_programa-cf LEFT DELETING LEADING space.
*      MOVE: t_includes-nome  TO t_badi-programa,
*            c_b               TO t_badi-tipo,
*            sy-tabix          TO t_badi-linea,
*            t_programa-cf    TO t_badi-cf,
*            t_includes-nivel TO t_badi-nivel.
*      APPEND t_badi.
*    ENDIF.
  ENDIF.



ENDFORM.                    " SEARCH_BADI
*&---------------------------------------------------------------------*
*&      Form  SEARCH_BTE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_bte .

*- CHECK IS IN THE LINE OF THE PROGRAM IS THERE ANY BTE .
  SEARCH wa_programa FOR c_bte.
* SEARCH t_programa-cf FOR c_bte.

*- We found a BTE AND CHECK IF THE LINE IS NOT COMENTADA
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.
* 'OPEN_FI_PERFORM'.

**- CHECK THE CALL TO BRING TO THE ROLE OF THE BTE.
*    SEARCH t_programa-cf FOR c_funcao_2.
*    CHECK sy-subrc EQ 0.
**- CHECK NOT BRING THE ROLE OF THE GROUP INCLUDE .
*    SEARCH t_programa-cf FOR c_include.
*    CHECK sy-subrc NE 0.
**- CHECK NOT BRING THE ENDFORM
*    SEARCH t_programa-cf FOR c_endform.
*    CHECK sy-subrc NE 0.

    CLEAR t_bte.
*- REMOVE SPACES IN THE BEGINNING OF STRING.
    SHIFT wa_programa-cf LEFT DELETING LEADING space.
    MOVE: t_includes-nome  TO wa_bte-programa,
          c_bt              TO wa_bte-tipo,
          sy-tabix          TO wa_bte-linea,
          wa_programa-cf    TO wa_bte-cf,
          t_includes-nivel TO wa_bte-nivel.
    APPEND wa_bte TO t_bte.
  ENDIF.

*- CHECK IS IN THE LINE OF THE PROGRAM IS THERE ANY BTE.
* SEARCH t_programa-cf FOR c_bte1.
  SEARCH wa_programa FOR c_bte1.

*- We found a BTE AND CHECK IF THE LINE IS NO COMMENT
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.
* 'OUTBOUND_CALL'.

*- CHECK THE CALL TO BRING TO THE ROLE OF THE BTE
*    SEARCH t_programa-cf FOR c_funcao_2.
*    CHECK sy-subrc EQ 0.
*- CHECK NOT BRING THE ROLE OF THE GROUP INCLUDE.
*    SEARCH t_programa-cf FOR c_include.
*    CHECK sy-subrc NE 0.
*- CHECK NOT BRING THE ENDFORM.
*    SEARCH t_programa-cf FOR c_endform.
*    CHECK sy-subrc NE 0.
*
    CLEAR t_bte.
*- REMOVE SPACES IN THE BEGINNING OF STRING
    SHIFT wa_programa-cf LEFT DELETING LEADING space.
    MOVE: t_includes-nome  TO wa_bte-programa,
          c_bt              TO wa_bte-tipo,
          sy-tabix          TO wa_bte-linea,
          wa_programa-cf    TO wa_bte-cf,
          t_includes-nivel TO wa_bte-nivel.
    APPEND wa_bte TO t_bte.
  ENDIF.


ENDFORM.                    " SEARCH_BTE
*&---------------------------------------------------------------------*
*&      Form  SEARCH_ENH_POINT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM search_enh_point .

*- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN PUNTO DE
*- AMPLIACIÓN.
* SEARCH t_programa-cf FOR c_enh1.
  SEARCH wa_programa FOR c_enh1.

*- SE ENCONTRO UN PUNTO DE AMPLIACIÓN Y SE VERIFICA SI LA LINEA NO ESTÁ
*- COMENTADA.
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.

**- VERIFICO QUE NO TRAIGA LOS INCLUDE DEL GRUPO DE FUNCIÓN.
*    SEARCH t_programa-cf FOR c_include.
*    CHECK sy-subrc NE 0.
*- VERIFICO QUE NO TRAIGA LOS ENDENHANCEMENT.
*   SEARCH t_programa-cf FOR c_endenh.
    SEARCH wa_programa FOR c_endenh.

    CHECK sy-subrc NE 0.

*- VERIFICO QUE NO TRAIGA LOS END-ENHANCEMENT-SECTION.
*   SEARCH t_programa-cf FOR c_endenh1.
    SEARCH wa_programa FOR c_endenh1.

    CHECK sy-subrc NE 0.

    CLEAR t_enh.
*- REMUEVE ESPACIOS EN EL INICIO DEL STRING.
    SHIFT wa_programa-cf LEFT DELETING LEADING space.
    MOVE: t_includes-nome  TO wa_enh-programa,
          c_enht            TO wa_enh-tipo,
          sy-tabix          TO wa_enh-linea,
          wa_programa-cf    TO wa_enh-cf,
          t_includes-nivel TO wa_enh-nivel.
    APPEND wa_enh TO t_enh.
  ELSE.

*- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN PUNTO DE
*- AMPLIACIÓN.
*   SEARCH t_programa-cf FOR c_enh2.
    SEARCH wa_programa FOR c_enh2.

*- SE ENCONTRO UN PUNTO DE AMPLIACIÓN Y SE VERIFICA SI LA LINEA NO ESTÁ
*- COMENTADA.
    IF  sy-subrc EQ 0.
*    AND wa_programa-cf+0(1) NE c_comentario.

*- VERIFICO QUE NO TRAIGA LOS ENDENHANCEMENT.
*     SEARCH t_programa-cf FOR c_endenh.
      SEARCH wa_programa FOR c_endenh.

      CHECK sy-subrc NE 0.

*- VERIFICO QUE NO TRAIGA LOS END-ENHANCEMENT-SECTION.
*     SEARCH t_programa-cf FOR c_endenh1.
      SEARCH wa_programa FOR c_endenh1.

      CHECK sy-subrc NE 0.

      CLEAR t_enh.
*- REMUEVE ESPACIOS EN EL INICIO DEL STRING.
      SHIFT wa_programa-cf LEFT DELETING LEADING space.
      MOVE: t_includes-nome  TO wa_enh-programa,
            c_enht            TO wa_enh-tipo,
            sy-tabix          TO wa_enh-linea,
            wa_programa-cf    TO wa_enh-cf,
            t_includes-nivel TO wa_enh-nivel.
      APPEND wa_enh TO t_enh.
    ELSE.

*- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN PUNTO DE
*- AMPLIACIÓN.
*     SEARCH t_programa-cf FOR c_enh.
      SEARCH wa_programa FOR c_enh.

*- SE ENCONTRO UN PUNTO DE AMPLIACIÓN Y SE VERIFICA SI LA LINEA NO ESTÁ
*- COMENTADA.
      IF  sy-subrc EQ 0.
*      AND wa_programa-cf+0(1) NE c_comentario.

*- VERIFICO QUE TRAIGA LOS ENHANCEMENT.
        CHECK wa_programa-cf(11) EQ c_enh.

        CLEAR t_enh.
*- REMUEVE ESPACIOS EN EL INICIO DEL STRING.
        SHIFT wa_programa-cf LEFT DELETING LEADING space.
        MOVE: t_includes-nome  TO wa_enh-programa,
              c_enht            TO wa_enh-tipo,
              sy-tabix          TO wa_enh-linea,
              wa_programa-cf    TO wa_enh-cf,
              t_includes-nivel TO wa_enh-nivel.
        APPEND wa_enh TO t_enh.

      ENDIF.
    ENDIF.
  ENDIF.


ENDFORM.                    " SEARCH_ENH_POINT
*&---------------------------------------------------------------------*
*&      Form  GET_INCLUDE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM get_include .

  data: v_rest(80) type c.

  CLEAR v_palavra.

* Search for the string 'INCLUDE'
  SEARCH wa_programa FOR c_include.

* Do not include comments
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.

*- Omit the line if it is like 'INCLUDE STRUCTURE ... '
    SEARCH wa_programa FOR c_struct.

    IF sy-subrc IS INITIAL.
      EXIT.
    ENDIF.

* CHECK ALL 500 CHARACTERS OF THE LINE TO INCLUDE NAME

*    DO 500 TIMES.
*      v_inicial = sy-index - 1.
*      MOVE wa_programa-cf+v_inicial(1) TO v_caracter.
*      IF NOT v_caracter IS INITIAL.
**- CHECK IF NOT END OF COMMAND.
*        IF v_caracter EQ c_ponto.
*          EXIT.
*        ENDIF.
*
*        CONCATENATE v_palavra v_caracter INTO v_palavra.
**- FOR FUTURE CAPITAL BECOMES A COMPARISON.
*        TRANSLATE v_palavra TO UPPER CASE.
**- found INCLUDE
*        IF v_palavra EQ c_include.
*          CLEAR v_palavra.
*        ENDIF.
*      ENDIF.
*    ENDDO.
*    move wa_programa-cf to v_palavra.
    TRANSLATE wa_programa-cf TO UPPER CASE.
    REPLACE 'INCLUDE' IN wa_programa-cf WITH '       '.
    REPLACE ':' IN wa_programa-cf WITH ' '.
    split wa_programa-cf at '.' into v_palavra v_rest.
    CONDENSE v_palavra.

*- Add the include name to T_INCLUDES table
    READ TABLE t_includes INTO wa_includes
         WITH KEY nome = v_palavra.                         "#EC *
    IF NOT sy-subrc IS INITIAL.
      IF v_nivel LE p_nivel.
        MOVE: v_palavra TO wa_includes-nome,
              v_nivel   TO wa_includes-nivel.
        APPEND wa_includes TO t_includes.
      ENDIF.
    ENDIF.

  ENDIF.


ENDFORM.                    " GET_INCLUDE
*&---------------------------------------------------------------------*
*&      Form  GET_FUNCTION
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM get_function .

  CLEAR: v_conta_aspa,
         v_palavra.



*- CHECK IS IN THE LINE OF THE PROGRAM IS THERE ANY ROLE.
* SEARCH T_programa-cf FOR c_funcao_2.
  SEARCH wa_programa FOR c_funcao_2.

*- There was a function and the line is not COMENTADA.
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.
*- CHECK ALL 500 CHARACTERS OF THE LINE FOR MOUNTING NAME
*- INCLUDE THE
    DO 500 TIMES.
      v_inicial = sy-index - 1.
      MOVE wa_programa-cf+v_inicial(1) TO v_caracter.
      IF NOT v_caracter IS INITIAL.
*- CHECK IF NOT END OF COMMAND. .
        IF v_caracter EQ c_aspa.
          ADD 1 TO v_conta_aspa.
          IF v_conta_aspa EQ 2.
            EXIT.
          ENDIF.
        ENDIF.

        CONCATENATE v_palavra v_caracter INTO v_palavra.
*- FOR FUTURE CAPITAL BECOMES A COMPARISON
        TRANSLATE v_palavra TO UPPER CASE.
*- Where found INCLUDE
        IF v_palavra EQ c_funcao_1.
          CLEAR v_palavra.
        ENDIF.
      ENDIF.
    ENDDO.
*- NAME OF THE SEARCH FUNCTION FOR FUTURE SEARCH BY USER EXIT .
    CLEAR v_pname.
    SELECT SINGLE pname
           INTO   v_pname
           FROM   tfdir
           WHERE  funcname EQ v_palavra.
    IF sy-subrc EQ 0.

      READ TABLE t_includes INTO wa_includes
           WITH KEY nome = v_pname.
      IF NOT sy-subrc IS INITIAL.
        IF v_nivel LE p_nivel.
          MOVE: v_pname TO wa_includes-nome,
                v_nivel TO wa_includes-nivel.
          APPEND wa_includes TO t_includes.
        ENDIF.
      ENDIF.

    ENDIF.
  ENDIF.


ENDFORM.                    " GET_FUNCTION
*&---------------------------------------------------------------------*
*&      Form  GET_SUBMIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM get_submit .

  CLEAR: v_conta_espaco, v_palavra, v_ini_contagem.


*- CHECK IF THERE ANY ONLINE PROGRAM INCLUDE.
  SEARCH wa_programa FOR c_submit.

* SEARCH t_programa-cf FOR c_submit.

*- Was found in the INCLUDE THE LINE AND DO NOT COMENTADA
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.
* CHECK ALL 500 CHARACTERS OF THE LINE FOR MOUNTING NAME
*- INCLUDE THE

    DO 500 TIMES.
      v_inicial = sy-index - 1.
      MOVE wa_programa-cf+v_inicial(1) TO v_caracter.
      IF v_ini_contagem EQ c_x AND v_caracter IS INITIAL.
        ADD 1 TO v_conta_espaco.
      ENDIF.

      IF NOT v_caracter IS INITIAL.
        MOVE c_x TO v_ini_contagem.
        IF v_caracter EQ c_ponto.
          EXIT.
        ENDIF.

        IF v_conta_espaco LT 2.
          CONCATENATE v_palavra v_caracter INTO v_palavra.
*- FOR FUTURE CAPITAL BECOMES A COMPARISON

          TRANSLATE v_palavra TO UPPER CASE.
*- Where found INCLUDE
          IF v_palavra EQ c_submit.
            CLEAR v_palavra.
          ENDIF.
        ELSE.
          EXIT.
        ENDIF.
      ENDIF.
    ENDDO.
* NAME OF THE SEARCH FUNCTION FOR FUTURE SEARCH BY USER EXIT

    READ TABLE t_includes INTO wa_includes
               WITH KEY nome = v_palavra.                   "#EC *
    IF NOT sy-subrc IS INITIAL.
      IF v_nivel LE p_nivel.
        MOVE: v_palavra TO wa_includes-nome,
              v_nivel   TO wa_includes-nivel.
        APPEND wa_includes TO t_includes.
      ENDIF.
    ENDIF.
  ENDIF.


ENDFORM.                    " GET_SUBMIT
*&---------------------------------------------------------------------*
*&      Form  GET_CLASS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
*FORM get_class .
*
*  CLEAR v_palavra.
*
**- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN INCLUDE.
** SEARCH t_programa-cf FOR 'CLASS'.
*  SEARCH wa_programa FOR 'CLASS'.
*
**- SE ENCONTRO EN EL INCLUDE Y LA LINEA NO ESTÁ COMENTADA.
*  IF  sy-subrc EQ 0
*  AND wa_programa-cf+0(1) NE c_comentario.
*
**- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN STRUCTURE.
**    SEARCH t_programa-cf FOR 'CLASS'.
**
**    IF sy-subrc IS INITIAL.
**      EXIT.
**    ENDIF.
*
**- VERIFICA TODOS LOS 500 CARACTERES DE LA LINEA PARA MONTAR NOMBRE
**- DEL INCLUDE
*    DO 500 TIMES.
*      v_inicial = sy-index - 1.
*      MOVE wa_programa-cf+v_inicial(1) TO v_caracter.
*      IF NOT v_caracter IS INITIAL.
**- VERIFICA SI NO ES FIN DE COMANDO.
*        IF v_caracter EQ c_ponto.
*          EXIT.
*        ENDIF.
**- ARMA PALABRA.
*        CONCATENATE v_palavra v_caracter INTO v_palavra.
**- CONVIERTE A MAYUSCULA PARA FUTURA COMPARACION.
*        TRANSLATE v_palavra TO UPPER CASE.
**- SE ENCONTRO ALGUN INCLUDE
*        IF v_palavra EQ 'CLASS'.
*          CLEAR v_palavra.
*        ENDIF.
*      ENDIF.
*    ENDDO.
**- GRABA NOMBRE DEL INCLUDE PARA FUTURA BUSQUEDA POR USER EXIT.
*    READ TABLE t_includes INTO wa_includes
*         WITH KEY nome = v_palavra.                         "#EC *
*    IF NOT sy-subrc IS INITIAL.
*      IF v_nivel LE p_nivel.
*        MOVE: v_palavra TO wa_includes-nome,
*              v_nivel   TO wa_includes-nivel.
*        APPEND wa_includes TO t_includes.
*      ENDIF.
*    ENDIF.
*  ENDIF.
*
*
*ENDFORM.                    " GET_CLASS
*&---------------------------------------------------------------------*
*&      Form  GET_METHOD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM get_method .

  CLEAR v_palavra.



*- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN INCLUDE.
* SEARCH T_programa-cf FOR 'METHOD'.

  SEARCH wa_programa FOR 'CALL METHOD'.

*- SE ENCONTRO EN EL INCLUDE Y LA LINEA NO ESTÁ COMENTADA.
  IF  sy-subrc EQ 0.
*  AND wa_programa-cf+0(1) NE c_comentario.

*- VERIFICA SI EN LA LINEA DEL PROGRAMA EXISTE ALGUN STRUCTURE.
*    SEARCH t_programa-cf FOR 'CLASS'.
*
*    IF sy-subrc IS INITIAL.
*      EXIT.
*    ENDIF.

*- VERIFICA TODOS LOS 500 CARACTERES DE LA LINEA PARA MONTAR NOMBRE
*- DEL INCLUDE
    DO 500 TIMES.
      v_inicial = sy-index - 1.
      MOVE wa_programa-cf+v_inicial(1) TO v_caracter.
      IF NOT v_caracter IS INITIAL.
*- VERIFICA SI NO ES FIN DE COMANDO.
        IF v_caracter EQ c_ponto.
          EXIT.
        ENDIF.
*- ARMA PALABRA.
        CONCATENATE v_palavra v_caracter INTO v_palavra.
*- CONVIERTE A MAYUSCULA PARA FUTURA COMPARACION.
        TRANSLATE v_palavra TO UPPER CASE.
*- SE ENCONTRO ALGUN INCLUDE
        IF v_palavra EQ 'METHOD'.
          CLEAR v_palavra.
        ENDIF.
      ENDIF.
    ENDDO.
*- GRABA NOMBRE DEL INCLUDE PARA FUTURA BUSQUEDA POR USER EXIT.
    READ TABLE t_includes INTO wa_includes
         WITH KEY nome = v_palavra.                         "#EC *
    IF NOT sy-subrc IS INITIAL.
      IF v_nivel LE p_nivel.
        MOVE: v_palavra TO wa_includes-nome,
              v_nivel   TO wa_includes-nivel.
        APPEND wa_includes TO t_includes.
      ENDIF.
    ENDIF.

  ENDIF.



ENDFORM.                    " GET_METHOD
*&---------------------------------------------------------------------*
*&      Form  APPEND_ALV
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM append_alv .

  DATA:
    l_repid TYPE sy-repid.

  MOVE sy-repid TO l_repid.

  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
      i_callback_program      = l_repid
      i_callback_user_command = 'USER_COMMAND'.

  IF p_ue IS NOT INITIAL.
*    PERFORM construir_catalogo_exit.
*    PERFORM definir_layout  USING    'TY_USER_EXIT'
*                            CHANGING wa_layout.
*    PERFORM construir_eventos USING 'TOP_OF_PAGE'.
*    PERFORM sort TABLES ty_sort
*                 USING 'TY_USER_EXIT'.
*
    PERFORM construct_catalog_exit.
    PERFORM define_layout  "USING    'T_USER_EXIT'
                            CHANGING wa_layout.
    PERFORM construct_eventos USING 'TOP_OF_PAGE'.
    PERFORM sort TABLES ty_sort
                 USING 'T_USER_EXIT'.


    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'             "#EC *
      EXPORTING
        is_layout                  = wa_layout
        it_fieldcat                = ty_cat
        i_tabname                  = 'T_USER_EXIT'
        it_events                  = ty_events
        it_sort                    = ty_sort
        i_text                     = 'User-exit'(008)
      TABLES
        t_outtab                   = t_user_exit
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 2
        OTHERS                     = 3.

  ENDIF.
*
  IF p_custx IS NOT INITIAL.

**    PERFORM construir_catalogo_uexit.
**    PERFORM definir_layout  USING    'TY_FINAL'
**                            CHANGING wa_layout.
**    PERFORM construir_eventos USING 'TOP_OF_PAGE_UEXIT'.
**    PERFORM sort TABLES ty_sort
**                 USING 'TY_FINAL'.
*
    PERFORM construct_catalog_uexit.
    PERFORM define_layout  " USING    'T_CUST_EXIT'
                            CHANGING wa_layout.
    PERFORM construct_eventos USING 'TOP_OF_PAGE_UEXIT'.
    PERFORM sort TABLES ty_sort
                 USING 'T_CUST_EXIT'.


    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'             "#EC *
      EXPORTING
        is_layout                  = wa_layout
        it_fieldcat                = ty_cat
        i_tabname                  = 'T_CUST_EXIT'
        it_events                  = ty_events
        it_sort                    = ty_sort
        i_text                     = 'Customer Exits'(021)
      TABLES
        t_outtab                   = t_cust_exit
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 2
        OTHERS                     = 3.

  ENDIF.
*
  IF p_badi IS NOT INITIAL.
**    PERFORM construir_catalogo_badi.
**    PERFORM define_layout  USING    'TY_BADI'
**                            CHANGING wa_layout.
**    PERFORM construct_eventos USING 'TOP_OF_PAGE_BADI'.
**    PERFORM sort TABLES ty_sort
**                 USING 'TY_BADI'.
**
    PERFORM construct_catalog_badi.
    PERFORM define_layout  "USING    'T_BADI'
                            CHANGING wa_layout.
    PERFORM construct_eventos USING 'TOP_OF_PAGE_BADI'.
    PERFORM sort TABLES ty_sort
                 USING 'T_BADI'.


    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'             "#EC *
      EXPORTING
        is_layout                  = wa_layout
        it_fieldcat                = ty_cat
        i_tabname                  = 'T_BADI'
        it_events                  = ty_events
        it_sort                    = ty_sort
        i_text                     = 'Badis'(045)
      TABLES
        t_outtab                   = t_badi
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 2
        OTHERS                     = 3.

  ENDIF.
*
  IF p_bte IS NOT INITIAL.
**    PERFORM construir_catalogo_bte.
**    PERFORM definir_layout  USING    'TY_BTE'
**                            CHANGING wa_layout.
**    PERFORM construir_eventos USING 'TOP_OF_PAGE_BTE'.
**    PERFORM sort TABLES ty_sort
**                 USING 'TY_BTE'.
**
*
    PERFORM construct_catalog_bte.
    PERFORM define_layout  "USING    'T_BTE'
                            CHANGING wa_layout.
    PERFORM construct_eventos USING 'TOP_OF_PAGE_BTE'.
    PERFORM sort TABLES ty_sort
                 USING 'T_BTE'.


    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'             "#EC *
      EXPORTING
        is_layout                  = wa_layout
        it_fieldcat                = ty_cat
        i_tabname                  = 'T_BTE'
        it_events                  = ty_events
        it_sort                    = ty_sort
        i_text                     = 'BTE'
      TABLES
        t_outtab                   = t_bte
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 2
        OTHERS                     = 3.

  ENDIF.

  IF p_enh IS NOT INITIAL.
**    PERFORM construir_catalogo_enh.
**    PERFORM definir_layout  USING    'TY_ENH'
**                            CHANGING wa_layout.
**    PERFORM construir_eventos USING 'TOP_OF_PAGE_ENH'.
**    PERFORM sort TABLES ty_sort
**                 USING 'TY_ENH'.
*
    PERFORM construct_catalog_enh.
    PERFORM define_layout  "USING    'T_ENH'
                            CHANGING wa_layout.
    PERFORM construct_eventos USING 'TOP_OF_PAGE_ENH'.
    PERFORM sort TABLES ty_sort
                 USING 'T_ENH'.


    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'             "#EC *
      EXPORTING
        is_layout                  = wa_layout
        it_fieldcat                = ty_cat
        i_tabname                  = 'T_ENH'
        it_events                  = ty_events
        it_sort                    = ty_sort
        i_text                     = 'ENH'
      TABLES
        t_outtab                   = t_enh
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 2
        OTHERS                     = 3.


  ENDIF.
*
*
*
  IF p_fdex IS NOT INITIAL.
**    PERFORM construir_catalogo_fdex.
**    PERFORM definir_layout  USING    'TY_FDEX'
**                            CHANGING wa_layout.
**    PERFORM construir_eventos USING 'TOP_OF_PAGE_FDEX'.
**    PERFORM sort TABLES ty_sort
**                 USING 'TY_FDEX'.
**
    PERFORM construct_catalog_fdex.
    PERFORM define_layout  "USING    'T_FDEX'
                            CHANGING wa_layout.
    PERFORM construct_eventos USING 'TOP_OF_PAGE_FDEX'.
    PERFORM sort TABLES ty_sort
                 USING 'T_FDEX'.


    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'             "#EC *
      EXPORTING
        is_layout                  = wa_layout
        it_fieldcat                = ty_cat
        i_tabname                  = 'T_FDEX'
        it_events                  = ty_events
        it_sort                    = ty_sort
        i_text                     = 'Field-exit'(012)
      TABLES
        t_outtab                   = t_fdex
      EXCEPTIONS
        program_error              = 1
        maximum_of_appends_reached = 2
        OTHERS                     = 3.

  ENDIF.

ENDFORM.                    " APPEND_ALV
*&---------------------------------------------------------------------*
*&      Form  ALV_BLOCK_LIST_DISPLAY
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM alv_block_list_display .


  wa_print-reserve_lines = 2.

  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'              "#EC *
    EXPORTING
      is_print      = wa_print
    EXCEPTIONS
      program_error = 1
      OTHERS        = 2.



ENDFORM.                    " ALV_BLOCK_LIST_DISPLAY
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_EXIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_exit .


  DATA:
     l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_USER_EXIT'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:
  'PROGRAMA'  'X' '1' 'X' ' ' ' ' ' ' ' ' ' ' ' ' 'Program Name'(013),
  'LINEA'     'X' '2' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Line'(019),
  'TIPO'      'X' '3' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Type'(017),
  'NIVEL'     'X' '4' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Level'(018),
  'CF'        ' ' '5' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Point in Code'(020).


ENDFORM.                    " CONSTRUCT_CATALOG_EXIT
*&---------------------------------------------------------------------*
*&      Form  DEFINE_LAYOUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --%GT%P_8535   text
*      %LT%--P_WA_LAYOUT  text
*----------------------------------------------------------------------*
FORM define_layout "USING    p_table  TYPE slis_layout_alv-box_tabname
                    CHANGING p_layout TYPE slis_layout_alv .


  CLEAR p_layout.

*  IF p_table NE 'TY_CIMP'.
** Framework for selecting thefield
*    p_layout-box_fieldname         = 'SEL'.
*    p_layout-box_tabname           = p_table.
*  ENDIF.
  p_layout-zebra                 = 'X'.
  p_layout-colwidth_optimize     = 'X'.
  p_layout-no_vline              = ' '.
  p_layout-no_colhead            = ' '.
  p_layout-lights_condense       = 'X'.
  p_layout-detail_popup          = 'X'.
  p_layout-detail_initial_lines  = 'X'.
  p_layout-flexible_key          = ' '.
  p_layout-key_hotspot           = ' '.
  p_layout-confirmation_prompt   = 'X'.



ENDFORM.                    " DEFINE_LAYOUT
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_EVENTOS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --%GT%P_8541   text
*----------------------------------------------------------------------*
FORM construct_eventos USING p_form TYPE slis_alv_event-form.

  DATA:
     l_type(1) TYPE n.

  REFRESH: ty_events.
  CLEAR:   wa_events.

* ALV Block append.
  l_type = 2.

* Search for events sections
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type = l_type
    IMPORTING
      et_events   = ty_events.

* Read event 'TOP_OF_PAGE'
  READ TABLE ty_events WITH KEY name = slis_ev_top_of_page
                           INTO wa_events.
* Assign Routine FORM 'TOP_OF_PAGE' event

  IF sy-subrc = 0.
    MOVE p_form TO wa_events-form.
    MODIFY ty_events FROM wa_events INDEX sy-tabix.
  ENDIF.

ENDFORM.                    " CONSTRUCT_EVENTOS
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOGO_BADI
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_badi .

  DATA:
      l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_BADI'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'PROGRAMA'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' 'Program Name'(013),
  'TIPO'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Type'(017),
  'NIVEL'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Level'(018),
*  'BREAK'     'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' c_text_07,
  'LINEA'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Line'(019),
  'CF'        ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Point in Code'(020).


ENDFORM.                    " CONSTRUCT_CATALOGO_BADI
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_BTE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
**----------------------------------------------------------------------
**
FORM construct_catalog_bte .

  DATA:
      l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_BTE'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'PROGRAMA'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' 'Program Name'(013),
  'TIPO'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Type'(017),
  'NIVEL'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Level'(018),
*  'BREAK'     'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' 'X' c_text_07,
  'LINEA'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Line'(019),
  'CF'        ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Point in Code'(020).


ENDFORM.                    " CONSTRUCT_CATALOG_BTE
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_ENH
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_enh .

  DATA:
      l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_ENH'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'PROGRAMA'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' 'Program Name'(013),
  'TIPO'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Type'(017),
  'NIVEL'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Level'(018),
*  'BREAK'     'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' 'X' c_text_07,
  'LINEA'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Line'(019),
  'CF'        ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Point in Code'(020).



ENDFORM.                    " CONSTRUCT_CATALOG_ENH
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_ENHOBJ
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_enhobj .                             "#EC CALLED

  DATA:
      l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_ENHOBJ'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'ENHNAME'   'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
  'VERSION'   'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'OBJ_TYPE'  ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'X' ' ' ' ',
  'OBJ_NAME'  ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.


ENDFORM.                    " CONSTRUCT_CATALOG_ENHOBJ
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_FDEX
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_fdex .

  DATA:
     l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_FDEX'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'TIPO'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Type'(017),
  'CF'        ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Point in Code'(020).


ENDFORM.                    " CONSTRUCT_CATALOG_FDEX
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_SUST
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_sust .                               "#EC CALLED

  DATA:
     l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_SUST'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'SUBSTID'   'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
  'SUBSEQNR'  'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
  'CONSEQNR'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'SUBSTAB'   ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'SUBSFIELD' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'SUBSVAL'   ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'EXITSUBST' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.


ENDFORM.                    " CONSTRUCT_CATALOG_SUST
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_VAL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_val .                                "#EC CALLED

  DATA:
      l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
    EXPORTING
      i_program_name         = l_repid
      i_internal_tabname     = 'T_VAL'
      i_inclname             = l_repid
    CHANGING
      ct_fieldcat            = ty_cat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'VALID'     'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
  'VALSEQNR'  'X' ' ' 'X' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
  'CONDID'    ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
  'CHECKID'   ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.


ENDFORM.                    " CONSTRUCT_CATALOG_VAL
*&---------------------------------------------------------------------*
*&      Form  CONSTRUCT_CATALOG_UEXIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --%GT%  p1        text
*  %LT%--  p2        text
*----------------------------------------------------------------------*
FORM construct_catalog_uexit .


  DATA:
      l_repid  TYPE sy-repid.

  REFRESH: ty_cat.

  l_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'              "#EC *
     EXPORTING
       i_program_name         = l_repid
       i_internal_tabname     = 'T_CUST_EXIT'
       i_inclname             = l_repid
     CHANGING
       ct_fieldcat            = ty_cat
     EXCEPTIONS
       inconsistent_interface = 1
       program_error          = 2
       OTHERS                 = 3.


* Asignar atributos de campo en el catalogo de reporte ALV
  PERFORM asignar_campo_a_catalogo TABLES ty_cat
                                   USING:

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
*  'NAME'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'MEMBER'    'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'STEXT'     ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
*  'INCLUDE'   ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ',
*  'PROGRAMA'  ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'X' ' ' ' '.

*  'SEL'       'X' 'X' 'X' ' ' ' ' 'X' 'X' ' ' ' ' ' ',
  'PROGRAMA'  'X' ' ' 'X' ' ' ' ' ' ' ' ' ' ' ' ' 'Program Name'(013),
  'TIPO'      'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Type'(017),
  'NIVEL'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Level'(018),
*  'BREAK'     'X' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' c_text_07,
  'LINEA'     'X' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Line'(019),
  'CF'        ' ' ' ' ' ' 'X' ' ' ' ' ' ' ' ' ' ' 'Point in Code'(020).

ENDFORM.                    " CONSTRUCT_CATALOG_UEXIT
*&---------------------------------------------------------------------*
*&      Form  AVOID_TIME_OUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --%GT%P_SY_TFILL  text
*----------------------------------------------------------------------*
FORM avoid_time_out USING p_tfill TYPE sy-tfill.
  DATA:
      vl_total(10) TYPE n,
      vl_atual(10) TYPE n,
      l_tout       TYPE sy-timlo,
      l_time(10)   TYPE c.

  GET TIME FIELD l_tout.

  l_tout = l_tout - v_tini.

  MOVE:
    p_tfill     TO vl_total,
    v_contador TO vl_atual.

  SHIFT vl_total LEFT DELETING LEADING c_0.
  SHIFT vl_atual LEFT DELETING LEADING c_0.
  WRITE l_tout TO l_time.

  CONCATENATE 'Time:'                                       "#EC NOTEXT
              l_time
              'Total:'                                      "#EC NOTEXT
              vl_total
              'Actual:'                                     "#EC NOTEXT
              vl_atual
         INTO v_texto
         SEPARATED BY space.

  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'                 "#EC *
    EXPORTING
      text = v_texto.


ENDFORM.                    " AVOID_TIME_OUT

*Text elements
*----------------------------------------------------------
* 001 Parameters:
* 002 Search for:
* 003 Program
* 004 Transaction Code
* 005 Includes
* 006 Function Modules
* 007 Submit Programs
* 008 User-Exit
* 009 BADI
* 010 BTE
* 011 Substitution
* 012 Field-Exit
* 013 Program Name
* 014 Validation
* 015 Enhancement Point
* 016 Class Methods
* 017 Type
* 018 Level
* 019 Line
* 020 Point in Code
* 021 Customer Exits
* 022 Enter a program name or transaction code
* 023 Select a type of Enhancement
* 026 Enter BTE:
* 028 Sustituciones
* 029 Validations
* 031 Enhancement-Object
* 032 ENHO
* 033 Search in:
* 038 Enhancements Found in Transaction/Program:
* 039 Customer-Exit
* 042 Transaction
* 043 does not exist
* 044 User-exit Tx.CMOD
* 045 Badis


*Selection texts
*----------------------------------------------------------
* P_BADI         Badi
* P_BTE         Bussiness Transaction Events
* P_CLASS         Class
* P_ENH         Enhancement
* P_FUNC         Fucntion
* P_INCL         Include
* P_NIVEL         Level
* P_PROG         Program
* P_SUBMIT         Submit
* P_SUST         Substitution
* P_TCODE         TCode
* P_UE         User-Exit
* P_VAL         Validations


*Messages
*----------------------------------------------------------
*
* Message class: 00
*398   & & & &
*
* Message class: ENHANCEMENT
*380   There are no implementations (yet) for definition &
*
* Message class: PZ
*893   & & & &

*Text elements
*----------------------------------------------------------
* 001 Parameters:
* 002 Search for:
* 003 Program
* 004 Transaction Code
* 005 Includes
* 006 Function Modules
* 007 Submit Programs
* 008 User-Exit
* 009 BADI
* 010 BTE
* 011 Substitution
* 012 Field-Exit
* 013 Program Name
* 014 Validation
* 015 Enhancement Point
* 016 Class Methods
* 017 Type
* 018 Level
* 019 Line
* 020 Point in Code
* 021 Customer Exits
* 022 Enter a program name or transaction code
* 023 Select a type of Enhancement
* 026 Enter BTE:
* 028 Sustituciones
* 029 Validations
* 031 Enhancement-Object
* 032 ENHO
* 038 Enhancements Found in Transaction/Program:
* 039 Customer-Exit
* 042 Transaction
* 043 does not exist
* 044 User-exit Tx.CMOD
* 045 Badis


*Selection texts
*----------------------------------------------------------
* P_BADI         Badi
* P_BTE         Bussiness Tran
* P_CLASS         CLASS
* P_CUSTX         Customer Exit
* P_ENH         Enhancement
* P_FDEX         Field Exit
* P_FUNC         Fucntion
* P_INCL          Include
* P_NIVEL          Level
* P_PROG         Program
* P_SUBMIT         Submit
* P_SUST         Substitution
* P_TCODE         TCode
* P_UE         User-Exit
* P_VAL         Validations


*Messages
*----------------------------------------------------------
*
* Message class: 00
*398   & & & &
*
* Message class: ENHANCEMENT
*380   There are no implementations (yet) for definition &
*
* Message class: PZ
*893   & & & &
  • No labels