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

screen modification

Former Member
0 Likes
1,921

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,894

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

25 REPLIES 25
Read only

Former Member
0 Likes
1,894

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

Read only

Former Member
0 Likes
1,894

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.

Read only

0 Likes
1,894

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

Read only

0 Likes
1,894

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.

Read only

0 Likes
1,894

Do you do the "MODIFY SCREEN"?

Rob

Read only

0 Likes
1,894

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.

Read only

0 Likes
1,894

what are you doing in PAI.

how many fields are there in your screen.

vijay

Read only

0 Likes
1,894

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

Read only

0 Likes
1,894
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.
Read only

0 Likes
1,894

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

Read only

0 Likes
1,894

did you checked it in debug mode what is happening...

after second time enter(might be value in the list in not populated)

vijay

Read only

0 Likes
1,894

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.

Read only

0 Likes
1,894

yes,it is retaining the value 'ONE',everytime i click enter.

Read only

0 Likes
1,894

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..

Read only

0 Likes
1,894

Can you please post your PAI logic for ENTER and also the code where this table is manipulated in any module?

Read only

Former Member
0 Likes
1,895

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

Read only

0 Likes
1,894

I tried with 0 without single quotes,but still the same problem.

Read only

0 Likes
1,894

give the code in which you are doing those check under PAI.

vijay

Read only

0 Likes
1,894

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.

Read only

0 Likes
1,894

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

Read only

0 Likes
1,894

If I am seeing it correctly, you have your ENABLE_DISABLE code in PAI. It should be in PBO.

Read only

0 Likes
1,894

If it is in PBO how does it respond to user actions?

please explain me if iam wrong.

Read only

0 Likes
1,894

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

Read only

0 Likes
1,894
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

Read only

Former Member
0 Likes
1,894

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.