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

Hide a subscreen with custom control inside

Former Member
0 Likes
3,105

Hello.

I have a normal screen with two subscreens which has to be shown or hidden depending on a condition. These subscreens are between other elements, in the middle.

With the first subscreen there is no problem. It has only fields and labels, and at PBO I set to invisible all of them, and the subscreen does not appear, neither the space of it (the rest of elements below it goes up).

But when I do the same with the second, which has a custom control, I can't set invisible this element, it is not  in the screen and I can't process it in the "loop at screen". The result is that the space of the custom control (uninitialized) remains there, between the other elements.

How can I do to hide the subscreen and its space?

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,852

Hi,

Try the below option, if you are not able to achieve by element properties..

Create a new blank sub screen and call it dynamically.

If you want to have the custom control, then call the existing screen as sub screen. If you dont want the custom control in display, pass the new sub screen number to call the sub screen.

Thanks,

Balu.

Hello.

I have a normal screen with two subscreens which has to be shown or hidden depending on a condition. These subscreens are between other elements, in the middle.

With the first subscreen there is no problem. It has only fields and labels, and at PBO I set to invisible all of them, and the subscreen does not appear, neither the space of it (the rest of elements below it goes up).

But when I do the same with the second, which has a custom control, I can't set invisible this element, it is not  in the screen and I can't process it in the "loop at screen". The result is that the space of the custom control (uninitialized) remains there, between the other elements.

How can I do to hide the subscreen and its space?

Thanks in advance

6 REPLIES 6
Read only

Former Member
0 Likes
1,852

PD: This method:

  CALL METHOD go_custom_container->set_visible

                 EXPORTING

                      visible = cl_gui_control=>visible_false.

Is not valid, because the space remains, is the same result that uninicializate it.

Read only

Former Member
0 Likes
1,853

Hi,

Try the below option, if you are not able to achieve by element properties..

Create a new blank sub screen and call it dynamically.

If you want to have the custom control, then call the existing screen as sub screen. If you dont want the custom control in display, pass the new sub screen number to call the sub screen.

Thanks,

Balu.

Read only

0 Likes
1,852

Thanks, I had tried it and it works, but I want a cleaner solution (I think probably is imposible).

Read only

Former Member
0 Likes
1,852

Hi

in second screen PBO ,check your condition and if the condition is ok then decide about creating custom control object and also write :

for example:

Data:Guitxt           type ref to cl_gui_textedit,
       container1     type ref to cl_gui_custom_container.

I want to load a gui text in customer control .


if not condition is ok ."  you dont want to display

if Guitxt is initial ."   TEXT
     create object: container1 exporting container_name = 'XUST1'.
     create object:
        Guitxt exporting parent = container1.
  endif.

endif .


if condition  ok .
  LOOP AT SCREEN.
  SCREEN-invisible = 1 .
  MODIFY SCREEN .
  ENDLOOP.
ENDIF.

I checked it.ıf you did not understand please inform me to put here code completely.


Reza Rostami - Saphiran.com


Read only

0 Likes
1,852

Thanks, but I didn't create the object. The blank space, the "square" painted in the screen painter (in your example, the custom container 'XUST1'), remains without the container creation.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,852

Could you try to define the subscreen area as Resizable ?

Regards,

Raymond