‎2005 Dec 21 4:05 AM
Hi,
I have a question regarding screen modifications.
I have 2 fields on the infotype screen,first is the listbox,second is one input field.
Based on value of the list box, if 1 the other field should be disabled(grayed out)and for all other values the field should be enabled.
Could u please help as this is a urgent requirement.
kavitha
‎2005 Dec 21 5:15 AM
hi,
try with removing quotes .
use
<b>screen-input = 0</b> instead of screen-input = '0'.
One more option is use can assaign fcode to list box,
then whenever you change the list box contexts PAI triggers no need to press enter.
And you can use this fcode in your screen modify logic.
regards,
suresh
‎2005 Dec 21 4:11 AM
This isn't exactly what you're doing, but it's similar:
SELECT-OPTIONS: s_fictr FOR zzfbud_mig_tot-zf_fictr
MEMORY ID fis,
s_geber FOR zzfbud_mig_tot-zf_geber
MEMORY ID fic
MODIF ID cfc,
s_prof FOR zzfbud_mig_tot-zf_profil
MEMORY ID bp1
MODIF ID cfc,
s_class FOR zzfbud_mig_tot-zf_classif
MEMORY ID kla NO INTERVALS
MODIF ID cfc,
s_gjahr FOR zzfbud_mig_tot-zf_gjahr
MEMORY ID gjr.
PARAMETERS: p_test AS CHECKBOX DEFAULT 'X',
p_cfc AS CHECKBOX DEFAULT 'X'
USER-COMMAND ucom.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'CFC'.
IF p_cfc = 'X'.
screen-input = 0.
ELSE.
IF screen-group3 <> 'OPU'.
screen-input = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Rob
‎2005 Dec 21 4:17 AM
Yes Similar.
I have a module pool program with PBO and PAI, after the user enter the value for 1st field the second field should be either enabled or disabled depending on the value of the field one.
I did the exact way (like what you mentioned), I am able to get the second field disabled when I click enter for the first time after entering some value for the first field. The second field here is getting disabled. Till this point everything looks good. But when click 'Enter' again, the second field is becoming enabled from disabled status. This should not happen until I change the value for the first field.
Am I clear in explaining the question?
Please help.
Thanks.
Kavitha.
‎2005 Dec 21 4:26 AM
It sounds like a data transport problem between the screen and the program. Have you put a break point at the point in the code where you loop at the screen? If you have, what is the value of the variable that you are testing after you press enter the second time? Is it the same as the first time?
Rob
‎2005 Dec 21 4:32 AM
I put a break point and after clicking enter, everytime i am getting the same value.and even it sets screen input=0 everytime in debug mode,but the same is not reflecting on the screen.
Thanks
kavitha.
‎2005 Dec 21 4:38 AM
‎2005 Dec 21 4:42 AM
yes. please see the code below which i am using.
IF p9918-textt = 'ONE'.
LOOP AT SCREEN.
IF screen-group3 = '002'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group3 = '001'.
screen-input = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
‎2005 Dec 21 4:52 AM
what are you doing in PAI.
how many fields are there in your screen.
vijay
‎2005 Dec 21 4:55 AM
I am developing a custom infotype in HR. I have designed the screen with 2 fields, the first one is a list box with two values (lets say 1 and 2), the second one is a input field. My requirement is when the user selects '1' for the first field and when he clicks enter, the second field should be disabled. And if the value = '2' then the field should be input enabled.
Thanks.
Kavita
‎2005 Dec 21 5:00 AM
if list_value = '1'.
loop at screen.
if screen-name = 'SECOND'.
screen-input = '0'.
modify screen.
clear SECOND.
endif.
endloop.
else.
loop at screen.
if screen-name = 'SECOND'.
screen-input = '1'.
modify screen.
clear SECOND.
endif.
endloop.
endif.
‎2005 Dec 21 5:05 AM
Still the same problem.
For the first 'Enter' the second field gets disabled, but if I click enter again, the field is enabling.
Thanks.
Kavita
‎2005 Dec 21 5:08 AM
did you checked it in debug mode what is happening...
after second time enter(might be value in the list in not populated)
vijay
‎2005 Dec 21 5:08 AM
See in your PAI, if you are manipulating the value of p9918-textt and when you are pressing ENTER second time, may be this value is no longer ONE.
‎2005 Dec 21 5:13 AM
yes,it is retaining the value 'ONE',everytime i click enter.
‎2005 Dec 21 5:16 AM
then the problem lies in your code, where you are modifying...
and is it going there where we are checking and modifying screen after you press enter.
check that..
‎2005 Dec 21 5:16 AM
Can you please post your PAI logic for ENTER and also the code where this table is manipulated in any module?
‎2005 Dec 21 5:15 AM
hi,
try with removing quotes .
use
<b>screen-input = 0</b> instead of screen-input = '0'.
One more option is use can assaign fcode to list box,
then whenever you change the list box contexts PAI triggers no need to press enter.
And you can use this fcode in your screen modify logic.
regards,
suresh
‎2005 Dec 21 5:20 AM
I tried with 0 without single quotes,but still the same problem.
‎2005 Dec 21 5:21 AM
give the code in which you are doing those check under PAI.
vijay
‎2005 Dec 21 5:23 AM
I am looking at this code you posted.
IF p9918-textt = 'ONE'.
LOOP AT SCREEN.
IF screen-group3 = '002'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group3 = '001'.<-- why is this 001 instead of the 002 that you made input 0 earlier
screen-input = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.Message was edited by: Srinivas Adavi
and don't use quotes around the zero or one for screen-input.
‎2005 Dec 21 5:28 AM
PROCESS AFTER INPUT.
----
process exit commands
----
MODULE exit AT EXIT-COMMAND.
----
processing after input
----
*
check and mark if there was any input: all fields that
accept input HAVE TO BE listed here
----
MODULE enable_disable.
CHAIN.
FIELD p9918-begda.
FIELD p9918-endda.
FIELD p9918-name.
FIELD p9918-textt.
MODULE enable_disable.
MODULE input_status ON CHAIN-REQUEST.
ENDCHAIN.
----
process functioncodes before input-checks *
----
MODULE pre_input_checks.
----
input-checks: *
----
insert check modules here:
...
----
process function code: ALL fields that appear on the
screen HAVE TO BE listed here (including output-only fields)
*----
CHAIN.
FIELD p9918-begda.
FIELD p9918-endda.
FIELD rp50m-sprtx.
FIELD p9918-name.
FIELD p9918-textt.
MODULE post_input_checks.
MODULE enable_disable.
ENDCHAIN.
MODULE enable_disable INPUT.
IF p9918-textt = 'ONE'.
LOOP AT SCREEN.
IF screen-name = 'P9918-NAME'.
screen-input = 0.
screen-active = '0'.
MODIFY SCREEN.
CLEAR p9918-name.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'P9918-NAME'.
screen-input = 1.
MODIFY SCREEN.
CLEAR p9918-name.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " enable_disable INPUT
‎2005 Dec 21 5:30 AM
If I am seeing it correctly, you have your ENABLE_DISABLE code in PAI. It should be in PBO.
‎2005 Dec 21 5:31 AM
If it is in PBO how does it respond to user actions?
please explain me if iam wrong.
‎2005 Dec 21 5:36 AM
When the user does something in this screen, first your PAI will trigger. Here depending on the user inputs and action, you will do some validations etc or go to other screens depending on what the user pressed. In the case of ENTER you want to stay in the same screen but "input disable" the field. So when the user presses ENTER, system will first trigger a PAI. The since you are staying in the same screen, system will go through the PBO to show the new/changed/same screen depending on any modifications you do to the screen fields.
Remember, PBO is to do any manipulations of the screen fields like enable/disable, show/hide, optional/mandatory and also menu manipulations. PAI is for data related activities.
Srinivas
‎2005 Dec 21 5:37 AM
CHAIN.
FIELD p9918-begda.
FIELD p9918-endda.
FIELD p9918-name.
FIELD p9918-textt.
*MODULE enable_disable.
MODULE input_status ON CHAIN-REQUEST.
ENDCHAIN.remove it from chain and endchain...
give it after that
MODULE enable_disable.
viajy
‎2005 Dec 21 7:19 AM
Hi,
the problem is that one PBO is executed for any change in the screen PBO and PAI will be executed, so the care should be taken that condition should be checked, such that the requird result can be executed.