Ir al contenido principal

REPORT ZUSEREXIT.

REPORT  ZUSEREXIT.
tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
tables : tstct.
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.
if sy-subrc eq 0.
  select single * from tadir where pgmid = ‘R3TR’
                   and object = ‘PROG’
                   and obj_name = tstc-pgmna.
  move : tadir-devclass to v_devclass.
  if sy-subrc ne 0.
    select single * from trdir where name = tstc-pgmna.
    if trdir-subc eq ‘F’.
      select single * from tfdir where pname = tstc-pgmna.
      select single * from enlfdir where funcname =
      tfdir-funcname.
      select single * from tadir where pgmid = ‘R3TR’
                         and object = ‘FUGR’
                         and obj_name eq enlfdir-area.

      move : tadir-devclass to v_devclass.
    endif.
  endif.
  select * from tadir into table jtab
                where pgmid = ‘R3TR’
                  and object = ‘SMOD’
                  and devclass = v_devclass.
  select single * from tstct where sprsl eq sy-langu and
                                   tcode eq p_tcode.
  format color col_positive intensified off.
  write:/(19) ‘Transaction Code – ‘,
       20(20) p_tcode,
       45(50) tstct-ttext.
  skip.
  if not jtab[] is initial.
    write:/(95) sy-uline.
    format color col_heading intensified on.
    write:/1 sy-vline,
           2 ‘Exit Name’,
          21 sy-vline ,
          22 ‘Description’,
          95 sy-vline.
    write:/(95) sy-uline.
    loop at jtab.
      select single * from modsapt
             where sprsl = sy-langu and
                    name = jtab-obj_name.
      format color col_normal intensified off.
      write:/1 sy-vline,
             2 jtab-obj_name hotspot on,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
    endloop.
    write:/(95) sy-uline.
    describe table jtab.
    skip.
    format color col_total intensified on.
    write:/ ‘No of Exits:’ , sy-tfill.
  else.
    format color col_negative intensified on.
    write:/(95) ‘No User Exit exists’.
  endif.
else.
  format color col_negative intensified on.
  write:/(95) ‘Transaction Code Does Not Exist’.
endif.

at line-selection.
  get cursor field field1.
  check field1(4) eq ‘JTAB’.
  set parameter id ‘MON’ field sy-lisel+1(10).
  call transaction ‘SMOD’ and skip first   screen.

Fuente:
http://aprendeabap.com/documentos_ABAP/ZUSEREXIT.txt

Comentarios

Entradas más populares de este blog

A to Z of OLE Excel in ABAP 7.4

  SAP users, both business and end users always need to download the output of a report to spreadsheet and do their analytics.   The standard excel output from a report is very simple process but it is old fashioned and the spreadsheet looks quite boring.  There is no default formatting and the users have to do all the hard work of changing the fonts, coloring the texts, marking the borders etc. Updated 16th Aug 2019  –  If you are working in non-ABAP 7.4 (below), there is complete reference program for you too. Go to the end of this article.  Thank you  Legxis  ( LeonievonK ) for the share. I acknowledge, whatever I mentioned above can be achieved in many ways programmatically. We can do it in the old traditional ABAP way but  providing multiple tabs in the spreadsheet and formatting is quite tricky with non  OLE  method. OLE = Object Linking and Embedding The high level agenda of this article is to be the  G.O.A.T.  (ple...
How to add custom field in Additional B Tab for SAP Sales Order In this article we want to explain step by step how to add custom field in SAP Sales Order transaction VA01/VA02/VA03. This time Mr ABAPGurus will give the tutorial of enhancement to add custom field in SAP Sales order. In this sample we will add new custom field for comments and customer satisfaction, this data will save into separate table from SAP Standard table ( VBAK / VBAP ). SAP provided us with ADDITIONAL TAB in the sales order transaction ( VA01/VA02/VA03 ) which allow customer to add custom fields.  T he different between ADDITIONAL A and ADDITIONAL B is the ADDITIONAL A for field which already predefine in Sales Order Header ( VBAK ) fields and ADDITIONAL B is for field that freely define. This sample we will use ADDITIONAL B because we will store data from customer satisfaction into Z database table. 1. Create one Z table using SE11 SAP Transaction code. 2.Using SE38 Transactio...

CÓMO ENCONTRAR LA BADI Enhacements Exits

¿Cómo encontrar la BADI que necesitamos? Existen varios caminos para encontrar la BADI que requerimos en un momento dado, vamos a ver algunas de ellas: Opción A. Entramos a la transacción SE80, buscamos en el explorador la clase “CL_BADI_FLT_DATA_TRANS_AND_DB”, luego ubicamos el método “ACT_IMPS_PER_FLT_VAL” y entramos al código, apelamos al buscador para ubicar el comentario “read BADI attributes”, y justo debajo del SELECT que veremos, fijamos un break-point. Luego, abrimos otro modo para ejecutar la transacción que se desea analizar, y veremos que se detendrá cada vez que pase por el break-point fijado, ahora revisamos en el debugger los campos “exit_name” e “internal” para dar con las BADI’s que toca dicha transacción. Opción B. Utilizamos la transacción SE93 para ver los atributos de la transacción estándar que queremos evaluar, buscamos su paquete (clase de desarrollo), luego nos dirigimos a la transacción SE18, optamos por la opción de búsqueda ampliada, indicam...