Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error ALV_FIELDCATALOG_MERGE

Hiee friends ,

I was trying out a program in ALV fieldcatalog merge with ALV Listdisplay .

The program in error free , but its creating a runtime error .

In the runtime error its showing that :

The ABAP Program lines are wider than the internal table .

The internal table "FUNCTION=K_KKB_FIELDCAT_MERGE\DATA=L_ABAP_SOURCE[]" is 72 characters wide.

The program line is 118 characters wide.

I am forwarding the full source code of the program :

REPORT zalv_simple.

TABLES : sflight .

DATA : BEGIN OF t_flight OCCURS 100,

carrid TYPE sflight-carrid,

connid TYPE sflight-connid,

fldate TYPE sflight-fldate,

planetype TYPE sflight-planetype ,

END OF t_flight.

TYPE-POOLS : slis.

DATA : it_fcat TYPE slis_t_fieldcat_alv,

drepid LIKE sy-repid.

SELECT-OPTIONS : s_carrid FOR sflight-carrid.

START-OF-SELECTION.

SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE t_flight WHERE carrid IN s_carrid ."AND connid IN s_connid.

drepid = sy-repid.

END-OF-SELECTION.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = drepid

i_internal_tabname = 'T_FLIGHT'

i_inclname = drepid

CHANGING

ct_fieldcat = it_fcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE : 'ERROR:',sy-subrc, 'When create fieldcatalog'.

EXIT.

ENDIF.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = drepid

it_fieldcat = it_fcat

TABLES

t_outtab = t_flight

EXCEPTIONS

program_error = 1

OTHERS = 2

.

IF sy-subrc <> 0.

WRITE : 'ERROR:',sy-subrc, 'When create listdisplay'.

EXIT.

ENDIF.

Tags:
replied

error because you declared using TYPE, it should be LIKE

REPORT zalv_simple.
TABLES : sflight .
DATA : BEGIN OF t_flight OCCURS 100,
carrid LIKE sflight-carrid,   "use LIKE instead of TYPE
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
planetype LIKE sflight-planetype ,
END OF t_flight.
 
TYPE-POOLS : slis.
DATA : it_fcat TYPE slis_t_fieldcat_alv,
drepid LIKE sy-repid.
 
SELECT-OPTIONS : s_carrid FOR sflight-carrid.
START-OF-SELECTION.
SELECT carrid
             connid 
             fldate
             planetype
 FROM sflight 
INTO  TABLE t_flight 
WHERE carrid IN s_carrid .
"AND connid IN s_connid.
 
drepid = sy-repid.
 
END-OF-SELECTION.
 
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = drepid
i_internal_tabname = 'T_FLIGHT'
i_inclname = drepid
CHANGING
ct_fieldcat = it_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc ne 0.
WRITE : 'ERROR:',sy-subrc, 'When create fieldcatalog'.
EXIT.
ENDIF.
 
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = drepid
it_fieldcat = it_fcat
TABLES
t_outtab = t_flight
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc ne  0.
WRITE : 'ERROR:',sy-subrc, 'When create listdisplay'.
EXIT.
ENDIF.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question