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

OOPS ALV - Short dump

Former Member
0 Likes
907

Hi,

While i create a report with grid display with oops ALV using custom container, its giving short dump..

DUMP: CNTL ERROR ouccured..

7 REPLIES 7
Read only

alex_cook
Active Participant
0 Likes
845

Howdy,

Perhaps you could give a sample of your code so we can see what's going wrong - perhaps you haven't created the custom container object properly or assigned the grid to the correct parent.

OO is now endorsed by SAP as the programming methodology to use going forward. There are lots of advantages including easier to read and better flowing code, as well as better exception handling.

Cheers

Alex

Read only

Former Member
0 Likes
845

Hi Phani,

Make sure you have done below things correctly.

While creating a container control in SE51, make sure you have given a name to it in the attributes & use the same name in the ABAP code with data declaration as below:

Suppose you have named the container control in SE51 as CC_CONTAINER


DATA :
  g_Container TYPE scrfname VALUE 'CC_CONTAINER',
 g_Custom_Container TYPE REF TO CL_GUI_CUSTOM_CONTAINER
 g_Grid TYPE REF TO CL_GUI_ALV_GRID.

Also first create a CONTAINER object with reference to container name in the screen & then Create GRID object with reference to parent name


IF g_Custom_Container IS INITIAL.

    CREATE OBJECT g_Custom_Container EXPORTING CONTAINER_NAME = g_Container.
  
    CREATE OBJECT g_Grid EXPORTING I_PARENT = g_Custom_Container.

& Finally called method Set table for display for Grid as below :


" SET_TABLE_FOR_FIRST_DISPLAY
    CALL METHOD g_Grid->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING

Also make sure that you have activated the code in PBO & PAI in SE51.

With these it shouldnt give the above error.

Hope this helps.

Regards

Abhii

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
845

Hello Abhii,

You can still get errors if you try to execute your OO ALV in BG mode w/o proper handling

@OP: Provide further details for better answers.

BR,

Suhas

Read only

0 Likes
845

Dada but user has not mentioned so.

Regards

Abhii

Read only

0 Likes
845

Sorry i forgot to pass the SY-REPID .....Prob has been resolved

And i have on more doubt.....can create a selection screen for that.....

Becz, when ceate a sel-screen before calling of screen the select query(written in PBO) is not picking the sel-options variables

Thanks

Read only

Former Member
0 Likes
845

Can you please check if the container name you specified in the screen and the one you use in program are the same

Read only

Former Member
0 Likes
845

missed the sy-repid to the class, caused for the dump