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

PF status for ALV (using OOPS)

Former Member
0 Likes
4,298

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

12 REPLIES 12
Read only

Former Member
0 Likes
2,108

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

Read only

0 Likes
2,108

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.

Read only

0 Likes
2,108

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.

Read only

0 Likes
2,108

You cannot assign Hot keys directly default keys are already assigned to it..the only way is to create new PF-STATUS.

Regards,

gurpreet

Read only

0 Likes
2,108

Gurpreet,

May i know what would be the default keys for ALV buttons in that case?

Pls suggest.

Thanks

Dan

Read only

0 Likes
2,108

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

Read only

0 Likes
2,108

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

Read only

0 Likes
2,108

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

Read only

0 Likes
2,108

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

Read only

0 Likes
2,108

Just check the standard programs:

BCALV_TEST_GRID_TOOLBAR

BCALV_TEST_TOOLBAR

Hope the above will help you.

Regards,

Gurpreet

Read only

Former Member
0 Likes
2,108

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

Read only

Former Member
0 Likes
2,108

Need to have my own PF status