Application Development 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: 

Is my code in abap objects correct?

Former Member
0 Kudos

Am new to abap objects. Is my coding correct? Can I use "IF GO_GRID3 IS NOT INITIAL".

MODULE user_command_0102 INPUT.

  CASE ok_code.
   
WHEN 'RETURN'(042).     

     CALL METHOD go_grid3->free.
     
CALL METHOD go_custom_container3->free.
     
CLEAR go_custom_container3.     

             LEAVE TO SCREEN 0.

   
WHEN 'OVERVIEW'.     

         IF GO_GRID3 IS NOT INITIAL.  " new code b's of dump - is it correct?
           
CALL METHOD go_grid3->free.

           
CALL METHOD go_custom_container3->free.
           
CLEAR go_custom_container3.    

          ENDIF.                " new code b's of dump
     
CALL METHOD go_grid1->free.

     
CALL METHOD go_custom_container1->free.
     
CLEAR go_custom_container1.

===================================

Basically, from overview screen (it is dumping)

In debugging, I have values like  below:

GO_GRID3                                                {O:INITIAL}

GO_CUSTOM_CONTAINER3                     {O:INITIAL}

GO_GRID1                                               {O:28*\CLASS=CL_GUI_ALV_GRID}

GO_CUSTOM_CONTAINER1                     {O:27*\CLASS=CL_GUI_CUSTOM_CONTAINER}

1 ACCEPTED SOLUTION

hendrik_brandes
Contributor
0 Kudos

Hello Sam,

you will have to use

IF go_grid3 is bound.

...

ENDIF.

Kind regards,

Hendrik

1 REPLY 1

hendrik_brandes
Contributor
0 Kudos

Hello Sam,

you will have to use

IF go_grid3 is bound.

...

ENDIF.

Kind regards,

Hendrik