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 report

Former Member
0 Likes
925

Hi Guys,

i'm working on an ALV report. I want to add 3 pushbuttons on the application bar in the output screen. The bar where we have the options for display, print preview, choose layout etc.

Can any one tell me how to do this????

Please help me out. its urgent.

Points will be awarded generously for useful answers.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
895

Yes u can have pushbutton on application toolbar.

You just have to use the new pf status in your report program.

You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.

Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.

Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.

Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality.

Have a look at below code for using the new status.


TYPE-POOLS: slis.

DATA: i_qmel LIKE qmel OCCURS 0.
data v_repid type repid.
SELECT * FROM qmel INTO TABLE i_qmel.

v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_structure_name = 'QMEL'
TABLES
t_outtab = i_qmel
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.

form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'TEST'.
endform.

FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data lv_ucomm type sy-ucomm.
lv_ucomm
= sy-ucomm.
CASE lv_ucomm.
WHEN 'BUTTON'. "Double Click line Item
**Write ur functinality here
endcase.
endform.

Also have a look at below links.

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

regards

ravish

<b>plz dont forget to reward points if useful</b>

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
895

You are using the REUSE function module?

Regards,

Rich Heilman

Read only

0 Likes
895

If so, this link will help you thru the process.

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

Regards,

Rich Heilman

Read only

0 Likes
895

Hi Rich,

i'm using reuse_alv_grid_display function module.

Read only

0 Likes
895

Then, the link that I have provided above will definitly work for you. It works the same for the REUSE_ALV_LIST_DISPLAY and the REUSE_ALV_GRID_DISPLAY.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
896

Yes u can have pushbutton on application toolbar.

You just have to use the new pf status in your report program.

You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.

Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.

Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.

Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality.

Have a look at below code for using the new status.


TYPE-POOLS: slis.

DATA: i_qmel LIKE qmel OCCURS 0.
data v_repid type repid.
SELECT * FROM qmel INTO TABLE i_qmel.

v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_structure_name = 'QMEL'
TABLES
t_outtab = i_qmel
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.

form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'TEST'.
endform.

FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data lv_ucomm type sy-ucomm.
lv_ucomm
= sy-ucomm.
CASE lv_ucomm.
WHEN 'BUTTON'. "Double Click line Item
**Write ur functinality here
endcase.
endform.

Also have a look at below links.

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

regards

ravish

<b>plz dont forget to reward points if useful</b>

Read only

Former Member
0 Likes
895

Refer the program <b>BCALV_GRID_05</b>

<b>Reward if helpful.</b>

Read only

Former Member
0 Likes
895

Hi,

Use transaction code SE41 (Menu painter). there you can modify the GUI status used by your report. If you don't know which GUI status your program uses, try SE80 to get the information.

Regards,

Nicolas.