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

textbox visible

Former Member
0 Likes
868

Hi experts,

Iam working on Dialog programming.

I have one button & one text box on the screen.

My requirement is,

If i click button, the text box should <b>visible</b>.If i click again the textbox should <b>invisible</b>.

Can anyone tell me how can i do this.

thanks

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
660

In PAI:

CASE ok_code.
WHEN 'click'. ">>this is the ok_code for the button
IF flg_click EQ space.
flg_click = 'X'.
ELSE.
clear flg_click.
ENDIF.
ENDCASE.

Now, in PBO,

LOOP AT SCREEN.
IF flg_click EQ space.
textbox-input = 0.
textbox-invisible = 1.
ELSE.
textbox-input = 1.
textbox-invisible = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

Hope this helps.

Sudha

6 REPLIES 6
Read only

Former Member
0 Likes
660

Hai,

In your PBO Module, have the following module code.

LOOP AT SCREEN.

IF SCREEN-NAME = <textbox name>.

SCREEN-ACTIVE = '0'. *0 - Invisible / 1 - Visible

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Read only

0 Likes
660

you have to create a screen group GR1 in the screen elements.

In pai module you can set a display flag when the user clicks on the button and in pbo module you can write the code like this

IF NOT v_disp_flag IS INITIAL.

LOOP AT SCREEN.

IF screen-group1 = 'GR1'.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Regards,

Sangram

SAP Consultant

Read only

Former Member
0 Likes
661

In PAI:

CASE ok_code.
WHEN 'click'. ">>this is the ok_code for the button
IF flg_click EQ space.
flg_click = 'X'.
ELSE.
clear flg_click.
ENDIF.
ENDCASE.

Now, in PBO,

LOOP AT SCREEN.
IF flg_click EQ space.
textbox-input = 0.
textbox-invisible = 1.
ELSE.
textbox-input = 1.
textbox-invisible = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

Hope this helps.

Sudha

Read only

naimesh_patel
Active Contributor
0 Likes
660

In you PBO module.

count = count + 1.

if count = 1.

flag = 'ON'.

endif.

Loop at screen.

if screen-name = 'BOX'.

if flag = 'ON'.

screen-active = 1.

else.

screen-active = 0.

endif.

endloop.

and in your PAI module.

case ok_code.

when 'BUT1'.

if flag = 'ON'.

flag = 'OFF'.

else.

flag = 'ON'.

endcase.

Read only

Former Member
0 Likes
660

Hi Kaki,

It is very easy.In the screen painter, just make the field invisible by checking the invisible checkbox.

Now in the main program , you can do like this.

Create a global variable (say flag with value 0).

In PBO

-


LOOP AT SCREEN.

IF SCREEN-NAME = 'FIELD1' AND FLAG = 0. "whatever be the field name in screen painter

SCREEN-ACTIVE = 1.

ELSEIF SCREEN-NAME = 'FIELD1' AND FLAG = 1.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

In PAI

-


case sy-ucomm.

when 'CLICK'.

flag = 1.

endcase.

You can also do it by using INVISIBLE instead of ACTIVE also...

Regards,

Amit.

Read only

0 Likes
660

Thanks for all the replies..

Points alloted...

Kaki