‎2008 Feb 01 10:50 AM
I have done coding for G/L interface . This report displays an ALV at the end after performnig validations on each record uploaded from a flat file. Once all records are checked , the ALV requires a PUSH BUTTON that when triggered will post the records.
My query is, how shud i add a push button in the ALV in the title bar.
‎2008 Feb 01 10:54 AM
Hi,
You have to copy the standard pf status to a new one.
For this go to the ALV screen and take the menu System -> Status. (I do not access to the system now) then look for the standard pf status. Copy this to Z range and then add your new button.
Even you can do in this method
Create a GUI status.
Go to GUI Status->Application toolbar.
THen add the button by giving
Function text
Icon name
Icon text
Info. text
Fastpath
Then in PBO of the screen,
Just give in a module
set pf_status 'ZSTATUS'.
Here is an example for your question
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
call transaction 'MM01'.
endcase.
endform.
To Click on the you have to do in the following way
i_callback_user_command = 'USER_COMMAND'
form user_command using i_ucomm like sy-ucomm
is_selfield type slis_selfield.
case i_ucomm.
when 'XXXX'. "XXXX is the function code for new button
endcase.
endform.
For More info please refer the below links
Please refer the following
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
Regards,
Chandru
‎2008 Feb 01 12:17 PM
‎2008 Feb 01 10:58 AM
Hi,
Please refer to the link below :
http://www.sapdev.co.uk/reporting/alv/alvgrid_pfstatus.htm
Thanks,
Sriram Ponna.
‎2008 Feb 01 11:09 AM
Hi,
Create a new pf-status. In that copy the required icons from standard pf-status. Add the button you require for the report.
Add this functionality to the program :
set pf-status 'newpf'.
case sy-ucomm.
when 'button'.
perform < action >.
endcase.
reward if helpful.
regards,
cs.
‎2008 Feb 01 2:21 PM
Have a look at demo report BCALV_GRID_05, it is the most elegant solution.
Bert