‎2007 Jan 19 12:57 AM
hELLO FRIENDS,
i have a short dump in this report and the short dump is at
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
attached is the code.
REPORT ZSHEJAL.
TYPE-POOLS: SLIS.
DATA:BEGIN OF I_TAB1 OCCURS 0,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
ERDAT LIKE VBAK-ERDAT,
KUNNR LIKE VBAK-KUNNR,
END OF I_TAB1.
DATA : V_REPID LIKE SY-REPID.
DATA : T_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
INITIALIZATION.
V_REPID = SY-REPID.
START-OF-SELECTION.
PERFORM GET_FIELDCAT1.
SELECT VBELN BSTNK ERDAT KUNNR FROM VBAK INTO TABLE I_TAB1 UP TO 10 ROWS.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = T_FIELDCAT1
TABLES
T_OUTTAB = I_TAB1
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.
getting the data from internal table 1 to t_filedcat.
&----
*& Form get_fieldcat1
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET_FIELDCAT1 .
To generate the field catalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'I_TAB1'
I_INCLNAME = V_REPID
CHANGING
CT_FIELDCAT = T_FIELDCAT1.
ENDFORM. " get_fieldcat1
Thanks,
Shejal
‎2007 Jan 19 1:13 AM
&----
*& Report ZTEST_ALV
*&
&----
*&
*&
&----
REPORT ZTEST_ALV.
TYPE-POOLS: SLIS.
DATA:BEGIN OF I_TAB1 OCCURS 0,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
ERDAT LIKE VBAK-ERDAT,
KUNNR LIKE VBAK-KUNNR,
END OF I_TAB1.
DATA : V_REPID LIKE SY-REPID.
DATA : T_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
INITIALIZATION.
V_REPID = SY-REPID.
START-OF-SELECTION.
PERFORM GET_FIELDCAT1.
<u><b><b>SELECT VBELN BSTNK ERDAT KUNNR FROM VBAK INTO TABLE I_TAB1 UP TO 10 ROWS.</b></b></u>
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = T_FIELDCAT1
TABLES
T_OUTTAB = I_TAB1
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.
getting the data from internal table 1 to t_filedcat.
&----
*& Form get_fieldcat1
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET_FIELDCAT1 .
To generate the field catalog
*CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
*EXPORTING
*I_PROGRAM_NAME = V_REPID
*I_INTERNAL_TABNAME = I_TAB1
*I_INCLNAME = V_REPID
*CHANGING
*CT_FIELDCAT = T_FIELDCAT1.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = v_repid
I_INTERNAL_TABNAME = 'I_TAB1'
I_STRUCTURE_NAME = 'I_TAB1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = t_fieldcat1
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.
ENDFORM. " get_fieldcat1
Pass the Include Structure name and also see the Select statement is after the Field Catalog Merge...it should be before we call Field catalog merge
‎2007 Jan 19 1:04 AM
‎2007 Jan 19 1:06 AM
‎2007 Jan 19 1:10 AM
Where are you building your field catalogue in your program? Make the correction as stated in bold below in your program and try.
Check this link for sample ALV program using this FM:
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
FORM GET_FIELDCAT1 .
To generate the field catalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'I_TAB1'
I_INCLNAME = V_REPID
CHANGING
CT_FIELDCAT = <b>T_FIELDCAT1[].</b>
ENDFORM. " get_fieldcat1
Thanks,
Santosh
‎2007 Jan 19 1:13 AM
&----
*& Report ZTEST_ALV
*&
&----
*&
*&
&----
REPORT ZTEST_ALV.
TYPE-POOLS: SLIS.
DATA:BEGIN OF I_TAB1 OCCURS 0,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
ERDAT LIKE VBAK-ERDAT,
KUNNR LIKE VBAK-KUNNR,
END OF I_TAB1.
DATA : V_REPID LIKE SY-REPID.
DATA : T_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
INITIALIZATION.
V_REPID = SY-REPID.
START-OF-SELECTION.
PERFORM GET_FIELDCAT1.
<u><b><b>SELECT VBELN BSTNK ERDAT KUNNR FROM VBAK INTO TABLE I_TAB1 UP TO 10 ROWS.</b></b></u>
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = T_FIELDCAT1
TABLES
T_OUTTAB = I_TAB1
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.
getting the data from internal table 1 to t_filedcat.
&----
*& Form get_fieldcat1
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET_FIELDCAT1 .
To generate the field catalog
*CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
*EXPORTING
*I_PROGRAM_NAME = V_REPID
*I_INTERNAL_TABNAME = I_TAB1
*I_INCLNAME = V_REPID
*CHANGING
*CT_FIELDCAT = T_FIELDCAT1.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = v_repid
I_INTERNAL_TABNAME = 'I_TAB1'
I_STRUCTURE_NAME = 'I_TAB1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = t_fieldcat1
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.
ENDFORM. " get_fieldcat1
Pass the Include Structure name and also see the Select statement is after the Field Catalog Merge...it should be before we call Field catalog merge
‎2007 Jan 19 1:25 AM
Hi Srinivas
Checking after making the few changes:
TYPE-POOLS: SLIS.
DATA:BEGIN OF I_TAB1 OCCURS 0,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
ERDAT LIKE VBAK-ERDAT,
KUNNR LIKE VBAK-KUNNR,
END OF I_TAB1.
DATA : V_REPID LIKE SY-REPID.
DATA : T_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
INITIALIZATION.
V_REPID = SY-REPID.
START-OF-SELECTION.
PERFORM GET_FIELDCAT1.
SELECT VBELN BSTNK ERDAT KUNNR FROM VBAK INTO TABLE I_TAB1 UP TO 10 ROWS
.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = T_FIELDCAT1
TABLES
T_OUTTAB = I_TAB1
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.
getting the data from internal table 1 to t_filedcat.
&----
*& Form get_fieldcat1
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET_FIELDCAT1 .
To generate the field catalog
*CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
*EXPORTING
*I_PROGRAM_NAME = V_REPID
*I_INTERNAL_TABNAME = I_TAB1
*I_INCLNAME = V_REPID
*CHANGING
*CT_FIELDCAT = T_FIELDCAT1.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = v_repid
I_INTERNAL_TABNAME = 'I_TAB1'
<b>*I_STRUCTURE_NAME = 'I_TAB1'</b>
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = <b>t_fieldcat1[]</b>
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.
ENDFORM. " get_fieldcat1
Execute with the above code and let us know, if you still have problems????
Regards
Eswar
‎2007 Jan 19 2:01 AM
i thred the code as suggested. It still have the same problem.
Shejal
‎2007 Jan 19 2:15 AM
Hi Sheejal
Please try by doing <b>COPY-PASTE</b> of the below code:
TYPE-POOLS: SLIS.
DATA: BEGIN OF I_TAB1 OCCURS 0,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
ERDAT LIKE VBAK-ERDAT,
KUNNR LIKE VBAK-KUNNR,
END OF I_TAB1.
DATA : V_REPID LIKE SY-REPID.
DATA : T_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
INITIALIZATION.
V_REPID = SY-REPID.
START-OF-SELECTION.
PERFORM GET_FIELDCAT1.
SELECT VBELN BSTNK ERDAT KUNNR FROM VBAK
INTO TABLE I_TAB1 UP TO 10 ROWS.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = T_FIELDCAT1[]
TABLES
T_OUTTAB = I_TAB1
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.
* getting the data from internal table 1 to t_filedcat.
*&--------------------------------------------------------------------*
*& Form get_fieldcat1
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*---------------------------------------------------------------------*
FORM GET_FIELDCAT1 .
* To generate the field catalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'I_TAB1'
I_INCLNAME = V_REPID
CHANGING
CT_FIELDCAT = T_FIELDCAT1[].
ENDFORM. " get_fieldcat1Regards
Eswar
‎2007 Jan 19 2:18 AM
‎2007 Jan 19 2:19 AM
I believe the dump is related to some other part of the code and not with ALV related...
if you are still facing the dump... can you paste the entire dump report.. may be we get some more idea...
Thanks,
Santosh
‎2007 Jan 19 2:26 AM
Friends,
Just a doubt, does this dump relate to SETTINGS of ABAP editor???
I mean if the editor is not restricted to 72 chars per row, it can go more than 72 characters and most of the SAP code that were read internally are for 72 characters. I guess this might cause a problem.
Sheetal,
Can you check the settings.
SE38->Utilities->Settings->ABAP Editor->Editor->Downward Compat.Line Length(72).
Can you check if the check box is ON or OFF???
Regards
Eswar
‎2007 Jan 19 1:15 AM
‎2007 Jan 19 1:37 AM
the short dump
ShrtText
The ABAP source code lines are longer than the width of the internal
the dump is at
read report l_prog_tab_local into l_abap_source.
thanks,
Shejal.
‎2007 Jan 19 2:24 AM
THanks for all the help.
Here is the dump. I am working on version 5.0.
Eashwar, I copied ur program and ran without any modifications. It still has the same dump.
-
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_READ_SRC_LINE_TOO_LONG',
was neither
caught nor passed along using a RAISING clause, in the procedure
"K_KKB_FIELDCAT_MERGE" "(FUNCTION)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
You tried to read the program "ZASH_GRID_DRILL1" from the database. The READ
REPORT
statement allows you to copy a program's source code into an internal
table. The lines of source code must not be longer than the width of the
internal table. The internal table is 72 characters wide. The source
code line is 80 wide.
---
How to correct the error
The exception must either be prevented, caught within the procedure
"K_KKB_FIELDCAT_MERGE"
"(FUNCTION)", or declared in the procedure's RAISING clause.
To prevent the exception, note the following:
Probably the only way to eliminate the error is to correct the program.
Shejal.
‎2007 Jan 19 2:27 AM
When i made the below change it works.
DATA:BEGIN OF I_TAB1 OCCURS 0,
VBELN LIKE VBAK-VBELN,
BSTNK LIKE VBAK-BSTNK,
ERDAT LIKE VBAK-ERDAT,
*KUNNR LIKE VBAK-KUNNR,
END OF I_TAB1.
how can i make it work for more fields.
Shejal
‎2007 Jan 19 2:28 AM
i checked for the checkbox in utilities-abapeditor and its not checked.
Shejal
‎2007 Jan 19 2:31 AM
‎2007 Jan 19 2:37 AM
I definitly think that Eswar is on to something here. But I can't see why it is having a problem with the code above, except for may be that SELECT statement. It has been suggested to split that line in two, have you tried this?
The reason for the problem is that the MERGE function module actually reads the report source code and builds the FC from the source code. It is having trouble reading the source code of your program.
Regards,
Rich Heilman
‎2007 Jan 19 2:41 AM
Thanks Eswar for all the suggestions.
I tried with check box on. It is displaying only the 3 fields and is skipping KUNNR. i looked in the debug mode and
T_FIELDCAT1 has only 3 rows. It didnt get KUNNR. So i unchecked the box and the same results. I have kunnr in my data declaration for I_TAB1 and this internal table has data for KUnnr.
I dont understand this whats the reason.
ANyways thanks for all the suggestions.
Shejal
‎2007 Jan 19 2:43 AM
‎2007 Jan 19 2:51 AM
I have a different system version 4.7 and it aslso had the same problem. I mean it gace the same errror as well. SO in ABAP editor as suggested by ESWAR i checked the box which says about the length as 72. Ran the program again a short dump and then i unchecked itagain and now when i execute it displays the output.
Dosent make sense to me but works.
THanks all for all yiyr suggestions and help.
Shejal.
‎2007 Jan 19 2:55 AM
Does it do something with LOG-OFF and LOG-IN again after changing the settings???
Regards
Eswar
‎2007 Jan 19 3:03 AM
no i didnt log off.
however i did some more experiments..
i added one more field to the internal table. and now when i executed the program it didnt display the added field. i changes the settings and then tried it still didnt work, Logged off and logged in and still dosent work. I dont know why
THanks
ShejAL