10-16-2008 4:25 PM
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.
10-16-2008 4:58 PM
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.
10-16-2008 4:33 PM
from se38 utilities->settings (ABAP editor) set the length to 72 char for ABAP editor and then test ur program.
10-16-2008 4:37 PM
its already set to 72 .
the problem is still there .
I am getting that runtime error.
10-16-2008 4:36 PM
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.
10-16-2008 4:47 PM
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.
10-16-2008 4:51 PM
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.
10-16-2008 4:58 PM
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.
10-16-2008 5:05 PM
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
10-16-2008 5:09 PM
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.
10-16-2008 6:26 PM
Thanks Vijay Babu Dudla for all your valuable time and support
that you had given me ..
Thank you