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

Pushbutton on screen visible/invisible

Former Member
0 Likes
3,259

Hi,

on a scree there is a push button. The screen can be started by 2 ways, once the push button should be visible, once it should be invisible.

If I start the screen THE FIRST TIME the pushbutton is shown and if I change the view to the situation without the push button, the button disappears. I can switch back to the situation where the push button is shown. Everything ok.

But if I start the screen THE FIRST TIME in the situation where the push button is invisible and then if I switch to the situation where the button should be shown, it is not visible.

Technically I use loop at screen with modify and I set the variables active, input, output and invisible concerning and respecting correlations between these variables (compare documentation).

Has anybody an idea?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,916

IF you are using a module pool program you can declare a global flag, to determine how the screein called.

data: flag(1) value 'Y'.

say the screen 100 (which is having the pushbutton) is called in such a way, that button should be visible.

then set

flag = 'Y'.

this should be done before , call screen 100.

similarly if screen 100 is called in such a way that the button should be invisible then

flag = 'N'.

call screen 100.

now in PBO of screen 100, create a Module Modiy_screen.

here you write the code..as

loop at screen.

case flag.

when 'Y'.

modify scren to make button visible.

when 'N.

modify scren to make button invisible.

endcase.

modify screen.

endloop.

i think you alreday done in such way, just see, if the flag is set properly.

Message was edited by: Anid

Message was edited by: Anid

Hi,

on a scree there is a push button. The screen can be started by 2 ways, once the push button should be visible, once it should be invisible.

If I start the screen THE FIRST TIME the pushbutton is shown and if I change the view to the situation without the push button, the button disappears. I can switch back to the situation where the push button is shown. Everything ok.

But if I start the screen THE FIRST TIME in the situation where the push button is invisible and then if I switch to the situation where the button should be shown, it is not visible.

Technically I use loop at screen with modify and I set the variables active, input, output and invisible concerning and respecting correlations between these variables (compare documentation).

Has anybody an idea?

6 REPLIES 6
Read only

Former Member
0 Likes
1,916

Post the part of ur code where u r facing the problem.

Read only

Former Member
0 Likes
1,916

reward point if it helps you.

THESE ARE TEXT SYMBOLS FOR THE FOLLOWING CODE SNIPPET

001 Copy

002 Move

003 Delete

004 File Transfer Utility

005 Rename

RUN THIS CODE FROM SE38 TO SEE DYNAMIC SCREEN CHANGES ON USER-SELECTION OF RADIO-BUTTON

REPORT ZANID_TEST2 MESSAGE-ID ZZ.

selection-screen:

Begin of block r1 with frame title text-006.

parameters:

p_cp1 radiobutton group rb1 default 'X' USER-COMMAND RND,

p_mv1 radiobutton group rb1,

p_ren radiobutton group rb1,

p_del1 radiobutton group rb1.

selection-screen:

End of block r1.

selection-screen:

begin of block b1 with frame title text-004.

parameters:

loc1(128) obligatory lower case "Location1

default 'E:\usr\sap\put' modif id 1,

file(128) obligatory lower case "Filename

default 'E:\usr\sap\put\ekpo.dat' modif id 2,

newname(128) obligatory lower case "Filname

default 'abcd.txt' modif id 3,

loc2(128) obligatory lower case "Location2

default 'E:\usr\sap\D12\SYS\gen' modif id 4.

selection-screen:

skip,

PUSHBUTTON /05(23) TEXT-001 USER-COMMAND ZCOPY modif id 5,"COPY

PUSHBUTTON 30(23) TEXT-002 USER-COMMAND ZMOV modif id 6, "CUT

PUSHBUTTON 55(23) TEXT-003 USER-COMMAND ZDELETE modif id 7, "DELTE

skip,

PUSHBUTTON /30(23) TEXT-005 USER-COMMAND ZREN modif id 8, "RENAME

end of block b1.

*

at selection-screen output .

perform modify_screen.

*----


YOUR PROCESSING LOGIC COMES HERE

&----


*& Form modify_screen

&----


form modify_screen.

loop at screen.

if p_cp1 eq 'X'.

if screen-group1 = '3' or

screen-group1 = '6' or

screen-group1 = '7' or

screen-group1 = '8'.

screen-active = 0.

endif.

elseif p_mv1 eq 'X'.

if screen-group1 = '3' or

screen-group1 = '5' or

screen-group1 = '7' or

screen-group1 = '8'.

screen-active = 0.

endif.

elseif p_del1 eq 'X'.

if screen-group1 = '3' or

screen-group1 = '4' or

screen-group1 = '5' or

screen-group1 = '6' or

screen-group1 = '8'.

screen-active = 0.

endif.

elseif p_ren eq 'X'.

if screen-group1 = '4' or

screen-group1 = '5' or

screen-group1 = '6' or

screen-group1 = '7'.

screen-active = 0.

endif.

endif.

modify screen.

endloop.

endform. " modify_screen

Message was edited by: Anid

Read only

Former Member
0 Likes
1,917

IF you are using a module pool program you can declare a global flag, to determine how the screein called.

data: flag(1) value 'Y'.

say the screen 100 (which is having the pushbutton) is called in such a way, that button should be visible.

then set

flag = 'Y'.

this should be done before , call screen 100.

similarly if screen 100 is called in such a way that the button should be invisible then

flag = 'N'.

call screen 100.

now in PBO of screen 100, create a Module Modiy_screen.

here you write the code..as

loop at screen.

case flag.

when 'Y'.

modify scren to make button visible.

when 'N.

modify scren to make button invisible.

endcase.

modify screen.

endloop.

i think you alreday done in such way, just see, if the flag is set properly.

Message was edited by: Anid

Message was edited by: Anid

Read only

0 Likes
1,916

HI Anid,

thanks for the answer. The switch from "invisible button" to "ivisible button" is done by F4-Help. So in this step (PAI) the modify screen is done to make the button visible and no PBO is called again (because of F4-Help).

Could this be the problem?

Fest regards!

Florian

Read only

0 Likes
1,916

ya thats the problem even i think..

the modiy-screen statement are supposed to be in a PBO module , instead of PAI.

just clarify one thing...

r u asking for ..

if the user select a value from F4, make the buttn invisible, and if he selects some other value make the button visible.

is this the thing you want to implement??

Read only

0 Likes
1,916

Yes this is what I mean.

I think now I have the solution. I call "LEAVE TO SCREEN XXXX" after f4-help and the PBO is called again and the button is visible.

It is interested that the input/output variables after F4-help calling modify screen (in PAI) are functining but not the visible/invisible.

Thank you very much for your help!

Florian