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: 

Adding extra button to ALV

Former Member
0 Kudos

Hi,

Im running a report using the standard ALV function module REUSE_ALV_GRID_DISPLAY. I need to add a button somewhere on the screen so that the user can open up a smartform.

Thanks

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Here is an example. This works for both the REUSE grid and the REUSE list.

http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

you can use a custom status.

----


  • FORM SET_PF_STAT_L *

----


  • set pf status defined local *

----


FORM f_set_pf_status USING rt_extag TYPE slis_t_extab.

SET PF-STATUS 'STANDARD'.

ENDFORM.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

i_callback_program = v_repid

i_callback_pf_status_set = 'F_SET_PF_STATUS'

i_callback_user_command = 'F_USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

i_grid_settings = lc_glay

is_layout = tb_layout

it_fieldcat = tb_field[]

it_excluding = tb_excluding[]

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = '1'

  • I_SCREEN_START_LINE = '1'

  • I_SCREEN_END_COLUMN = '1'

  • I_SCREEN_END_LINE = '1'

  • IT_ALV_GRAPHICS =

  • IT_ADD_FIELDCAT =

  • IT_HYPERLINK =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = tb_out

EXCEPTIONS

program_error = 1

OTHERS = 2

.

create a form 'F_USER_COMMAND' where you manage the button.

if helpful reward some points.

with regards,

Leo Ierardi.