SAP FI BADI

From SapWiki

BADI FI_ITEMS_MENUE01 FI_ITEMS_MENUE02 FI_ITEMS_MENUE03

Para colocar comandos propios(botones) en transaccion FBL1N se pueden usar las badi

FI_ITEMS_MENUE01
FI_ITEMS_MENUE02
FI_ITEMS_MENUE03

OBS: Estos se activan en el FM FI_ITEMS_DISPLAY y solo aparecen visibles como botón las funciones +CUS01 & +CUS05 (ver status gui ALV_ITEMS_AR)

Los textos de las funciones nuevas se asignan en Cód.F.

Nota: puede ser que los cambios en los botones no se vean reflejados en el sistema destino después de un transporte, para ello ver nota 542302:

Solution

There are two options for deleting superfluous entries

  1. Report SAPRSEUF
  2. Report SAPRSEUG using the optional parameter WITH_TXT = X

if_ex_fi_items_menue01~list_items01

method if_ex_fi_items_menue01~list_items01.

  data : items like line of it_items.
  data : sel.
  data: i.
  data : bseg type bseg,
         bsik type bsik.

  data: idocument  type table of rsparams,
        xdocument  type rsparams.
 clear  : idocument.
 refresh: idocument.

  if sy-xcode  eq '+CUS01' and
     sy-tcode  eq 'FBL5N'.
    loop at it_items into items where xselp is not initial.
      sel = sel + 1.
      if sel > 1.
        message e003(zfi).
      endif.

      submit z030_obj with s_bukrs eq items-bukrs
                          with s_belnr eq items-belnr
                          with s_gjahr eq items-gjahr
                          with p_zuonr eq items-zuonr
                          with p_buzei eq items-buzei
                          and return.
    endloop.
  else.
    if sy-xcode  eq '+CUS01' and
     sy-tcode    eq 'FBL1N'.
      loop at it_items into items where xselp is not initial.
        select single zlspr into bsik-zlspr
              from bsik
                   where bukrs eq items-bukrs and
                         belnr eq items-belnr.

        xdocument-selname = 'BUKRS'.
        xdocument-kind    = 'S'.
        xdocument-sign    = 'I'.
        xdocument-option  = 'EQ'.
        xdocument-low     = items-bukrs.
        append xdocument to  idocument.
        xdocument-selname = 'BELNR'.
        xdocument-low     = items-belnr.
        append xdocument to  idocument.
        xdocument-selname = 'BUZEI'.
        xdocument-low     = items-buzei.
        append xdocument to  idocument.
      endloop.

      if not idocument is initial.
        submit zaprp_simuladpp_obj
              with selection-table idocument
                        and return.
      else.
          message i011(zfi).
      endif.

    endif.
  endif.
 endmethod.

method if_ex_fi_items_menue01~show_buttons

method if_ex_fi_items_menue01~show_buttons.

 data: wa_extab       type slis_extab.
 * boton solo disponible para FBL5N
  if sy-tcode ne 'FBL5N' and
      sy-tcode ne 'FBL1N'.
    wa_extab-fcode = '+CUS01'.
    append wa_extab to extab.
  endif.

 endmethod.