11-13-2006 7:06 AM
HI friends,
My rpoblem is that in using FM REUSE_ALV_GRID_DISPLAY i want to add one more push button in the PF_STATUS of basic list as DISPLAY for interactve reporting.
CAn you please help me how do get it?
11-13-2006 7:12 AM
11-13-2006 7:28 AM
Hi abhay,
check this simple procedure.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_pf_status_set = 'SET_PF_STATUS' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
*------------------------------------------------------------------*
* FORM SET_PF_STATUS *
*------------------------------------------------------------------*
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZNEWSTATUS'.
"Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.
************copy pf status************
1)goto se80
2)open function group SALV
3) In that STANDARD gui-status will be there.
4)right click on that and ther is option of copy
5)just copy it and save it with ur name 'status_name'.
6) now in ur program SET PF-STATUS '(status_name)'.
7)don't forget to active it again
<b>8)In the new copied pf status u can give your 'PUSH BUTTON'</b>
Regards
Anver
if hlped pls mark points
11-13-2006 10:11 AM
11-13-2006 10:15 AM
U can have button 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
<b>I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'</b>
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.
<b>form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'TEST'.
endform.</b>
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
Best Regards,
Vibha
*Please mark all the helpful answers