Skip to Content
0
Former Member
Feb 11, 2008 at 07:01 AM

ALV in heirarchy format

15 Views

Please help me with the code. I am getting error dump and the error is 'field symbol has not been assigned'.

I am using two tables spfli and scarr to display data using ALV in heirarchy format.

TABLES:

spfli.

TYPE-POOLS:

slis.

DATA:

it_scarr TYPE STANDARD TABLE OF scarr,

it_spfli TYPE STANDARD TABLE OF spfli,

gt_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv.

data:

wa_keyinfo type slis_keyinfo_alv.

SELECT-OPTIONS:

s_carrid FOR spfli-carrid,

s_connid FOR spfli-connid.

START-OF-SELECTION.

PERFORM get_spfli.

PERFORM fill_fieldcat.

END-OF-SELECTION.

PERFORM display_data.

FORM display_data .

wa_keyinfo-header01 = 'CARRID'.

wa_keyinfo-item01 = 'CARRID'.

wa_keyinfo-header02 = SPACE.

wa_keyinfo-item02 = 'CONNID'.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

IT_FIELDCAT = gt_fieldcat[]

i_tabname_header = 'SCARR'

i_tabname_item = 'SPFLI'

is_keyinfo = wa_keyinfo

tables

t_outtab_header = IT_SCARR[]

t_outtab_item = IT_SPFLI[].

IF sy-subrc <> 0.

ENDIF.

ENDFORM.

FORM get_spfli .

SELECT *

INTO TABLE it_spfli[]

FROM spfli

WHERE carrid in s_carrid

AND connid in s_connid.

if sy-subrc <> 0.

message i000(ydn) with 'no records found'.

leave list-processing.

endif.

SELECT *

INTO TABLE it_scarr[]

FROM scarr

FOR ALL ENTRIES IN it_spfli

WHERE carrid = it_spfli-carrid.

ENDFORM.

FORM fill_fieldcat .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_internal_tabname = 'IT_SCARR'

i_structure_name = 'SCARR'

CHANGING

ct_fieldcat = gt_fieldcat[]

.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_internal_tabname = 'IT_SPFLI'

i_structure_name = 'SPFLI'

CHANGING

ct_fieldcat = gt_fieldcat[]

.

IF sy-subrc <> 0.

ENDIF.

ENDFORM.

Please tell me what is wrong with the code.

Thanks in advance.