2007 Jul 12 11:19 AM
Hi,
This is sandeep..
i am trying to work on ALV's by using REUSE_ALV_FIELDCATALOG_MERGE and REUSE_ALV_GRID_DISPLAY...i am getting dump in my program..
The details of Error is..,
Runtime Errors: READ_REPORT_LINE_TOO_LONG
Exception: CX_SY_READ_SRC_LINE_TOO_LONG
Short Text:
The ABAP program lines are wider than the internal table.
Module Name: K_KKB_FIELDCAT_MERGE
LineNo: 365
SourceCode: <u>Read report l_prog_tab_local into l_abap_source.</u>
Please help me on this issue...
below i am giving the code...
TABLES: MARA.
TYPE-POOLS:SLIS.
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
data gs_layout type slis_layout_alv.
DATA V_REPID TYPE SY-REPID.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
END OF I_MARA.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
V_REPID = SY-REPID.
SELECT MATNR MATKL MTART FROM MARA INTO TABLE I_MARA WHERE MATNR IN S_MATNR.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'I_MARA'
I_INCLNAME = V_REPID
CHANGING
CT_FIELDCAT = I_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND =
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = gs_layout
IT_FIELDCAT = I_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = I_MARA.
Thanks & Regards,
Sandeep.
2007 Jul 12 11:28 AM
hi,
now check it
TABLES: MARA.
TYPE-POOLS:SLIS.
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
data gs_layout type slis_layout_alv.
DATA V_REPID TYPE SY-REPID.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
END OF I_MARA.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
V_REPID = SY-REPID.
SELECT MATNR MATKL MTART FROM MARA INTO TABLE I_MARA WHERE MATNR IN
S_MATNR.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'I_MARA'
I_INCLNAME = V_REPID
CHANGING
CT_FIELDCAT = I_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND =
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = gs_layout
<b>IT_FIELDCAT = I_FIELDCAT[]</b>
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
ES_EXIT_CAUSED_BY_USER =
TABLES
<b>T_OUTTAB = I_MARA[].</b>
regards
ASHOK KUMAR
2007 Jul 12 11:28 AM
hi sandeep,
just split the select query u have written.
this is bcoz of the length of the report
SELECT MATNR MATKL MTART
FROM MARA
INTO TABLE I_MARA
WHERE MATNR IN S_MATNR.
Regards,
Padma.
2007 Jul 12 11:28 AM
hi,
check this example change code like this.
&----
*& Report ZSR_ALV_GRID
*&
&----
*&
*&
&----
REPORT ZSR_ALV_GRID.
&----
*& declaratin of table *
*& *
&----
TABLES : lfa1.
&----
declaraing selectoptions *
&----
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr.
&----
declaraing internal table *
&----
DATA : BEGIN OF itab OCCURS 0,
lifnr LIKE lfa1-lifnr,
land1 LIKE lfa1-land1,
name1 LIKE lfa1-name1,
END OF itab.
&----
declaraing TYPEPOLL SLIS *
&----
TYPE-POOLS : slis.
DATA : b_lfa1 TYPE slis_t_fieldcat_alv,
w_lfa1 TYPE slis_fieldcat_alv.
START-OF-SELECTION.
&----
retrieving data from lfa1*
&----
SELECT lifnr
land1
name1
FROM lfa1
INTO TABLE itab
WHERE lifnr IN s_lifnr.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_STRUCTURE_NAME = 'LFA1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = B_LFA1
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
&----
calling fn modlue alv_list_display
&----
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'lfa1'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = b_lfa1
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
2007 Jul 12 11:33 AM
Hi
change:
<b>SELECT MATNR MATKL MTART FROM MARA INTO TABLE I_MARA WHERE MATNR IN S_MATNR.</b>
into
<b>SELECT MATNR MATKL MTART FROM MARA
INTO TABLE I_MARA WHERE MATNR IN S_MATNR.</b>
because the line has more than 72 char
Regards, Dieter