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

call selection screen and ok_code

Former Member
0 Likes
2,145

hy folks i'm trying to managing a back to selection-screen from an alv grid using the ok_code

CASE save_ok_code.
WHEN
fcode_back OR
fcode_esc.
CALL METHOD grid->free.
CALL METHOD tree1->free.
CALL METHOD g_custom_container->free.
call selection-screen 1000.
when others.
endcase.

why the flow is like this.

AT SELECTION-SCREEN.
  IF sy-ucomm = 'ONLI' or sy-ucomm = 'CRET'.
    PERFORM acquisisci_rasn.
  ENDIF.

START-OF-SELECTION.
* Initialization Drag and Drop
  PERFORM init_dragdrop.

END-OF-SELECTION.
  g_repid = sy-repid.
  CALL SCREEN 100.

....

the problem is that after backing to the selection-screen, if you excute again the program, is dumping, the container and the grid are not loaded.

what do i miss?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,369

Hello,

I think there is some problem in your PBO logic.

AND clear the reference variable by using the Keyword FREE.

8 REPLIES 8
Read only

Former Member
0 Likes
1,370

Hello,

I think there is some problem in your PBO logic.

AND clear the reference variable by using the Keyword FREE.

Read only

Former Member
0 Likes
1,369

Hello Andre,

Try the following:


CASE save_ok_code.
WHEN
fcode_back OR
fcode_esc.
CALL METHOD grid->free.
CALL METHOD tree1->free.
CALL METHOD g_custom_container->free.
CLEAR: grid, tree1, g_custom_container.
call selection-screen 1000.
when others.
endcase.

Note the line: CLEAR: grid, tree1, g_custom_container.

Regards,

George

Read only

former_member195383
Active Contributor
0 Likes
1,369

This seems to be occuring because you are not handling exceptions while calling the free method.

Try to handle the exceptions as given in below code . Then the dump can be avoided

CALL METHOD cl_grid1->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • DO Nothing

ENDIF.

Read only

Former Member
0 Likes
1,369

Hi,

Clear your save_ok_code


CASE save_ok_code.
WHEN
fcode_back OR
fcode_esc.
CALL METHOD grid->free.
CALL METHOD tree1->free.
CALL METHOD g_custom_container->free.
clear save_ok_code.  "Add this
call selection-screen 1000.
when others.
endcase.

Read only

Former Member
0 Likes
1,369

Hi Andre,

Write the Checks before you use any references.

eg.,

if tree1 is BOUND.

do your operations .

ELSE.

CREATE REFERENCES

ENDIF.

this may solve your problem

Regards.

Seema

Read only

0 Likes
1,369

Check the references for the grid and tree.

Read only

0 Likes
1,369

solved the ussie. got some variables not cleared.

Read only

Former Member
0 Likes
1,369

got one variable not cleared.