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: 

REUSE_ALV_GRID & other GUI Status

rainer_hbenthal
Active Contributor
0 Kudos

Hi,

i would like to have an additional button in the toolbar of an ALV Grid established via FM REUSE_ALV_GRID. So i copied the STANDARD Gui Status of SALV to my own program and modified it. The call looks as follows:


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program      = alv_report_id
      i_callback_top_of_page  = 'ALV_HEADING'
      i_callback_user_command = 'ALV_USER_COMMAND'
      I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS_SET'
      is_layout               = alv_layout
      it_fieldcat             = it_fcat
      i_save                  = 'A'
      it_sort                 = it_alv_sort
      is_variant              = alv_variant
    TABLES
      t_outtab                = it_out
    EXCEPTIONS
      program_error           = 1
      OTHERS                  = 2.

Formroutine looks like


FORM alv_PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.

  clear EXTAB[].

  SET PF-STATUS 'STANDARD'.


endform.

The form routine above is called cgecked with debugger, but my additional button is not shown. Did i forget something? Is there an example delevired by SAP? Unfortunately i cant paste my GUI status, but it is changed and activated.

Any ideas why the button is not shown?

6 REPLIES 6

former_member188685
Active Contributor
0 Kudos

Hi Rainer,

after coping the status did you activated it, and did you checked it in SE41, what ever you added is there or not.

make sure your PF status is active.

and try this way your form rouine.

<b>FORM ALV_PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'STANDARD' excluding EXTAB.

endform.</b>

Regards

Vijay

0 Kudos

The status is activated, when i'm testing it it looks like it should (i've taken out some buttons), but my own button is not shown. I do not understand this.

0 Kudos

hi,

Ideally it should appear, i don't know what exactly you did. the rest of them are present , only the button which you added is missing are you sure, You should add it in application tool bar and you need to assign Function key for that, what is the FCODE you have assigned for it.

Regards

vijay

0 Kudos

So i kicked out evrything and copied the Status again, making evrything the same and now its working. I'm totally sure i didnt mistyped anything, otherwise the buttons i deleted werent as expected.

Perhaps SAP goes like Microsoft, rebooting solves problems....

Thanks anyhow.

Former Member
0 Kudos

Go to SE41

Click on 'Copy Status' button:

Give the

From Program : SAPLSLVC_FULLSCREEN

From Status : STANDARD_FULLSCREEN

To Program : Your Z* program in which u r using ALV

To Status : your status name. For ex: ZALV

Once u enter all the above details, press 'Copy'.

Now make modifications to the toolbar by adding an extra button and save and activate.

and then use it in ur program in the following manner

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = alv_report_id

i_callback_top_of_page = 'ALV_HEADING'

i_callback_user_command = 'ALV_USER_COMMAND'

I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS_SET'

is_layout = alv_layout

it_fieldcat = it_fcat

i_save = 'A'

it_sort = it_alv_sort

is_variant = alv_variant

TABLES

t_outtab = it_out

EXCEPTIONS

program_error = 1

OTHERS = 2.

FORM alv_PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.

clear EXTAB[].

SET PF-STATUS 'ZALV'.

endform.

Former Member
0 Kudos

u should give functionality to that button( in toobar) using function code.

like.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = alv_report_id

i_callback_top_of_page = 'ALV_HEADING'

i_callback_user_command = 'ALV_USER_COMMAND'

I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS_SET'

is_layout = alv_layout

it_fieldcat = it_fcat

i_save = 'A'

it_sort = it_alv_sort

is_variant = alv_variant

TABLES

t_outtab = it_out

EXCEPTIONS

program_error = 1

OTHERS = 2.

FORM alv_PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.

clear EXTAB[].

SET PF-STATUS 'ZALV'.

endform.

FORM ALV_USER_COMMAND USING UCOMM TYPE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE UCOMM.

WHEN 'BUTTON1'.

  • WRITE UR CODING HERE

ENDCASE.

endform.