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: 

ALV Button problem - need help

Former Member
0 Kudos

Hi,

I need to add a new button say "Display All" in ALV report at top.

This is what I have done as per the above link. But the button is not being displayed in the report when I executed it. Please help.

1. SE80 - copied the GUI status "STANDARD" to my zprogram.

2. SE41 - added new function key "&DISP" with description "Display All". I did not specify any icon name though.

3. Added the following lines in FM

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

4. Created new forms SET_PF_STATUS & USER_COMMAND.

FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'YSTANDARD'.

ENDFORM. " SET_PF_STATUS

Thank you,

mk

5 REPLIES 5

Former Member
0 Kudos

Hi,

U created the Ystandard GUI status , on double clicking 'Ystandard' is it going to the ystandard ?

or u can check in the status tat if the dispall text is in red then keep the cursor on tat DISPALL and press the button in the application toolbar 'FUNCTION CODE'

Former Member
0 Kudos

Hi mkan74 ,

Everything you did is fine, now you must include only simple form is USER_COMMAND .

Copy paste below code at the end of your report and write your own logic for user command.

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '"&DISP'.

Write your code here.

ENDCASE.

ENDFORM.

Regards

Kasturi

Former Member
0 Kudos

Hi,

You can add button on ALV toolbar...Plz visit these links:

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

2. (For ALV OO)

3.

May this helps you.

Regards.

Deepak Sharma

former_member536879
Active Contributor
0 Kudos

Hi,

Just check that after clicking on the button is it going to the user-command form . If you dont created that form create and built your logic inside that for displaying .

With Regards,

Sumodh.P

I355602
Advisor
Advisor
0 Kudos

Hi,

Try creating the PF-Status using the below approach:-

Goto SE41, create a pf-status for your alv report program.

On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.

Delete the unwanted buttons and also you can add new buttons if reqd.

Activate pf-status --> and apply in alv program.

Then code for the custom button in the report program.

Or; try and change the function code of the button.

Hope this helps you.

Regards,

Tarun