Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Button in classics ALV

Hi guys , Im listing some registers with alv but now I want to add a button to button bar for select some lines of the alv and send this lines selected after push my new button , I add

FORM cria_listagem_alv.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = pgm

it_fieldcat = fieldcat

it_sort = sortcat

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = 'USERCOMMAND'

is_layout = layout

TABLES

t_outtab = t_zatrconsumos

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " cria_listagem_alv

&----


*& Form usercommand

&----


  • text

----


  • -->R_UCOMM text

  • -->RS_SELFIELD text

----


FORM SET_PF_STATUS USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

SET PF-STATUS 'STANDARD' EXCLUDING r_ucomm.

"SET PF-STATUS 'SAVE'.

ENDFORM. "usercommand

to add button but i got a dump of parameters missing , i think is the first step, any advice ?? ,thank you

Tags:
replied

you combined both. the correct coding is this..

For PF_STATUS

FORM SET_PF_STATUS USING extab type slis_t_extab.

SET PF-STATUS 'STANDARD' EXCLUDING extab.
"SET PF-STATUS 'SAVE'.

ENDFORM.

For user command

FORM USERCOMMAND using ucomm type sy-ucomm 
selfield type slis_selfield.


endform.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question