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 ALV_FIELDCATALOG_MERGE

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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 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.

Now the runtime error is gone .

But i guess theres some problem in list display as i am getting

ERROR: 1 When create listdisplay.

9 REPLIES 9

Former Member
0 Kudos

from se38 utilities->settings (ABAP editor) set the length to 72 char for ABAP editor and then test ur program.

0 Kudos

its already set to 72 .

the problem is still there .

I am getting that runtime error.

former_member188685
Active Contributor
0 Kudos

break this code into 2 line.

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.

Even you can change the settings. But my suggestion would be Always make sure your should not exceed more than 72chars length. in the above case it crossed more than 72 chars. SAP programs follow 72chars in general.

Former Member
0 Kudos

I breaked this code but i am still getting the runtime error .

I am not able to understand where

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 94 characters wide.[118 characters changed to 94].

Where can i adjust these characters .

I am screwed over here ..this characters part.

0 Kudos

Copy paste this code as it is.

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 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.

Former Member
0 Kudos

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 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.

Now the runtime error is gone .

But i guess theres some problem in list display as i am getting

ERROR: 1 When create listdisplay.

0 Kudos
SELECT carrid
             connid 
             fldate
             planetype
 FROM sflight 
INTO  TABLE t_flight 
WHERE carrid IN s_carrid .
"AND connid IN s_connid.

the problem is with the above code, it exceeded more than 72chars , previously. in a single line you can't have code with more than 72 chars. that is causing the error.

now it is formatted. so you are not getting the error

0 Kudos

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.

Former Member
0 Kudos

Thanks Vijay Babu Dudla for all your valuable time and support

that you had given me ..

Thank you