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

Grey-out button dynamically in the application toolbar

Peter_Inotai
Active Contributor
0 Likes
4,890

Hi,

How can I grey-out button dynamically in the application toolbar?

It's not an ALV grid, where it's easy.

SET PF-STATUS '100' EXCLUDING 'SOMETHING'. hides completely the button.

Thanks,

Peter

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,035

Can u please elaborate where u are planning to use this.

Hi,

How can I grey-out button dynamically in the application toolbar?

It's not an ALV grid, where it's easy.

SET PF-STATUS '100' EXCLUDING 'SOMETHING'. hides completely the button.

Thanks,

Peter

13 REPLIES 13
Read only

Former Member
0 Likes
3,036

Can u please elaborate where u are planning to use this.

Read only

0 Likes
3,035

check out this thread. the answer is there for your question.

Regards

Raja

Read only

0 Likes
3,035

Thanks Raja for the link, it worked exactly as I wanted.

Peter

Read only

Former Member
0 Likes
3,035

Hi ,

May be u can have another PF status wid the button disabled .. then u can dynamically set the PF status to this new PF status.

regards,

Sumeet Mishra

reward points if this helps

Read only

Former Member
0 Likes
3,035

Hi,

since you are telling dynamically,

so you need to loop at screen.

conditionally do this..

loop at screen.
if screen-name = 'BUTTON'.
screen-active = 0.
endif.
modify screen.
endloop.

regards

vijay

Read only

0 Likes
3,035

guys, there is a clear cut solution provided in the link i had given, check that out.

Regards

Raja

Read only

0 Likes
3,035

Hi Raja,

that is manually done while creating the PF-status.

if you do that settings it will always invisible/disable or visible. But in runtime i want to do means how?

it won't take care of that...

by default it show disable/enable buttons what ever settings you gave while creating or editing the status.

that doesn't take care of Dynamic part.

regards

vijay

Read only

0 Likes
3,035

yes its manually set when you define the GUI status. once that step is done. when you do set pf-status excluding <itab> all those buttons in the exclude tab will be grayed out.

the dynamic portion comes from set pf-status execulding <itab>

Hope this is clear.

Regards

Raja

Read only

0 Likes
3,035

Yeah i do agree, suppose if i want to make the grayed out button to enable in the runtime or enable to garyed out. how can that be done automatically..

regards

vijay

Read only

0 Likes
3,035

<i>suppose if i want to make the grayed out button to enable in the runtime or enable to garyed out</i>

remove the function code of that button or add the function code of that button to the exclude tab and

do a

set pf-status excluding <exclusion itab> .

Regards

Raja

Read only

0 Likes
3,035

Yep. you are correct.

it will work...

regards

vijay

Read only

Former Member
0 Likes
3,035

Hi ,

thats right the thread contains the exact answer to your problem...

Actually it depend on the Push Button assignment option where u can set what u want to do with disable functions on application tool bar. Whether u want to display them as grey buttons or Hide them completely.

regards,

Sumeet Mishra

Read only

Former Member
0 Likes
3,035

Hi,

Sorry forgot to add something to my previous reply...

The complete steps will be as follows :

1. Create Two PF status , One with active Button and Function code and Second with Inactive Function code and Greyed button (This can be acheive by using Push Button assignment as specified in the thread)

2. Dynamically change the PF status to Second one when you want to deactivate the specified Function from the application tool bar.

regards,

Sumeet Mishra

Reward point if this helps : )