2009 Mar 16 4:05 PM
Hi Experts,
I am using an ALV using OOPS. I need to set PF status for that.
I know how to do that using ALV when created using FM's. Actually i need to set a hot key(shift+F1) for a button in the ALV toolbar.
How can i do this.
Thanks
Dan
Hi Experts,
I am using an ALV using OOPS. I need to set PF status for that.
I know how to do that using ALV when created using FM's. Actually i need to set a hot key(shift+F1) for a button in the ALV toolbar.
How can i do this.
Thanks
Dan
2009 Mar 16 4:53 PM
In the Layout you need to pass:
Lvc_s_layo-NO_toolbar = 'X'
Pass it to set_table_for_first_display.
Create PF-STATUS in PBO of screen.
[PF-STATUS|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/change%252balv%252bstandard%252btoolbar%252band%252brespond%252bit]
Assign the following methods to the created buttons:
cl_gui_alv_grid=>MC_FC_EXPCRDATA
cl_gui_alv_grid=>MC_FC_EXPCRDESIG
cl_gui_alv_grid=>MC_FC_EXPCRTEMPL
cl_gui_alv_grid=>MC_FC_EXPMDB
cl_gui_alv_grid=>MC_FC_EXTEND
cl_gui_alv_grid=>MC_FC_F4
cl_gui_alv_grid=>MC_FC_FILTER
cl_gui_alv_grid=>MC_FC_FIND
cl_gui_alv_grid=>MC_FC_FIX_COLUMNS
cl_gui_alv_grid=>MC_FC_GRAPH
cl_gui_alv_grid=>MC_FC_HELP
cl_gui_alv_grid=>MC_FC_HTML
cl_gui_alv_grid=>MC_FC_INFO
cl_gui_alv_grid=>MC_FC_LOAD_VARIANT
cl_gui_alv_grid=>MC_FC_LOC_APPEND_ROW
cl_gui_alv_grid=>MC_FC_LOC_COPY
cl_gui_alv_grid=>MC_FC_LOC_COPY_ROW
cl_gui_alv_grid=>MC_FC_LOC_CUT
Regards,
Gurpreet
2009 Mar 16 5:19 PM
Hi Gurpreet,
I already have a button on the ALV toolbar. How do i assign a hot key for it.?
For the methods(below) you said there is an error " Method MC_FC_EXPCRDATA unknown or PROTECTED OR PRIVATE.
cl_gui_alv_grid=>MC_FC_EXPCRDATA
cl_gui_alv_grid=>MC_FC_EXPCRDESIG
cl_gui_alv_grid=>MC_FC_EXPCRTEMPL
cl_gui_alv_grid=>MC_FC_EXPMDB
cl_gui_alv_grid=>MC_FC_EXTEND
cl_gui_alv_grid=>MC_FC_F4
cl_gui_alv_grid=>MC_FC_FILTER
cl_gui_alv_grid=>MC_FC_FIND
cl_gui_alv_grid=>MC_FC_FIX_COLUMNS
cl_gui_alv_grid=>MC_FC_GRAPH
cl_gui_alv_grid=>MC_FC_HELP
cl_gui_alv_grid=>MC_FC_HTML
cl_gui_alv_grid=>MC_FC_INFO
cl_gui_alv_grid=>MC_FC_LOAD_VARIANT
cl_gui_alv_grid=>MC_FC_LOC_APPEND_ROW
cl_gui_alv_grid=>MC_FC_LOC_COPY
cl_gui_alv_grid=>MC_FC_LOC_COPY_ROW
cl_gui_alv_grid=>MC_FC_LOC_CUT
Please suggest.
2009 Mar 16 5:23 PM
I don't really think it is possible to assign a function key to buttons on the application toolbar. Sounds a bit disappointing I know, but there is probably nothing you can do about it.
Good luck anyway.
2009 Mar 16 6:09 PM
You cannot assign Hot keys directly default keys are already assigned to it..the only way is to create new PF-STATUS.
Regards,
gurpreet
2009 Mar 16 7:04 PM
Gurpreet,
May i know what would be the default keys for ALV buttons in that case?
Pls suggest.
Thanks
Dan
2009 Mar 16 7:35 PM
You can just point cursor on the Buttons on the tool tip Shortcut keys will appear.
Ex:
CTRLSHIFTF9 -
>Save the output to local system.
Regards,
Gurpreet
2009 Mar 16 7:46 PM
Can you please help me to create PF status specific to ALV grid?
My code is as below:
gs_layout-zebra = 'X'.
gs_layout-sel_mode = 'A'.
call method grid->set_table_for_first_display
EXPORTING
is_variant = w_variant
is_layout = gs_layout
i_save = 'A'
CHANGING
it_outtab = gt_outdisp[]
it_fieldcatalog = gt_fieldcat.
call method grid->set_ready_for_input.
Thanks
Dan
2009 Mar 16 7:59 PM
gs_layout-zebra = 'X'.
gs_layout-sel_mode = 'A'.
gs_layout-NO_toolbar = 'X'. " will remove standard tool bar of alv
call method grid->set_table_for_first_display
EXPORTING
is_variant = w_variant
is_layout = gs_layout
i_save = 'A'
CHANGING
it_outtab = gt_outdisp[]
.
IN PBO : CREATE YOU OWN PF-STATUS
INSIDE MODULE FOR PF-STATUS.
Create required application buttons
IN PBO HANDLE THE BUTTONS:
MODULE USERCOMMAND.
CASE SY-UCOMM.
WHEN 'SAVE'.
PROVIDE THE STATIC CLASS
ENDCASE.
For standard functionality just call them whe you are handling the Buttons:
cl_gui_alv_grid=>MC_FC_EXPCRDATA
cl_gui_alv_grid=>MC_FC_EXPCRDESIG
cl_gui_alv_grid=>MC_FC_EXPCRTEMPL
cl_gui_alv_grid=>MC_FC_EXPMDB
cl_gui_alv_grid=>MC_FC_EXTEND
cl_gui_alv_grid=>MC_FC_F4
cl_gui_alv_grid=>MC_FC_FILTER
cl_gui_alv_grid=>MC_FC_FIND
cl_gui_alv_grid=>MC_FC_FIX_COLUMNS
cl_gui_alv_grid=>MC_FC_GRAPH
cl_gui_alv_grid=>MC_FC_HELP
cl_gui_alv_grid=>MC_FC_HTML
cl_gui_alv_grid=>MC_FC_INFO
cl_gui_alv_grid=>MC_FC_LOAD_VARIANT
cl_gui_alv_grid=>MC_FC_LOC_APPEND_ROW
cl_gui_alv_grid=>MC_FC_LOC_COPY
cl_gui_alv_grid=>MC_FC_LOC_COPY_ROW
cl_gui_alv_grid=>MC_FC_LOC_CUT
Regards,
Gurpreet
2009 Mar 16 8:35 PM
Gurpreet ,
Thanks. its givng me an error at line : "cl_gui_alv_grid=>MC_FC_EXPCRDATA" saying its protected or private method.
WHEN 'SAVE'.
PROVIDE THE STATIC CLASS --> what should i write here ????
ENDCASE.
can you Pls explain.
Thanks
Dan
2009 Mar 17 4:20 AM
Just check the standard programs:
BCALV_TEST_GRID_TOOLBAR
BCALV_TEST_TOOLBAR
Hope the above will help you.
Regards,
Gurpreet
2009 Mar 17 1:02 AM
Hi Dan ,
try to make use of Class cl_gui_toolbar,see the sample code to display few custom buttons on application toool bar.
data: g_toolbar type ref to cl_gui_toolbar.
*Getting the current toolbar list.
call method g_alv_tree->get_toolbar_object
importing
er_toolbar = g_toolbar.
check not g_toolbar is initial.
call method g_toolbar->add_button
exporting
fcode = ''
icon = ''
butn_type = cntb_btype_sep.
call method g_toolbar->add_button
exporting
fcode = 'REPS'
icon = '@3M@'
butn_type = cntb_btype_button
text = ''
quickinfo = text-901. "Information
call method g_toolbar->add_button
exporting
fcode = 'DELE'
icon = '@18@'
butn_type = cntb_btype_button
text = ''
quickinfo = text-901. "Information
regards
Prabhu
2009 Jul 28 10:34 PM