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

Alv button Problem

Former Member
0 Likes
440

Hi all,

I have a situation where i have to put a button on alv grid.

i am displaying the data using Reuse_ALV_grid_display. If i am creating button using handle_user_command by o-abap. then how can i set handler for this.

or is there any other method og creating a button on alv when using Reuse_ALV_grid_display function module.

Thanks in advance.

varu.

3 REPLIES 3
Read only

Former Member
0 Likes
419

1. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = W_REPID

I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

2. goto se80

give function group as SALV

In the below window , expand GUI_STATUs

right click on STANDARD and copy that to ur program

activate it

3. FORM PF_STATUS using RT_EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'STANDARD' .

ENDFORM. "PF_STATUS

4. double click on STANDARD and add ur button

5.. FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM

P_SELFLD TYPE SLIS_SELFIELD.

DATA : L_REP_MODE. "report mode

CASE P_UCOMM.

*when double clicked on ALV grid , report id is passed to transaction

WHEN '&IC1'. "Double click

READ TABLE IT_RAMS_SCR_FLDS INDEX P_SELFLD-TABINDEX.

ENDCASe.

ENDFORM.

Read only

Former Member
0 Likes
419

Hi Mittal,

Copy Std gui status from std program to your program and add buttons accordingly.

And in the REUSE_ALV_LIST_DISPLAY fm pass name of the newly copied gui status to parameter I_CALLBACK_PF_STATUS_SET . And the program will show the newly added buttons.

Remeber to handle the code of clicking of newly added buttons by passing a subroutine name to parameter I_CALLBACK_USER_COMMAND.

OR check this link,

Hope that helps.

Regards,

Ramesh.

Read only

0 Likes
419

HI Ramesh,

Thanks for your valuable information.

The button is there on the screen now. But wat i want to display the data of internal table when i click on that. alv is displaying data fine. but there is an itab which has error data. so when i click on tat i want to display those records.

how can i do tat.

thanks in advance.

Varu.