Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Add a button ?

former_member194669
Active Contributor
0 Kudos

Hi,

I am using function module REUSE_ALV_POPUP_TO_SELECT to display some table values.

My requirement is to add a custom button in the toolbar of this function module when results displayed,

Thanks

aRs.

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

It doesn't appear that the API allows to add a new button, but it does allow for you to write some custom coding to handle some buttons already implemented.

Regards,

Rich Heilman

former_member194669
Active Contributor
0 Kudos

Thanks Rich,

In that i need to use CL_GUI_DIALOGBOX_CONTAINER

Thanks

aRs

0 Kudos

For example, run this program, put your cusor on a material and click the magnifying glass on the application toolbar within the dialog window.



report zrich_0001.

type-pools: slis.

types: begin of ttab,
       matnr type mara-matnr,
       maktx type makt-maktx,
       end of ttab.
data: itab type table of ttab with header line.

data: repid type sy-repid.

data: iex type  slis_t_extab.
data: xex like line of iex.

data: ifldc type slis_t_fieldcat_alv .
data: xfldc type slis_fieldcat_alv .

parameters: p_check.

start-of-selection.

  select matnr maktx into table itab from makt
            up to 100 rows.

  clear xfldc.
  xfldc-reptext_ddic    = 'Material Number'.
  xfldc-fieldname  = 'MATNR'.
  xfldc-tabname   = 'ITAB'.
  xfldc-outputlen  = '18'.
  append xfldc to ifldc.

  clear xfldc.
  xfldc-reptext_ddic    = 'Material Description'.
  xfldc-fieldname  = 'MAKTX'.
  xfldc-tabname   = 'ITAB'.
  xfldc-outputlen  = '25'.
  append xfldc to ifldc.


  repid = sy-repid.

  xex-fcode = '&NT1'.   append xex to iex.
  xex-fcode = '&OUP'.   append xex to iex.
  xex-fcode = '&ODN'.   append xex to iex.
  xex-fcode = '&ILT'.   append xex to iex.
  xex-fcode = '&OL0'.   append xex to iex.
  xex-fcode = '%SC' .   append xex to iex.
  xex-fcode = '%SC+'.   append xex to iex.

  call function 'REUSE_ALV_POPUP_TO_SELECT'
       exporting
            i_tabname               = 'ITAB'
            i_zebra                 = 'X'
            it_fieldcat             = ifldc
            it_excluding            = iex
            i_screen_start_column   = 5
            i_screen_start_line     = 5
            i_screen_end_column     = 110
            i_screen_end_line       = 20
            i_callback_program      = repid
            i_callback_user_command = 'HANDLE_DC_ALV'
       tables
            t_outtab                = itab
       exceptions
            program_error           = 1
            others                  = 2.


************************************************************************
*       FORM handle_dc_alv                                             *
************************************************************************
form handle_dc_alv using r_ucomm type sy-ucomm
                         rs_selfield type  slis_selfield.

  case r_ucomm.
    when '&ETA'.
      case rs_selfield-fieldname.
        when 'MATNR'.
          check rs_selfield-value(1) <> '*'.   " Not the total line
          set parameter id 'MAT' field rs_selfield-value.
          call transaction 'MM03' and skip first screen.
          r_ucomm = space.       "Clear UCOMM, so STD funct doesn't fire
      endcase.
  endcase.

endform.

Regards,

Rich Heilman

0 Kudos

Hello a®s ,

Is it possible to add custom buttons with REUSE_ALV_POPUP_TO_SELECT using CL_GUI_DIALOGBOX_CONTAINER ? Can you let us know how to implement it?

Vikranth

0 Kudos

I tried that approach , but I could not

Sorry bro !!

0 Kudos

Hello ,

So the solution you implemented was to create a screen with ALV checkbox and add the custom buttons to process the selected records?

Vikranth

0 Kudos

I used with CL_GUI_ALV_GRID with a screen and call it as window (Its look like popup) and add whatever buttons in the alv.