‎2007 Apr 09 12:05 AM
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 !
‎2007 Apr 09 12:37 AM
‎2007 Apr 09 12:37 AM
‎2007 Apr 09 12:46 AM
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.
‎2007 Apr 09 12:48 AM
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
‎2007 Apr 09 1:00 AM
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.
‎2007 Apr 09 1:07 AM
‎2007 Apr 09 1:12 AM
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.
‎2007 Apr 09 1:15 AM
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
‎2007 Apr 09 1:20 AM
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.
‎2007 Apr 09 1:23 AM
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
‎2007 Apr 09 1:51 AM
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.
‎2007 Apr 09 1:53 AM
‎2007 Apr 09 1:58 AM
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.
‎2007 Apr 09 2:02 AM
‎2007 Apr 09 2:09 AM
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.
‎2007 Apr 09 2:22 AM
‎2007 Apr 09 2:34 AM
Hi, Rich Heilman:
Thank you so much. It's working now. I will reward points.
Best wishes,
Victor
‎2007 Apr 09 2:35 AM