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

Dump while CALL METHOD go_grid3->free.

Former Member
0 Likes
2,020

It was working fine earlier.  For some reason, now it is giving dump.  How to avoid this ?

   MODULE user_command_0101 INPUT.

CASE ok_code.
    WHEN 'RETURN'(042).

      LEAVE TO SCREEN 0.

    WHEN 'OVERVIEW'.

*****Free the Overview screen GRID before calling the Overview screen 100
      CALL METHOD go_grid1->free.
      CALL METHOD go_custom_container1->free.
      CLEAR go_custom_container1.

        IF go_grid3 IS BOUND.                 
*-------Free the detailed screen GRID, before calling the detailed screen 103
        CALL METHOD go_grid3->free.                  <<<<<<<<<<<<<<<<<<<<<<<<DUMPING here
        CALL METHOD go_custom_container3->free.
        CLEAR go_custom_container3.
      ENDIF.      "       IF go_grid3 IS BOUND. 

In debugging, I saw the below values:

GO_GRID3                                     {O:55*\CLASS=CL_GUI_ALV_GRID}

GO_CUSTOM_CONTAINER3                                     {O:INITIAL}

It was working fine earlier.  For some reason, now it is giving dump.  How to avoid this ?

   MODULE user_command_0101 INPUT.

CASE ok_code.
    WHEN 'RETURN'(042).

      LEAVE TO SCREEN 0.

    WHEN 'OVERVIEW'.

*****Free the Overview screen GRID before calling the Overview screen 100
      CALL METHOD go_grid1->free.
      CALL METHOD go_custom_container1->free.
      CLEAR go_custom_container1.

        IF go_grid3 IS BOUND.                 
*-------Free the detailed screen GRID, before calling the detailed screen 103
        CALL METHOD go_grid3->free.                  <<<<<<<<<<<<<<<<<<<<<<<<DUMPING here
        CALL METHOD go_custom_container3->free.
        CLEAR go_custom_container3.
      ENDIF.      "       IF go_grid3 IS BOUND. 

In debugging, I saw the below values:

GO_GRID3                                     {O:55*\CLASS=CL_GUI_ALV_GRID}

GO_CUSTOM_CONTAINER3                                     {O:INITIAL}

5 REPLIES 5
Read only

wol
Active Participant
0 Likes
1,178

Are you sure that the dump occurs because of

GO_GRID3? It seems as if the dump occurs because of

GO_CUSTOM_CONTAINER3 because this is not bound.

To avoid the dump only call FREE if GO_CUSTOM_CONTAINER3 is bound.

Regards,

Stefan

Read only

former_member193464
Contributor
0 Likes
1,178

Hi ,
     Yes looks like dump is because of GO_CUSTOM_CONTAINER3 as it is initial . but still , if the dump comes .please write down what it says.

Read only

0 Likes
1,178

Hello,

if you have an object reference variable which does not refer to an object (e. g. no object created or cleared the variable) you can not call any (instance) method of this object - because there is no object.

To avoid this you can follow these strategies:

  1. Make sure that the variable refers to an object before calling a method of it.
    Could e. g. be in the constructor or on program beginning.
    This is my preferred approach because you can ensure that program logic is consistent.
  2. Check if the variable references to a valid object, e. g:
    IF my_object IS BOUND.
      call my_object->a_metehod( ).
    ELSE.
      "what needs to be done?
    ENDIF.
  3. Create the object if needed, e. g.
    IF my_object IS NOT BOUND.
      create object my_object.
    ENDIF.
    call my_object->a_metehod( ).

Hope this is helpful.

Regards,

Stefan

Read only

Former Member
0 Likes
1,178

Hello Sam,

What is the parent container for go_grid3?, I am getting the feeling that the parent container is

go_custom_container1 and hence the dump.

If so, it would dump at that point.This is due to the fact that  you are freeing the custom container  go_custom_container1 in the frontend, thereby freeing the dependent  ALV control automatically in the front end.

This is a typical issue when freeing controls out of sequence . When you use the method Control->free( ) you are sending a message to the SAP GUI to free the custom control at the frontend.

 

Thanks,

Venkat

Read only

0 Likes
1,178

Also,

If the parent container is  go_custom_container3 then it would still dump because the container was free'd before the method call   

CALL METHOD go_grid3->free

, or the container was never intialized at the frontend in the PBO cycle.

Thanks,

Venkat.