07-24-2008 7:41 AM
Hi .
Iam using FM 'REUSE_ALV_FIELDCATALOG_MERGE' to create ALV report,its giving Dump like Exception condition "NO_FIELDCATALOG_AVAILABLE" raised ,colud you help me? how to fix it?
Reward for all helpfull answers,
Regards.
Krishna.
07-24-2008 7:42 AM
Make sure that you use UPPER CASE in naming your internal table in this function module
07-24-2008 7:43 AM
Make sure tht u r passing the correct internal table And most important it shud be given in CAPS
07-24-2008 7:43 AM
Hi,
Check your fieldcatalog,If you assign
wrong field then it directs to short dump
Edited by: Prince on Jul 24, 2008 8:43 AM
07-24-2008 7:44 AM
hi,
Pass the field catalog to the function module or method you are using to display ALV.
REUSE_ALV_FIELDCATALOG_MERGE is used to create a field catalog for corresponding data structure. Then you have to pass the table which you will get from that function module to your Function module or method for displaying the ALv.
Regards,
Veeresh
07-24-2008 7:48 AM
HI.
Iam using code as follows.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'IT_REPORT'
i_inclname = sy-repid
changing
ct_fieldcat = it_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2.
color-col = '6'.
color-int = '0'.
color-inv = '0'.
layout-coltab_fieldname = 'COLOR'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = it_fieldcat
tables
t_outtab = it_report
exceptions
program_error = 1.
is it right?
Regards.
krishna.
07-24-2008 7:57 AM
The Problem is not with the coding you mentioned .
but the problem is with the Internal table declaration.
when you are working with merge function.
Internal table should be defined using the the below mentioned way
data: begin of it_data occurs 0, "USE OCCURS 0
VBELN LIKE VBAK-VBELN,
MATNR LIKE MARA-MATNR, "USE LIKE INSTEAD OF TYPE
end of it_data.
07-24-2008 7:46 AM
call function 'REUSE_ALV_FIELDCATALOG_MERGE'.
exporting
i_program = sy-repid
interntal table = 'IT_ALV'
i_inclname = sy-repid
tables
it_fieldcat = it_fieldcat.
i m not in front of my system , my parameters names may be wrong. when you are creating fieldcat from internal table you have to pass the program name , internal table name, inclname .
and also you need to define the internal table in the following manner then only it will give the fielcat.
data: begin of it_alv occurs 0,
vbeln like vbak-vbeln,
matnr like vbap-matnr,
end of it_alv.
you have to use LIKE when you are defining the fields of internal table. and also use occurs 0.
07-24-2008 8:03 AM
Hi.
Iam using code as follows.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'IT_REPORT'
i_inclname = sy-repid
changing
ct_fieldcat = it_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2.
layout-coltab_fieldname = 'COLOR'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = it_fieldcat
tables
t_outtab = it_report
exceptions
program_error = 1.
is it right?
Regards.
Krishna.
07-24-2008 7:46 AM
hi,
There seems some issue with your FM attributes.
I think you missed out mentioning 'SY-REPID' in export parameter ' I_INCLNAME ' . Make sure that all names in
quotes are in capital.
A proper exapme is give below,
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = 'ZREPORT_TRY'
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = sy-repid
CHANGING
ct_fieldcat = I_FIELDCAT.
07-24-2008 7:47 AM
Please check if you have created a field catalog for the table containing display data and passing it to the function module.
07-24-2008 7:59 AM
Hi,
Try creating a strcuture in SE11 with the structure of final internal table and pass the structure to the fieldcatalog merge FM.
Thanks,
Sriram Ponna.
07-24-2008 11:20 AM
Hi Krishna,
The best way to avoid such kind of dumps is to :
1. Create ur own structure for all the fileds which u want to display (by going to se11).
2. When selecting these fields using a select statement, make sure the fields are selected in the same order as u define them in ur structure.
3. Define an Internal table which includes this structure.
4. Pass this structure & internal table in the FM 'REUSE_ALV_GRID_DISPLAY'.
This makes sure that there are no dumps & even if there is any dunp you can quickly check ur structure with the fileds that u r retrieving & correct the error promptly....
Plz reward if useful.
Cheers.
Ankur
07-24-2008 11:26 AM
Hi Krishna,
here is the code for the same just check this out...
tables: mara.
type-pools:slis.
data: itab type standard table of mara.
data: fcat type slis_t_fieldcat_alv.
data i_repid like sy-repid.
select * from mara into table itab.
i_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = i_repid
I_INTERNAL_TABNAME = 'ITAB'
I_STRUCTURE_NAME = 'MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = fcat
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.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
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 =
IT_FIELDCAT = fcat
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 =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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.
Thanks & Regards
Ashu singh.