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: 

error in ALV report.

Former Member
0 Kudos

Hi friends,

This is the code intended for ALV interactive

But its going to short dump.

Please trace the error in it.

REPORT ZTEST_ALV .

TYPE-POOLS : SLIS.

DATA: VT_FIELDCAT TYPE slis_t_fieldcat_alv.

DATA: VT_FIELDCAT1 TYPE slis_t_fieldcat_alv.

DATA : BEGIN OF ITAB OCCURS 0,

P1 TYPE I VALUE 2,

P3 TYPE I VALUE 3,

END OF ITAB.

APPEND ITAB.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = VT_FIELDCAT.

.

IF SY-SUBRC <> 0.

ENDIF.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_USER_COMMAND = 'DISP_DETAIL'

IT_FIELDCAT = vt_fieldcat

TABLES

T_OUTTAB = ITAB.

IF SY-SUBRC <> 0.

ENDIF.

FORM DISP_DETAIL USING ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

IF ucomm = '&IC1'.

READ TABLE ITAB INDEX selfield-tabindex.

IF sy-subrc = 0.

DATA : ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.

LOOP AT ITAB .

MOVE 6 TO ITAB1-P1.

MOVE 6 TO ITAB-P3.

APPEND ITAB1.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB1'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = VT_FIELDCAT1.

.

IF SY-SUBRC <> 0.

ENDIF.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = SY-REPID

it_fieldcat = VT_FIELDCAT1

TABLES

t_outtab = ITAB1.

ENDIF.

ENDIF.

ENDFORM.

1 REPLY 1

Former Member
0 Kudos

HI,

There was a problem with periods.U ended unexpectedly check them once again and

try this now.

regards,

Anilreddy

REPORT ZTEST_ALV .

TYPE-POOLS : SLIS.

DATA: VT_FIELDCAT TYPE slis_t_fieldcat_alv.

DATA: VT_FIELDCAT1 TYPE slis_t_fieldcat_alv.

DATA : BEGIN OF ITAB OCCURS 0,

P1 TYPE I VALUE 2,

P3 TYPE I VALUE 3,

END OF ITAB.

APPEND ITAB.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = VT_FIELDCAT.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_USER_COMMAND = 'DISP_DETAIL'

IT_FIELDCAT = vt_fieldcat

TABLES

T_OUTTAB = ITAB.

FORM DISP_DETAIL USING ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

IF ucomm = '&IC1'.

READ TABLE ITAB INDEX selfield-tabindex.

IF sy-subrc = 0.

DATA : ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.

LOOP AT ITAB .

MOVE 6 TO ITAB1-P1.

MOVE 6 TO ITAB-P3.

APPEND ITAB1.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB1'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = VT_FIELDCAT1.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = SY-REPID

it_fieldcat = VT_FIELDCAT1

TABLES

t_outtab = ITAB1.

ENDIF.

ENDIF.

ENDFORM.