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-input?

Former Member
0 Likes
2,395

Hi, Guru:

I have a question on SCREEN-INPUT. In the PAI, I set one field SCREEN-INPUT to 0. but once click one button. In the PBO, Its value automatically always change to 1.

Is there any place to setup, I want to write code to change it.

Thanks in advance !

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,823

You must always set the screen attributes in the PBO, not the PAI.

Regards,

RIch Heilman

17 REPLIES 17
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,824

You must always set the screen attributes in the PBO, not the PAI.

Regards,

RIch Heilman

Read only

0 Likes
1,823

Hi, RIch Heilman:

Thanks for your answer. when I just set this field SCREEN-INPUT to 1 in the PBO. but this field still display diabled in the screen. I don't know why. I think it should be enable because I set it to 1. Thanks.

Read only

0 Likes
1,823

Hi,

You have to use <b>MODIFY SCREEN</b> statement, whenever you change any atrribute of screen field.

So it is like.

LOOP AT SCREEN.
   IF SCREEN-NAME = 'XYZ'.
      SCREEN-INPUT  = '1'.
   ENDIF.
   MODIFY SCREEN.
ENDLOOP.

Let me know if you still have a issue.

Regards,

RS

Read only

0 Likes
1,823

Hi, RS:

Thanks for your help, actullay I want to toggle for this field. but it always disable

when it display on the screen. my code as the following:

loop at screen.

  • if screen-group1 = 'GR1'.

if screen-name = 'V_CURRENT_TERM-FACILITY_NAME'.

if screen-input = 0.

screen-input = 1.

elseif screen-input = 1.

screen-input = 0.

endif.

modify screen.

endif.

endloop.

Read only

0 Likes
1,823

If the field has been statically defined in screen painter as an input field, then it will have this value everytime the PBO is fired. So you need only to change the INPUT value when required.

Regards,

RIch Heilman

Read only

0 Likes
1,823

Hi, Rich:

my field is input field. but when I debug it.

SCREEN-REQUIRED = 0. Is that ok or I should set SCREEN-REQUIRED to 1.

Thank you again.

Read only

0 Likes
1,823

The REQUIRED field is simply to make it obligatory, but doing this is a little buggy. If you turn this off, you will not be able to turn it off without a value being entered. This will not help your requirement.

You requirement is to simply turn a field on/off depending on a click off a button, example... change/display right?

Regards,

RIch Heilman

Read only

0 Likes
1,823

Hi, RIch Heilman:

You are right. I just make a field enable or disable when click a button.

It's simple. but It's not working. I really don't know what happened.

thank you for your help.

Read only

0 Likes
1,823

If this is your requirement, here is how to proceed. Create a simply flag variable in your TOP include or at the top of the program

data:  toggle type c.

Now in your PAI, for the specific button or icon, you will want to toggle the value of this field.

case sy-ucomm.
    when 'CHG'.
        toggle = 'X'.
    when 'DSP'.
        toggle = space.
endcase.

Then in your PBO, you will want to check this value and make the feild input or output accordingly.

Loop at screen.
   if screen-name = 'YOUR_FIELD'
      and toggle = space.
      screen-input = 0.
      modify screen.
  endif.
endloop.

REgards,

RIch Heilman

Read only

0 Likes
1,823

Hi, Rich:

I try to use your method, but it still not working.

when I click the button first time, It work, field will be disable.

but when I click the button again. It not work. field still disable. not change to enable.

Read only

0 Likes
1,823

Please post your code.

Regards,

Rich Heilman

Read only

0 Likes
1,823

Hi, Rich:

my code is as the following:

IF not v_click_switch is initial.

  • the following toggle table control

LOOP AT TC9020-cols INTO cols WHERE index GT 0.

IF cols-screen-input = '0'.

cols-screen-input = '1'.

ELSEIF cols-screen-input = '1'.

cols-screen-input = '0'.

ENDIF.

MODIFY TC9020-cols FROM cols INDEX sy-tabix.

ENDLOOP.

  • the following toggle the fields

loop at screen.

if screen-name = 'V_CURRENT_TERM-FACILITY_NAME' and

v_click_switch = 'X'.

if screen-input = 0.

screen-input = 1.

elseif screen-input = 1.

screen-input = 0.

endif.

modify screen.

endif.

endloop.

ENDIF.

Read only

0 Likes
1,823

Where are yout setting v_click_switch = 'X'. Show the PAI.

Regards,

RIch Heilman

Read only

0 Likes
1,823

module m_USER_COMMAND_9010 input.

save_ok = ok_code.

clear ok_code.

case SAVE_OK.

*1+ double click on terminal attribute table control

when 'PICK'.

perform f_dblclk_table_control.

perform f_set_button_status.

*2+ click on save button

when 'SAVE'.

perform f_save_action.

*3+ click on back button

when 'EXIT'. " 'BACK' or 'EXIT' or 'CANCEL'.

perform f_exit_action.

*5+ click on Add (create) button

when 'ADD'.

perform f_add_action.

*6+ click on Delete button

when 'DELE'.

perform f_delete_action.

*7+ click on switch button

when 'SWITCHMODE'.

v_click_switch = 'X'.

when others.

endcase.

Read only

0 Likes
1,823

Please do this....

when 'SWITCHMODE'.
if v_click_switch = space.
    v_click_switch = 'X'.
elseif v_click_switch = 'X'.
    v_click_switch = space.
endif.

Regards,

RIch Heilman

Read only

0 Likes
1,823

Hi, Rich Heilman:

Thank you so much. It's working now. I will reward points.

Best wishes,

Victor

Read only

0 Likes
1,823

Success!!!! Wooohoooo.

Regards,

RIch Heilman