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

Runtime compression CL_GUI_TEXTEDIT-

Former Member
0 Likes
1,278

Hi,

Runtime compression when CL_GUI_TEXTEDIT->set_visible to FALSE

I have an Subscreen with a Custom Control called GREF_TEXT_9001_CONT of type CL_GUI_CUSTOM_CONTROL. I place the control GREF_TEXT_9001 of type CL_GUI_TEXTEDIT in it. No problem with that. Anyway here my code:

CREATE OBJECT gref_text_9001_cont
      EXPORTING
        container_name              = 'GREF_TEXT_9001_CONT'
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.

    CREATE OBJECT gref_text_9001
      EXPORTING
        parent                 = gref_text_9001_cont
        wordwrap_mode          = 2
        wordwrap_position      = 72
      EXCEPTIONS
        error_cntl_create      = 1
        error_cntl_init        = 2
        error_cntl_link        = 3
        error_dp_create        = 4
        gui_type_not_supported = 5
        OTHERS                 = 6.

The user can set the control to invisible and visible by pressing a button. Here I use the gref_text_9001->set_visible method and the gref_text_9001_cont->set_visible methods. No problem with that either.

The problem is that the textedit control occupies lines 1-10 on the screen. Followed by that are numerous other fields which we also manipulate in a LOOP AT SCREEN statement. When I set all fields of a line to invisible, this line disappears as it should (runtime compression). Only the custom control does not react to the runtime compression and in case of a invisible textedit we see line 1-10 empty. Anyone any suggestions on that? I'm pretty sure I have just forgotten to set a flag or something.

Thanks a lot in advance,

Nina

Edited by: Nina Majic on Mar 3, 2010 11:43 AM

6 REPLIES 6
Read only

Former Member
0 Likes
1,083

Hi Nina,

I could understand your issue to some extent. But before solving it,

I can see that your code misses a "small convention" while creating a Custom Object

**you should create the custom container object and custom object only once in your program's run time.

so, just try to add these below added lines into your code.

There is a slight chance of your problem to get rectified.



IF gref_text_9001_cont is INITIAL. """""""""""create only if the object doesn't exist
CREATE OBJECT gref_text_9001_cont
      EXPORTING
        container_name              = 'GREF_TEXT_9001_CONT'
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.
 ENDIF.

IF gref_text_9001 IS INITIAL. """""""same, create the object only if it doesn't exist
    CREATE OBJECT gref_text_9001
      EXPORTING
        parent                 = gref_text_9001_cont
        wordwrap_mode          = 2
        wordwrap_position      = 72
      EXCEPTIONS
        error_cntl_create      = 1
        error_cntl_init        = 2
        error_cntl_link        = 3
        error_dp_create        = 4
        gui_type_not_supported = 5
        OTHERS                 = 6.
ENDIF

Further,

can you show the code where you are trying to call the method "SET_VISIBLE" so that we can continue solving your problem.

Also, confirm in which part it is i.e., PAI or PBO.

Regards,

Shravan Parepalli

Read only

0 Likes
1,083

Hi Shravan,

thanks a lot for your reply. The coding convention that you have mentioned is already in the code. I just didn't copy those line in here.

As requested here the code from the PBO module. If certain conditions are met I call

CALL METHOD gref_text_9001->set_visible
      EXPORTING
        visible           = gref_text_9001->visible_false
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.

    CALL METHOD gref_text_9001_cont->set_visible
      EXPORTING
        visible           = gref_text_9001_cont->visible_false
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.

The controls are invisible but the runtime compression does not work. Line 1 to 10 on the subscreen are blank/empty.

Best Regards,

Nina

Edited by: Nina Majic on Mar 4, 2010 12:22 PM

Read only

0 Likes
1,083

Hi Nina,

I think that is because you are not Delete-ing/Free-ing the custom container object.

Hence, to my knowledge, if would occupy its space on the screen.

I think deleting the objects, both custom container and the custom object,

(ofcourse, by persisting the existing data into a backup variable)

your query would work.

Regards,

Shravan Parepalli

Read only

0 Likes
1,083

Hi Nina,

I think that is because you are not Delete-ing/Free-ing the custom container object.

Hence, to my knowledge, if would occupy its space on the screen.

I think deleting the objects, both custom container and the custom object,

(ofcourse, by persisting the existing data into a backup variable)

your query would work.

Regards,

Shravan Parepalli

Read only

0 Likes
1,083

Hi Shravan,

Thanks for your reply. I have already tried freeing the objects. It does not help. The space that the Custom Control

occupies on the screen seems to be fixed. Even if I do not instanciate the objects at all the space stays empty.

It think this has to be solved with two subscreens, an empty one and one with the custom control and depending on

the conditions calling one or the other in PBO.

Regards,

Nina

Read only

0 Likes
1,083

Hi Nina,

You are right. This can be achieved by two subscreens. This would work as en expand/collapse functionality like i.e. in t-code ME21N. All you need is just to trigger PBO where you determine in turn whether to show empty subscreen or the one with the conrtrol inside.

Please refer to my awser to get more details how to implement this.

Regards

Marcin