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 and Enabling a button

Former Member
0 Likes
3,021

Hi,

I just need a clarification.

I want a button to be disabled initially and then after clicking some other button, it should get activated. So, can I write the screen attributes modifications in PAI event? or I shud write it in PBO only? (Initially disabling the button- I have done it in PBO but how abt re-enabling? Can it be done in PAI or PBO event)

Note: This quention is <b>where</b> can I write code (in PAI or PBO)

and <b>not how</b> to write the code.

Regards,

Kalai

5 REPLIES 5
Read only

Former Member
0 Likes
964

Hi Kalaivani,

In a custom program, you can do it with the EXCLUDING option .. look for F1 help on

SET PF-STATUS for the exatct syntax..

For a Std Tcode, you can create a screen variant using SHD0.

<b>Kindly award points if you found the reply helpful.</b>

Cheers,

Chaitanya.

Read only

0 Likes
964

I want to do this dynamically. so, can i do this in PAI event or PBO event?

Read only

Former Member
0 Likes
964

hi,

do u have that button on screen than its possible....

In PBO, make some module.

and write like,

MODULE chg_screen OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 111 AND save_ok = 'CHG'.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF screen-name ='EDIT'. " edit is button name

IF fb = 0.

screen-input = 0.

MODIFY SCREEN.

ELSE.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

ENDMODULE. " chg_screen OUTPUT

and in USER_COMMAND_1000 module of PAI

sat the flag fb when that button press.( the button fom which u want to decide that other button should b enable or disable)

and if u using buttons in pf-status than u need to make two pf-status with enable and disable button and u need to call that pf-status according to condition...

reward if useful....

Read only

Former Member
0 Likes
964

Hi,

Initially you want the button to be disabled write, so you can write that in pbo.but afterwards you should enable the button after some trigger i.e you should press some button so that thing has to enabled.so write that in pai.

Read only

Former Member
0 Likes
964

hi kalai,

initially you can deactivate the button while creating it that is in the screen painter itself and later when you want to activate it dynamically you can write the code in pai.

lets take a sample code suppose you have two push buttons the function codes of those buttons are save and modify lets say

now initially your save button is inactive and as soon as you press modify button your save button should get activated so now try using this sample code

case sy-ucomm

when 'modify' (function code for modify button)

loop-at-screen

if screen-name = save

screen-active = 1.

endif.

endloop.