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: 

Program crash when scrolling ALV table

muffy13
Explorer
0 Kudos

Hello, I am learning ABAP and for a few days, Im stuck in a problem of program crash when scrolling through ALV table. Everything worked perfectly when I used REUSE_ALV_GRID_DISPLAY and for field catalog SLIS_FIELDCAT_ALV. But then I had to switch to CL_GUI_ALV_GRID and LVC_S_LAYO with related changes. After that, scrolling crash problem appeared. No big data, just normal IDs, names etc. and max amount of results should be 513 rows and 3 columns. Interesting thing is, the more columns i add, the earlier i get the crash in scrolling. Dump text is "Field symbol has not been assigned yet."

Did someone faced similar issue and how did you fixed this? 😞 Thank you

This is ALV part of the code. Filling of the table etc. is right above this:

 DATA: lo_alv type ref to cl_gui_alv_grid,
  
lo_custom_container TYPE REF TO cl_gui_custom_container,
lt_fcat TYPE lvc_t_fcat,
ls_fcat TYPE lvc_s_fcat,
ls_layout TYPE lvc_s_layo.
IF lo_custom_container IS INITIAL. "neboli pokud objekt Kontejner neexistuje...
CREATE OBJECT lo_custom_container "...tak ho vytvoř
EXPORTING
* parent =
container_name = 'CUSTOM_CONTAINER'
* style =
* lifetime = lifetime_default
* repid =
* dynnr =
* no_autodef_progid_dynnr =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
CREATE OBJECT lo_alv
EXPORTING
i_parent = lo_custom_container.
* ls_layout-col_opt = 'X'.
* ls_layout-stylefname = 'STYLE'.

* DATA lt_fcat TYPE slis_t_fieldcat_alv.
* DATA ls_fcat TYPE slis_fieldcat_alv.
clear ls_fcat.
ls_fcat-col_pos = '1'.
ls_fcat-fieldname = 'object_id'.
ls_fcat-coltext = 'Číslo hlášení'.
append ls_fcat to lt_fcat.
clear ls_fcat.
ls_fcat-col_pos = '2'.
ls_fcat-fieldname = 'description'.
" ls_fcat-seltext_L = 'Popis hlášení'.
ls_fcat-coltext = 'Popis hlášení'.
append ls_fcat to lt_fcat.
clear ls_fcat.
ls_fcat-col_pos = '3'.
ls_fcat-fieldname = 'created_by'.
ls_fcat-coltext = 'Uživatel'.
append ls_fcat to lt_fcat.
" DATA: lo_container TYPE REF TO cl_gui_container.
CALL METHOD lo_alv->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
is_layout = ls_layout
CHANGING
it_outtab = lt_crmd_orderadm_h
it_fieldcatalog = lt_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
*** call FUNCTION 'REUSE_ALV_GRID_DISPLAY'
*** exporting
**** I_INTERFACE_CHECK = SPACE
**** I_BYPASSING_BUFFER = SPACE
**** I_BUFFER_ACTIVE = SPACE
**** I_CALLBACK_PROGRAM = SPACE
**** I_CALLBACK_PF_STATUS_SET = SPACE
**** I_CALLBACK_USER_COMMAND = SPACE
**** I_CALLBACK_TOP_OF_PAGE = SPACE
**** I_CALLBACK_HTML_TOP_OF_PAGE = SPACE
**** I_CALLBACK_HTML_END_OF_LIST = SPACE
**** I_STRUCTURE_NAME =
**** I_BACKGROUND_ID =
**** I_GRID_TITLE =
**** I_GRID_SETTINGS =
**** IS_LAYOUT =
*** IT_FIELDCAT = lt_fcat
**** IT_EXCLUDING =
**** IT_SPECIAL_GROUPS =
**** IT_SORT =
**** IT_FILTER =
**** IS_SEL_HIDE =
**** I_DEFAULT = 'X'
**** I_SAVE = SPACE
**** IS_VARIANT =
**** IT_EVENTS =
**** IT_EVENT_EXIT =
**** IS_PRINT =
**** IS_REPREP_ID =
**** I_SCREEN_START_COLUMN = 0
**** I_SCREEN_START_LINE = 0
**** I_SCREEN_END_COLUMN = 0
**** I_SCREEN_END_LINE = 0
**** I_HTML_HEIGHT_TOP = 0
**** I_HTML_HEIGHT_END = 0
**** IT_ALV_GRAPHICS =
**** IT_HYPERLINK =
**** IT_ADD_FIELDCAT =
**** IT_EXCEPT_QINFO =
**** IR_SALV_FULLSCREEN_ADAPTER =
**** importing
**** E_EXIT_CAUSED_BY_CALLER =
**** ES_EXIT_CAUSED_BY_USER =
*** tables
*** T_OUTTAB = lt_crmd_orderadm_h
**** exceptions
**** PROGRAM_ERROR = 1
**** OTHERS = 2
*** .
*** if sy-subrc <> 0.
**** message id sy-msgid type sy-msgty number sy-msgno
**** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*** "break kalivodova.
*** endif.
1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

Crash when scrolling ALV makes me immediately think that you have passed a LOCAL internal table to the ALV:

CALL METHOD lo_alv->SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
    is_layout = ls_layout
  CHANGING
    it_outtab = lt_crmd_orderadm_h
...

i.e. the argument of IT_OUTTAB should not be a local internal table.

Only global variables or public attributes of alive instances can work with ALV (especially when scrolling but for other features too).

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!

Sandra_Rossi
Active Contributor

Crash when scrolling ALV makes me immediately think that you have passed a LOCAL internal table to the ALV:

CALL METHOD lo_alv->SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
    is_layout = ls_layout
  CHANGING
    it_outtab = lt_crmd_orderadm_h
...

i.e. the argument of IT_OUTTAB should not be a local internal table.

Only global variables or public attributes of alive instances can work with ALV (especially when scrolling but for other features too).

0 Kudos

Or perhaps a field name on the field cat is different from the table.

0 Kudos

Thank you so much, you were right! ❤️