09-18-2008 12:20 PM
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
09-18-2008 12:25 PM
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..
09-18-2008 12:25 PM
09-18-2008 12:26 PM
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
09-18-2008 4:07 PM
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
09-18-2008 4:15 PM
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.
09-18-2008 4:36 PM
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
09-18-2008 4:42 PM
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.
09-18-2008 4:49 PM
Hello,
I have given FCT code for my field. In this case how should be my syntax can you please suggest me.
Thks
09-18-2008 5:03 PM
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
09-18-2008 5:53 PM
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)
09-18-2008 6:09 PM
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.
09-18-2008 7:20 PM
the above code should be in PBO. and it should be last module in your PBO, to avoid any problem related to your screen.
09-18-2008 7:38 PM
Hello,
Sir finally i made it and i am waiting for the approval from my functional team.
Thanks a lot for ur help.
09-23-2008 4:16 PM
09-23-2008 4:29 PM
09-23-2008 4:35 PM
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.
09-18-2008 12:26 PM
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.
09-18-2008 12:26 PM
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
09-18-2008 12:33 PM
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.
09-18-2008 12:34 PM
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.
09-23-2008 5:45 PM