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

How to modify a component on screen?

Former Member
0 Likes
859

Hi,

In my program, on the default screen, there is a checkbox and a parameter. If user click checkbox, I want the parameter become disable. How to realize this in program?

Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
813
if CHK = 'X'.
  loop at screen.
     if screen-name = 'P_INPUT'.
        screen-invisible = '1'.
        modify screen.
     endif.
  endloop.
endif.

where P_INPUT is ur parameter name and CHK is ur checkbox name

Hi,

In my program, on the default screen, there is a checkbox and a parameter. If user click checkbox, I want the parameter become disable. How to realize this in program?

Thanks!

6 REPLIES 6
Read only

Former Member
0 Likes
814
if CHK = 'X'.
  loop at screen.
     if screen-name = 'P_INPUT'.
        screen-invisible = '1'.
        modify screen.
     endif.
  endloop.
endif.

where P_INPUT is ur parameter name and CHK is ur checkbox name

Read only

Former Member
0 Likes
813

Use 'AT SELECTION-SCREEN OUTPUT' event.

Read only

Former Member
0 Likes
813

Hi,

In your AT SELECTION SCREEN OUTPUT event,

LOOP AT SCREEN

chech if check box is checked then,

move 0 to checkbox-input.

MODIFY SCREEN

ENDLOOP

Read only

Former Member
0 Likes
813

Hi,

Take a look at this thread.

Except that this thread talks about the selection screen the method to dynamically play with the components of the screen is still the same.

LOOP AT SCREEN.

MODIFY THE COMPONENTS.

ENDLOOP.

Regards,

Ravi

NOTE : Please mark the helpful answers

Read only

hymavathi_oruganti
Active Contributor
0 Likes
813

AT SELECTION SCREEN OUTPUT.

LOOP AT SCREEN.

.........

MODIFY SCREEN.

EDNLOOP.

if u want to make any chenges in the screen display at run time, u can do in the above event.

"SCREEN" is a table containg fields like ACTIVE, INVISIBLE, INPUT, OUTPUT, REQUIRED etc.

check the table in dictionary and

see the fields, u can understand.

Read only

Former Member
0 Likes
813

Hi long,

1. Its a little tricky.

2. we have to use two events.

at selection screen. (for detecting checkbox tick)

at selection screen output. (for showing disabled)

3. just copy paste in new program.

4.

report abc.

data : flag type i.

*----


parameters : a(10) type c modif id M1.

parameters : chk type c as checkbox user-command ch.

*----


initialization.

flag = 1.

*----


at selection-screen .

check sy-ucomm = 'CH'.

flag = 1.

if chk = 'X'.

flag = 0.

endif.

*----


at selection-screen output.

loop at screen.

if screen-group1 = 'M1'.

screen-input = flag.

modify screen.

endif.

endloop.

regards,

amit m.