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

Problems in at selection-screen output - setting pushbutton invisible

helmut_sieberer
Participant
0 Likes
747

Hello,

I hope I can get some help here

I have a problem with setting a pushbutton invisible

i have a field (long-text) in my screen - and behind this a pushbutton for calling the editor

if in a variant the parameters field is set invisible i also want to set the pushbutton invisible

i have no idea why in the at selection-screen output event screen-invisible is always 0 - but in the variant the field is set invisible.

i need to know if the parameters field is invisible to set the pushbutton the same

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(31) S_TXB_L1.

PARAMETERS S_TXT_L1 TYPE ZHR_FC_STRING.

SELECTION-SCREEN PUSHBUTTON 79(15) P_LTX_1 USER-COMMAND YLTXT1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(31) S_TXB_L2.

PARAMETERS S_TXT_L2 TYPE ZHR_FC_STRING.

SELECTION-SCREEN PUSHBUTTON 79(15) P_LTX_2 USER-COMMAND YLTXT2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(31) S_TXB_L3.

PARAMETERS S_TXT_L3 TYPE ZHR_FC_STRING.

SELECTION-SCREEN PUSHBUTTON 79(15) P_LTX_3 USER-COMMAND YLTXT3.

SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME(7) = 'S_TXT_L'.

MERK_INVISIBLE = SCREEN-INVISIBLE.

ENDIF.

IF SCREEN-NAME(6) = 'P_LTX_'.

SCREEN-INVISIBLE = MERK_INVISIBLE.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks very much...

Helmut

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
697

I agree - there seems to be some confusion here. In the variant the field can only be "hidden" while in the code it is possible to make the field completely invisible. 'Hiding' the field in the variant merely hides it by default and adds a 'plus' button to the toolbar, by clicking which the hidden elements can be exposed.

As far as changing the screen fields goes, I find it usefull to use MODIF ID. Perhaps this blog could be helpful:

http://friendlyabaper.blogspot.com/2009/07/my-super-awesome-selection-screen.html

P.S. Please use the code tags for the code, per Forum Rules.

6 REPLIES 6
Read only

former_member201275
Active Contributor
0 Likes
697

That doesn't make sense. How do you set the field to invisible using a variant?

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
698

I agree - there seems to be some confusion here. In the variant the field can only be "hidden" while in the code it is possible to make the field completely invisible. 'Hiding' the field in the variant merely hides it by default and adds a 'plus' button to the toolbar, by clicking which the hidden elements can be exposed.

As far as changing the screen fields goes, I find it usefull to use MODIF ID. Perhaps this blog could be helpful:

http://friendlyabaper.blogspot.com/2009/07/my-super-awesome-selection-screen.html

P.S. Please use the code tags for the code, per Forum Rules.

Read only

0 Likes
697

Hello,

i posted my last code

first i tried it with screen-active

but the problem is: screen-active is always 1 (in at selection-screen - loop at screen)

even if i set it hidden in the variant

so how do i find out if the field is hidden ?

Thanks

Helmut

Read only

0 Likes
697

Try the following piece of code.

LOOP AT SCREEN.IF screen-name CS 'S_TXT_L'OR screen-name CS 'P_LTX_'.screen-active = 0.screen-invisible = 1.MODIFY SCREEN.ENDIF.ENDLOOP.

Regards,

Bharath.

Read only

0 Likes
697

Thanks for your answer

the problem is:

i need to set p_ltx_ according to s_txt_l

but s_txt_l... screen-active is always 1 - but in the variant its hidden

Thanks

Helmut

Read only

0 Likes
697

Since variant settings have no effect on SCREEN values in AT SELECTION-SCREEN OUTPUT, I think the only way is to check the contents of the variant and go from there. Variant name should be in sy-slset field. The rest is pretty much covered in this blog:

http://friendlyabaper.blogspot.com/2006/10/peeking-inside-variant.html

Hope this helps.