Application Development 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: 

Disableing the Field ?

Former Member
0 Kudos

Hello ,

I am having 2 input fields in which one is dropdown having YES and NO.

And the second field should get automatically disable if i am choosing NO in my first field.

For this requirement how i have to code.

Till now my idea is in PAI...

My code

ZORMA-CISWK = 'NO'. "first field

IF SY-SUBRC = 0.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to be disabled

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

But this is not working. Help me to achieve this...

Thks

21 REPLIES 21

Former Member
0 Kudos

You need to write the code in PBO as when any event gets triggered, PAI is executed and once again PBO is triggered. So, if any code exists in PBO, this takes priority and gets executed..

Former Member
0 Kudos

hi,

write the code in PBO.

Regards,

Sathish Reddy.

Former Member
0 Kudos

alwawys use loop at screen in PBO,

Assign Function Code to ZORMA-CISWK field

When user enter something in this field

automatically pai & pbo is trigger

no need to press enter also.

this is to be code in pbo.

if ZORMA-CISWK = 'NO'. "first field

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to be disabled

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

regards,

Alpesh

0 Kudos

Hi Friends,

Thanks for all your responses.

Here according to your suggestions if i kept my code in PBO then automatically my field will be disable or made inactive and when the user chooses YES then at that case it has to become active which is not happening.

Requirement is when NO input field should be disabled.

When YES input field should be active.

First case is happen but how to achieve both.

Thks

0 Kudos

I am thinking this variable CISWK is still holding 'NO'. even after you choose the YES button

After you press YES , PAI will be triggered , then it should again go to PBO

if PAI module.

CASE OK_CODE.

when 'YES'.
CISWK = 'YES'.

when 'NO'.

CISWK = 'NO'. 

ENDCASE.

In the PBO

if CISWK = 'NO'.  
 wrtie the above mentioned code.
endif.

0 Kudos

Hi,

Thanks for your answer.

But its not working i mean one small conformation sir its not press YES its chooseing Yes from the dropdown list.

current code which i am in use in PBO.

IF ZORMA-CISWK = 'NO'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

ENDIF.

IF ZORMA-CISWK = 'YES'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to

SCREEN-INPUT = 1.

SCREEN-ACTIVE = 1.

SCREEN-OUTPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

With the above code when i am selecting NO from the dropdown box list then after giving command like in my screen NEXT then only its disabling i mean after interacting with any command.

How can i make like if i choose NO from the dropdown box and press enter then automatically my field will become disabled.

Thks

0 Kudos

in that case you need to assign the FctCode (Function code ) to the Field in the Attributes , so that it automatically Trigger.

With out setting the Function code it is is not possible.

So set the Function code to that field.

0 Kudos

Hello,

I have given FCT code for my field. In this case how should be my syntax can you please suggest me.

Thks

0 Kudos

if ur using parameter/select-option just add USER-COMMAND XXX .

Just try with this: for eg:

parameters: rb1 radiobutton group g1 default 'X' user-command rb1,

Parameters: s_ELIKZ like EKPO-ELIKZ . "Delivery Completed" Indicator

AT SELECTION-SCREEN OUTPUT.

if rb3 = 'X'.

LOOP AT screen.

check screen-name = 'S_ELIKZ'.

screen-input = '0'. " Make field input disabled.

MODIFY screen.

ENDLOOP.

endif.

All the best

0 Kudos

No need of any thing. SInce you mentoned the function code, it Triggers automatically PAI and then PBO .

In PAI you want to do any modification or populations based on the value selected you can do .

in PBO do the screen modifcation based on the Listbox fieldvalue (Yes/No)

0 Kudos

Hi Sir,

I am only concern with save the data in PAI its working fine. Only this disable point of view i have struked up. the present code which i am trying to use is...which is not at all working...please help me

CASE OK-CODE.

WHEN 'ISW'. "where ISW is my FCT code.

IF ZORMA-CISWK = 'NO'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

IF ZORMA-CISWK = 'YES'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

ENDIF.

ENDIF.

ENDCASE.

what are all the changes still i have to make sir.

0 Kudos

the above code should be in PBO. and it should be last module in your PBO, to avoid any problem related to your screen.

0 Kudos

Hello,

Sir finally i made it and i am waiting for the approval from my functional team.

Thanks a lot for ur help.

0 Kudos

close.

0 Kudos

>

> close.

what close..?

0 Kudos

Hello vijay,

I am trying to post one new query, but i am getting alert like

Please note that each user can have only 10 open questions at one time. You have already reached the maximum. Please close a previous question to open a new one. For more details please see our Rules of Engagement.

Thats why i have wrote close so that i can post my next query.

My issue was solved i posted close if i am wrong please correct me.

Former Member
0 Kudos

try.

IF ZORMA-CISWK EQ 'NO'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZORMA-YISWK'.

SCREEN-INPUT = 0. " this will disable the field. If you want to hide it, set SCREEN-INVISIBLE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Former Member
0 Kudos

Hi,

Parameters: P_XYZ type VRM_ID As Listbox Visible Length 10 User-Command UCOMM.

and write your code in At selection-Screen Output. event

Former Member
0 Kudos

As others have also said write the code in PBO and try:

IF ZORMA-CISWK = 'NO'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZORMA-YISWK'. "field which has to 
*                                                          be disabled
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

With luck,

Pritam.

Former Member
0 Kudos

Hi Balu,

Check thi sdemo code-

Parameters:CISWK(3) AS LISTBOX VISIBLE LENGTH 3 ,
           YISWK(5) type c.

At selection-screen output.

if CISWK = 'NO'. "first field
LOOP AT SCREEN.
IF SCREEN-NAME CS 'YISWK'. "field which has to be disabled
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Populate the list box.and try it.

Former Member
0 Kudos

My post on Disableing the Field is been solved.