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: 

ALV Dump error

Former Member
0 Kudos

HI ALL,

when I try to execute my alv its going for dump throwing the below error.Can anyone help me .

Pls do not send any code samples or any links .

I debugged further to find that

in the include :LSLVCF36

the <ls_fcat>-indx_field is initial.

if not <ls_fcat>-indx_field is initial.

assign component <ls_fcat>-indx_field

of structure <ls_data> to <l_field_value>.

else.

assign component <ls_fcat>-fieldname

of structure <ls_data> to <l_field_value>.

endif.

macro_cell_data_get

<ls_fcat>

<ls_data>

<l_field_value>

ls_lvc_data-value.

My code is below.

REPORT zcreate.

tables:vbak.

TYPE-POOLS : slis.

DATA : oref1 TYPE REF TO cl_gui_alv_grid.

DATA : ALV_CONTAINER TYPE REF TO cl_gui_custom_container.

DATA: GS_FCAT type lvc_t_fcat,

LS_FCAT type lvc_s_fcat,

it_lvcfcat type SLIS_T_FIELDCAT_ALV,

it_layout TYPE SLIS_LAYOUT_ALV.

DATA : ROW TYPE C LENGTH 3.

types: BEGIN OF tp_vbak ,

matnr like mara-matnr,

ERNAM like mara-ERNAM,

END OF tp_vbak.

*data : t_vbak type standard TABLE OF tp_vbak.

*

TOP-OF-PAGE.

DATA: BEGIN OF t_vbak OCCURS 0,

matnr like mara-matnr,

ERNAM like mara-ERNAM,

END OF t_vbak.

*

*

*CLASS EVENTHANDLE DEFINITION.

  • PUBLIC SECTION .

*

  • CLASS-METHODS: CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID IMPORTING E_ROW E_COLUMN ES_ROW_NO .

*ENDCLASS.

*

*&----


**& Class (Implementation) EVENTHANDLE

*&----


    • Text

*----


class EVENTHANDLE implementation.

METHOD CLICK .

perform double_click using e_row e_column es_row_no.

endmethod.

  • DATA: row TYPE lvc_s_roid,

  • wa_vbak type tp_vbak.

*

  • read table t_vbak into wa_vbak index e_row-index.

*

  • SET PARAMETER ID 'MAT' FIELD wa_vbak-matnr.

  • CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

endclass. "EVENTHANDLE

START-OF-SELECTION.

SELECT matnr ERNAM from mara INTO TABLE t_vbak where meins = 'EA'.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'KRISHNA'.

SET TITLEBAR 'krishna1'.

DATA : PROG TYPE SY-REPID,

PROG1 TYPE SY-REPID.

perform lay changing it_layout.

PERFORM CATALOG CHANGING GS_FCAT.

IF ALV_CONTAINER IS INITIAL.

CREATE OBJECT alv_container

EXPORTING

container_name = 'ALV'

dynnr = '100'.

IF oref1 IS INITIAL.

CREATE OBJECT oref1

EXPORTING

i_parent = ALV_CONTAINER.

ENDIF.

ENDIF.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'T_VBAK'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = IT_FIELDCAT

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'LVC_TRANSFER_FROM_SLIS'

EXPORTING

it_fieldcat_alv = IT_FIELDCAT

  • IT_SORT_ALV =

  • IT_FILTER_ALV =

IMPORTING

ET_FIELDCAT_LVC = it_lvcfcat

  • ET_SORT_LVC =

  • ET_FILTER_LVC =

  • ES_LAYOUT_LVC =

tables

it_data = T_VBAK

  • EXCEPTIONS

  • IT_DATA_MISSING = 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.

ENDIF.

SET HANDLER: EVENTHANDLE=>click FOR oref1.

CALL METHOD oref1->set_table_for_first_display

EXPORTING

IS_LAYOUT = IT_LAYOUT

CHANGING

it_outtab = T_VBAK[]

IT_FIELDCATALOG = GS_FCAT

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

others = 4

.

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.

endif.

endif.

*

DATA:

ld_row TYPE i,

wa_vbak type tp_vbak.

CALL METHOD oref1->get_current_cell

IMPORTING

e_row = ld_row.

READ TABLE t_vbak INTO wa_vbak INDEX ld_row.

CHECK ( syst-subrc = 0 ).

ENDMODULE. " STATUS_0100 OUTPUT

I have tried using simple function modules also but getting the same error.

Regards,

Krishna.

4 REPLIES 4

former_member181995
Active Contributor
0 Kudos

Check you fieldcat carefully.all vause which is in quotes(' ')should be define in caps

Former Member
0 Kudos

Hi,

Set_table_for_first_display refers to GS_FCAT.

But field catalog is actually in it_lvcfcat.

Check it again.

Regards

Meenakshi

  • Reward if useful

former_member188685
Active Contributor
0 Kudos

Problem is here...

*TOP-OF-PAGE. <---comment this..

DATA: BEGIN OF t_vbak OCCURS 0,
matnr like mara-matnr,
ERNAM like mara-ERNAM,
END OF t_vbak.

Fieldcatalog merge Function is not Recognizing the Table Definition. Table should be Global. But you mentioned under the Event TOP-OF-PAGE.

Former Member
0 Kudos

Thanks all.