Application Development 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: 

How to modify a component on screen?

former_member207732
Participant
0 Kudos

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

Former Member
0 Kudos
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

6 REPLIES 6

Former Member
0 Kudos
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

Former Member
0 Kudos

Use 'AT SELECTION-SCREEN OUTPUT' event.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

hymavathi_oruganti
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.