07-08-2005 10:46 AM
Hai,
How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
Thanks in advance .
kiran
07-08-2005 11:01 AM
Hi Kiran,
Use the parameter i_callback_pf_status_set in the function module REUSE_ALV_GRID_DISPLAY.
E.g.
i_callback_program = gd_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
And create a subroutine as follows
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'NEWALVSTATUS'.
endform.
You have to copy the standard ALV pf stauts to 'NEWALVSTATUS' and add your button.
Thanks
Vinod
07-08-2005 11:01 AM
Hi Kiran,
Use the parameter i_callback_pf_status_set in the function module REUSE_ALV_GRID_DISPLAY.
E.g.
i_callback_program = gd_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
And create a subroutine as follows
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'NEWALVSTATUS'.
endform.
You have to copy the standard ALV pf stauts to 'NEWALVSTATUS' and add your button.
Thanks
Vinod
07-08-2005 12:12 PM
Hai Vinod,
Thank you.How and where to declare the pushbutton to get in a specific position.
regards
kiran
07-08-2005 12:26 PM
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.
07-11-2005 7:16 AM
Hai Vinod,
Thanks the problem of adding push buttons is solved.
Regards,
kiran.
07-08-2005 11:05 AM
You have to do the following to process the new button click.
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.
07-08-2005 1:04 PM
Hi,
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'.
Kindly reward points if it helps,otherwise get back.
07-08-2005 1:23 PM
hai jayanthi,
This is a report not a module pool . so how can i customise the screen.
kiran
07-08-2005 1:32 PM
Kiran,
You do not have to enter this in the PBO because you can't edit the screen of PBO if you are using the function module. Instead call the new pf status in the subroutine I have mentioned earlier.
Do you know how to copy the standard pf status?
07-08-2005 1:49 PM
hai vinod,
Its ok.But iam not doing module pool program.This is a REPORT.So how can i write PBO for this.Also tell me how to copy pfstatus and its user command (functionality of buttons).
thanks
kiran
07-08-2005 3:45 PM
Kiran,
You do not have to write PBO for this. You just have to use the new pf status in your report program.
Please refer the following
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
Thanks
Vinod
07-11-2005 5:33 AM
Hi Kiran,
Here is the sample code.If you are using reuse_alv_grid_display, no need to write code in PBO.
Just double click the 'TEST' which is written in code.Then create a GUI Status.In Application toolbar,type the name of the button you want(say BUTTON).Then double click that name.Then enter the ICON name and function text.Activate it.This itself will work.If you want all the functionalities,then try to do as Vinod told.
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 '<b>TEST</b>'.
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.
07-11-2005 5:45 AM
Hai Jayanthi,
In that PFSTATUS .i have to mention standard ALV tool bar buttons along with my push buttons or only the push buttons that i have to add.
07-11-2005 6:16 AM
Hi,
If use want all the standard functionality,then you have to give all the functionality.In that case it is better the copy from standard program.If you want just ,save,back,cancel,exit.,then add the same in Functions Key-Standard Toolbar in GUI status.Write your coding in USER Command for the same.
when 'BACK'.
.....
When 'CANCEL'.
...
07-11-2005 6:24 AM
Hi,
To copy from standard status,
Go to SE41.Give program name as SAPLSALV and click status radio button.Then in the icon above , choose copy status icon(ctrl+f6).Then give your (to)program name and your GUI status in the popup appearing.Then in that status, add the button as I already explained.
<b>Still If you face problems,get back.Otherwise,close the thread by clicking the blue star [problem solved] against any reply which solved your problem.Otherwise, if you solved it on your own,you can select the blue star against your question.</b>
Message was edited by: Jayanthi Jayaraman
11-10-2005 8:30 AM
Hi Vinod,
The second link you had sent was too gud. thanks a lot.
Tushar
07-11-2005 4:49 AM
Hi,
Its very simple,
MODULE status_9001 OUTPUT.
IF o_dockingcontainer IS INITIAL.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'ZTITLE'.
Creating Object
PERFORM f9000_objects_create.
Building the field catalog
endif.
In the ZSTATUS, when u double click a screen will open in that in the application toolbar u can specify as eg:MATNR give description, save and activate this.
Then in PAI u can do
as
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'MATNR'
perform ....
ENDCASE.
Hope this helps.
If u want some sample code get back to me.