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

Regarding EXECUTE icon disable

Former Member
0 Likes
1,408

Hey experts,

I have created EXECUTE ICON thru PF-STATUS.

Now I want to disable this icon dynamically depends on my condition.

How to do this.

ambichan.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,364

Hi Ambi

types: begin of TAB_TYPE,

FCODE like RSMPE-FUNC,

end of TAB_TYPE.

data: TAB TYPE STANDARD TABLE OF TAB_TYPE WITH

NON-UNIQUE DEFAULT KEY INITIAL SIZE 10 WITH HEADER LINE.

move 'EXECUTE' to TAB-FCODE.

append TAB.

In the program, where you want to exclude 'EXECUTE' :

SET PF-STATUS 'STAT1' EXCLUDING TAB.

where 'STAT' is the name of your status

or also explore the following FM:

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

P_STATUS = 'STAT2'

P_PROGRAM = 'ZAJ_COLLEGE'

TABLES

P_EXCLUDE = TAB.

You can also add more exclusions in this 'tab'.

Regards

Ashish

13 REPLIES 13
Read only

Former Member
0 Likes
1,364

See this sample code

MODULE SET_STATUS OUTPUT.
CASE SY-DYNNR.
WHEN '0100' .
SET PF-STATUS '100'.
WHEN '0200' OR '0300'.
PERFORM STATUS_200_300.
SET PF-STATUS '200' EXCLUDING IT_DEFUNC.
WHEN '0400'.
PERFORM CONTROL_MENU_ITEMS.
SET PF-STATUS '400' EXCLUDING IT_DEFUNC.
ENDCASE.
ENDMODULE. " SET_STATUS OUTPUT

FORM CONTROL_MENU_ITEMS.
CLEAR: IT_DEFUNC, IT_DEFUNC[].
IF SAVE_OKCODE = 'DELETE' OR SAVE_OKCODE = 'DISPLAY'.
APPEND SAVE_OKCODE TO IT_DEFUNC.
PERFORM STATUS_DELETE_DISPLAY.
ELSEIF SAVE_OKCODE = 'CREATE' OR SAVE_OKCODE = 'CHANGE'.
APPEND SAVE_OKCODE TO IT_DEFUNC.
PERFORM STATUS_CREATE_CHANGE.
ELSEIF DATA_UCOMM = 'DELETE' OR DATA_UCOMM = 'DISPLAY'.

Read only

Former Member
0 Likes
1,364

Hi,

Check this sample program,you will get an idea.

DEMO_LIST_SET_PF_STATUS_1

Thanks,

Ruthra.R

Read only

Former Member
0 Likes
1,364

Is it a report program or a dialog program with screens?

Read only

Former Member
0 Likes
1,365

Hi Ambi

types: begin of TAB_TYPE,

FCODE like RSMPE-FUNC,

end of TAB_TYPE.

data: TAB TYPE STANDARD TABLE OF TAB_TYPE WITH

NON-UNIQUE DEFAULT KEY INITIAL SIZE 10 WITH HEADER LINE.

move 'EXECUTE' to TAB-FCODE.

append TAB.

In the program, where you want to exclude 'EXECUTE' :

SET PF-STATUS 'STAT1' EXCLUDING TAB.

where 'STAT' is the name of your status

or also explore the following FM:

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

P_STATUS = 'STAT2'

P_PROGRAM = 'ZAJ_COLLEGE'

TABLES

P_EXCLUDE = TAB.

You can also add more exclusions in this 'tab'.

Regards

Ashish

Read only

0 Likes
1,364

hey ashish,

THanks for your reply

What you gave suggestion seems to be the button will

get removed from Application tool bar.

Actually my requirement is, Execute button should display in screen but user could not be able to activate the button.

Is it possible to do this?

ambichan

Message was edited by: ambi chan

Read only

0 Likes
1,364

Are you saying that you want to display a pushbutton in the application toolbar or in the screen itself, but have the button inactive or "greyed out".

Is this right?

Regards,

Rich Heilman

Read only

0 Likes
1,364

Hey Rich,

Thanks for your reply.

USING PF-STATUS 'S100',

I have added one EXECUTE Button(ICON_EXECUTE_OBJECT) in application tool bar. While running the program the added

EXECUTE Icon Button(Its not ordinary PUSH BUTTON, its Execute ICON button) will display in APPLICATION TOOL BAR(TOp of the screen).

Now depends on condition i want this button to greyed out or inactive.

hope i explained ..if not pls let meknow to explain more clearly.

ambichan

Read only

0 Likes
1,364

I know that I've done this before, but I can't remember how to do it. I am currently trying to look for the answer. I will get back.

Regards,

Rich Heilman

Read only

Former Member
Read only

Former Member
0 Likes
1,364

Hi Ambi

Thanks for giving more clear picture. Now i'm in a position to understand exactly what you want.....

Greying out a button in application toolbar (no removal)..

The solution that i proposed in earlier post will work but with something extra:

Double click on your menu -> choose Application toolbar

-> Goto -> Attributes -> Pusbutton assignment, here you have 3 options, you can choose 'Display All'.

Some other information i found on SAP help but not sure whether it works:

Start the Menu Painter.

Switch to change mode.

Choose Goto -> Attributes -> Application toolbar or choose the padlock icon to the right of the application toolbar

Set the Fixed positions option (check-box), and choose Continue

Now,the padlock icon next to the application toolbar appears 'locked'.

Now, Excluding the 'tab' (see my previous post) will just grey out.

Regards

Ashish Jain

Read only

Former Member
0 Likes
1,364

Hi Ambi

I tried the 'former' solution in my code, it works: EXECUTE is greyed out but not removed

If it solves your problem, please close the thread

Cheers

Ashish Jain

Read only

Former Member
0 Likes
1,364

By 'former' solution, i mean the 'first' solution in my 'second post' (not the one from SAP help).

Cheers

Ashish

Read only

0 Likes
1,364

Hey Ashish Jain,

Great Applause for you from myside.

yes this is what i want..great.

Thanks for your reply in right time.

Ambichan.