cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Program errors

Former Member
0 Kudos

Hello all,

I've have a strange error, when trying to use buttons from top of an ALV list(eg. print). An error message appear with text "Program errors", but only when one button is used, in rest the list is ok.

Do you have an ideea why?

Thank you!

Bogdan

Here is the code, if is helping:

IF g_cont_alv2 IS INITIAL.

CREATE OBJECT g_cont_alv2

EXPORTING container_name = 'G_CONT_ALV2'.

CREATE OBJECT g_grid2

EXPORTING i_parent = g_cont_alv2.

ENDIF.

l_layout-cwidth_opt = 'X'.

l_layout-sel_mode = 'D'.

l_layout-totals_bef = 'X'.

CALL METHOD g_grid2->set_table_for_first_display

EXPORTING is_variant = l_variant

i_save = 'A'

i_default = 'X'

is_layout = l_layout

  • it_toolbar_excluding = lt_exclude

CHANGING it_outtab = lt_stats

it_fieldcatalog = lt_fcat.

LEAVE TO SCREEN 200.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It seems your data table <b>lt_stats</b> is a local internal table declared inside a subroutine and not a global internal table declared in TOP include or if it is a report then at the top.

Normally ALV Grid stores a reference of the internal table for accessing it later (in your case, for printing). If it is a local internal table then ALV will not be access it and hence the error message.

So try declaring your <b>lt_stats</b> table in the TOP include (for modulepools or function groups) or at the top (if it is a report).

<b>Did you try this out?</b> <b>You need to declare your internal table at GLOBAL level.</b>

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

Answers (4)

Answers (4)

former_member188685
Active Contributor
0 Kudos

hi If it is not important one then try to exclude from tool bar.

regards

vijay

abdul_hakim
Active Contributor
0 Kudos

Hi,

Try using a docking container instead Normal container.

For eg,

DATA doc TYPE REF TO cl_gui_docking_container.

CREATE OBJECT doc EXPORTING extension = '3000'.

and replace LEAVE TO SCREEN 200 with CALL SCREEN 200.

Regards,

Abdul

former_member188685
Active Contributor
0 Kudos

hi

i am sorry .. i was confused..

regards

vijay

Message was edited by: Vijay Babu Dudla

Former Member
0 Kudos

can you please clear the problem regarding single and multiple buttons.

regards,

siddarth

Former Member
0 Kudos

Sorry, I meant for any buttons no only for print

Bogdan

former_member188685
Active Contributor
0 Kudos

Try to use exclude

DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.

don't pass any thing to that ust give in call method .

CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
      IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
      IS_VARIANT           = LS_VARI
      IS_LAYOUT            = GS_LAYOUT
      I_SAVE               = 'A'
    CHANGING
      IT_FIELDCATALOG      = IT_FIELDCAT
      IT_OUTTAB            = IT_FINAL[].