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

setting a screen field

Former Member
0 Likes
868

Hi all

I have a checkbox and a text box on the screen.I have to activate the textbox whenever check box value is set.Please help me to do this.

Thanks in advance.

Regards

Giri.

Hi all

I have a checkbox and a text box on the screen.I have to activate the textbox whenever check box value is set.Please help me to do this.

Thanks in advance.

Regards

Giri.

7 REPLIES 7
Read only

Former Member
0 Likes
830

Use the AT SELECTION-SCREEN OUTPUT

Loop at Screen.

If chk_box = 'X'.

If screen-name = 'YOur parameter name '.

screen-input = '1'.

endif.

Endif

endloop.

Basically what you are doing is in that once the checkbox is clicked.

You are looping at the Screen in search of your field name

and then setting the screen characteristics to input enabled.

Read only

Former Member
0 Likes
830

pbo of the screen (at selection-screen output for selection screen)

if chkbox = 'x'.

loop at screen.

if screen-name = <your fieldname>

screen-input = '1'.

modify screen.

endif.

endloop.

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
830

Hi,

Don't forget to use 'MODIFY SCREEN' in the above code.

Rgds

Sreenviasa Reddy V.

Read only

Former Member
0 Likes
830

Hi Giri,

First of all while creating the checkbox you should use usercommand of that.

in the coding AT SLECTION-SCREEN ouput.

You can use the code

if that check box = 'X'

loop at screen.

if screen-input = 'fieldname'.

screen-input = '1'.

modify screen

endif.

endloop.

Reward Points if it is helpful.

regards,

Kiran I

Read only

0 Likes
830

hello giri ,

write following code ,it will fulfill ur requirement..

parameters: P_pernr(8) modif ID ABD ,

P_CBOX AS CHECKBOX MODIF ID ABC USER-COMMAND CH

DEFAULT 'X'.

Check sy-ucomm = 'CH'.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

if p_CBOX = 'X'.

if screen-group1 = 'ABD'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ENDIF.

ELSEIF P_CBOX = SPACE.

if screen-group1 = 'ABD'.

SCREEN-ACTIVE = '1'.

MODIFY SCREEN.

ENDIF.

ENDIF.

endloop.

Reward points if it helps..

Read only

Former Member
0 Likes
830

HI ,

just execute the code ..

PARAMETERS: p_pc AS CHECKBOX ,
            p_pcfile LIKE rlgrap-filename DEFAULT 'PPPPPPPP' 
            MODIF ID d1.


             at selection-screen output.
             if P_PC NE 'X'.
             loop at screen.
             if screen-group1 = 'D1'.
             screen-INPUT = 0.
             modify screen.
             endif.
             endloop.

             ELSEIF P_PC EQ 'X'.

             loop at screen.
             if screen-group1 = 'D1'.
             screen-INPUT = 1.
             modify screen.
             endif.
             endloop.
             endif.

so if u want the text box to be enabled u need to check the checkbox and an F8

hope this helps ,

regards,

vijay

Read only

Former Member
0 Likes
830

hi giri,

try the following code u can get what do u want.

tables sscrfields.

data:a type c value 'X'.

selection-screen begin of block b with frame.

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

parameters:prm(4) type c Modif id g1.

selection-screen end of block b.

at selection-screen output.

loop at screen.

if screen-group1 = 'G1'.

if a = 'X'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

at selection-screen.

CASE SSCRFIELDS-UCOMM.

WHEN 'CHEK'.

if chk = 'X'.

clear a.

elseif a = 'X'.

endif.

ENDCASE.