Application Development and Automation 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: 
Read only

Custom button on ALV

Former Member
0 Likes
423

Hi,

I want to add a custom button on ALV in application toolbar. I have created the ALV using 'REUSE_ALV_GRID_DISPLAY' FM. Can I achieve this using the same function module or I have to use OO mechanism(like set_table_for_first_display)... and then create the button on screen(using SE51)

Thanks,

Edited by: WDAbap on Mar 15, 2010 9:10 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
372

Hi

Just copy standard PF-STATUS to new one,add any button you want and call this new PF-STATUS in your function.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_pf_status_set = 'SET_PF_STATUS' -


> go to form defined by you

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

tables

t_outtab = it_mara

exceptions

program_error = 1

others = 2.

***********************************

  • FORM SET_PF_STATUS *

**********************************

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZNEWST'.

"Copy of 'STANDARD' status from FG SALV

ENDFORM.

Best Regards

Yossi Rozenberg

Hi,

I want to add a custom button on ALV in application toolbar. I have created the ALV using 'REUSE_ALV_GRID_DISPLAY' FM. Can I achieve this using the same function module or I have to use OO mechanism(like set_table_for_first_display)... and then create the button on screen(using SE51)

Thanks,

Edited by: WDAbap on Mar 15, 2010 9:10 PM

1 REPLY 1
Read only

Former Member
0 Likes
373

Hi

Just copy standard PF-STATUS to new one,add any button you want and call this new PF-STATUS in your function.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_pf_status_set = 'SET_PF_STATUS' -


> go to form defined by you

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

tables

t_outtab = it_mara

exceptions

program_error = 1

others = 2.

***********************************

  • FORM SET_PF_STATUS *

**********************************

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZNEWST'.

"Copy of 'STANDARD' status from FG SALV

ENDFORM.

Best Regards

Yossi Rozenberg