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

Disabling push buttons on application toolbar

Former Member
0 Likes
2,056

Hi,

I have designed a screen to contain two buttons in the application toolbar. However, the immediate requirement is to just disable these buttons. I tried the following approach but I find that the buttons are completely removed from the screen.

<b>data: itab type table of sy-ucomm.

append 'MODLOG' to itab.

append 'ADDCR' to itab.

set pf-status 'ZS0100' excluding itab.</b>

Is there any alternative method so as to just disable the buttons?

Any help would be appreciated.

Thanks

Hi Sandeep,

I am not sure where to find the button name. What exactly is ui_functions?

Thanks

Sneha

10 REPLIES 10
Read only

Former Member
0 Likes
1,381

Hi,

You have to append it in the particular field.

wa_excluding-fcode = p_fcode.

APPEND wa_excluding TO it_excluding.

SET PF-STATUS 'ZHCD' EXCLUDING it_excluding.

regards

Muthappan

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,381

Hi Sneha,

before calling the method set_table_for_first_display .

try this:

  • Build Exclude functions.

PERFORM build_exclude_func CHANGING gt_exclude_0100.

----


*Local data declaration

DATA: ls_exclude TYPE ui_func.

----


ls_exclude = cl_gui_alv_grid=>Give th ebutton name.That u can find in ui_functions.

APPEND ls_exclude TO pt_exclude.

Hope this helps.

Read only

0 Likes
1,381

Hi Sandeep,

I am not sure where to find the button name. What exactly is ui_functions?

Thanks

Sneha

Read only

0 Likes
1,381

Hi,

UI_FUNCTIONS is a table type , goto SE11 and u ll get it.

But what u have to do is :

Goto CL_GUI_ALV_GRID and in attributes u will find the button names and detailed desc , which u want to remove .

So select the required buttons and append the internal table.

If any further queries , let me know.

Read only

0 Likes
1,381

Hi,

Hope u rable to disable the buttons ...:)

Read only

0 Likes
1,381

Hi Sandeep,

I tried the approach you have suggested but when I look at the attributes, there are only standard buttons that are mentioned. The two buttons I want to disable are what I have created myself ( custom oush buttons). The requirement is to have the buttons for disabled and later on once their finctionality is clear they will have to be enabled.

Is there any other way ?

Thanks

Sneha

Read only

0 Likes
1,381

Hi,

If it is custom button,then go to application in GUI status.There if you double click the button which you designed,you will get the information about the button.

Read only

0 Likes
1,381

Hi,

So u want to change tthe GUI status based on some conditions .

Try this:

wa_excluding-fcode = p_fcode." Give the focde for buttons u want to exclude

APPEND wa_excluding TO it_excluding.

SET PF-STATUS 'ZHCD' EXCLUDING it_excluding.

If condition is met then call :

SET PF-STATUS 'ZHCD' .

also,

u can create two PF staus , once with all the buttons and other with the required buttons and call the required PF STATUS based on ur condition.

Read only

Former Member
0 Likes
1,381

wa_excluding-fcode = p_fcode.

APPEND wa_excluding TO it_excluding.

SET PF-STATUS 'ZHCD' EXCLUDING it_excluding.

Read only

Former Member
0 Likes
1,381

hi,

If you want just to enable or disable buttons instead of completely hiding the buttons, follow these steps:

1) Set pf-status 'ABC' excluding itab.

Populate itab with all the function codes which should be disabled.

2) double click on ABC to go to pf-status screen, in the menu, goto->attributes->push button assignment. Select Display All and click ok. ( By default we will be having Hide All.)

3) Save and activate.

Now, all the buttons that are excluded will be grayed out(disabled).