Skip to Content
0
Former Member
Oct 24, 2012 at 03:30 PM

Is my code in abap objects correct?

18 Views

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}