12-15-2006 5:33 PM
12-15-2006 5:35 PM
Hi,
The field catalog is used to specify column attributes which will be used to display the records in the ALV..
Thanks,
Naren
12-15-2006 5:35 PM
Hi,
The field catalog is used to specify column attributes which will be used to display the records in the ALV..
Thanks,
Naren
12-15-2006 5:37 PM
Hi Sunil ,
A field catalog is used in ALV , and is used to contain the details of the field which are to be displayed in the ALV . It basically contains the name of field , the header/text for the field , the data type , the position the ALV where it is to be displayed and many more details.
Regards
Arun
12-15-2006 5:37 PM
The field catalog allows you to set attributes of the column, the entire column, you can not change the column attributes per record row. You set it one time for the column.
Field Catalog
Definition
Screen area of the Report Designer.
Use
All query fields, filters, variables, and text elements for the data provider (query or query view) on which the report is based are displayed in the field catalog. The field catalog also contains the list of custom texts created by users, which were inserted into the header area of the report, for example.
Using the field catalog, you can insert or reuse query fields or text elements for the data provider that were deleted from the report, for example, at any time with drag and drop. You can also work with custom texts the same way.
Structure
The following elements are listed in the field catalog:
● Custom texts
● Query fields
● Text elements for the data provider, such as Last Changed By, Due Date, Query Description, and so on.
● Filter elements (see also Filter) that you can insert into the header area of your report, for example.
● Variables, which are filled with the actual values entered at the runtime for the report.
Here is an example...
REPORT ZPLANT_ALV .
Type-pools: slis.
tables: marc.
types : begin of DISP,
SLNO TYPE I,
werks type MARC-WERKS,
matnr type MARA-MATNR,
maktx type MAKT-MAKTx,
mtart type MARA-MTART,
volum type MARA-VOLUM,
ntgew type MARA-NTGEW,
ersda type MARA-ERSDA,
laeda type MARA-LAEDA,
end of DISP.
data : it_disp type table of disp,
wa_disp type disp.
Data: it_fcat type slis_t_fieldcat_alv,
wa_fcat type slis_fieldcat_alv.
parameters : p_werks type marc-werks.
IF p_werks IS INITIAL.
MESSAGE I000(Z_errors).
ELSE.
select MARC~WERKS
MARA~MATNR
MAKT~MAKTX
MARA~MTART
MARA~VOLUM
MARA~NTGEW
MARA~ERSDA
MARA~LAEDA
from
MARC inner join MARA
on marcmatnr = maramatnr
inner join makt
on marcmatnr = maktmatnr
into corresponding fields of table IT_DISP
where marc~werks = p_werks and spras = 'EN'.
IF SY-SUBRC = 0.
PERFORM display.
ELSE.
MESSAGE I001(Z_errors).
ENDIF.
ENDIF.
form display.
LOOP AT IT_DISP INTO WA_DISP.
MOVE SY-TABIX TO WA_DISP-SLNO.
MODIFY IT_DISP FROM WA_DISP TRANSPORTING SLNO.
ENDLOOP.
wa_fcat-col_pos = 1.
wa_fcat-fieldname = 'SLNO'.
WA_fcat-SELTEXT_L = 'SLNO'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='SLNO'.
*wa_fcat-ref_tabname = ''.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 2.
wa_fcat-fieldname = 'WERKS'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='WERKS'.
wa_fcat-ref_tabname = 'MARC'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 3.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='MATNR'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 4.
wa_fcat-fieldname = 'MAKTX'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='MAKTX'.
wa_fcat-ref_tabname = 'MAKT'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 5.
wa_fcat-fieldname = 'MTART'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='MTART'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 6.
wa_fcat-fieldname = 'VOLUM'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='VOLUM'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 7.
wa_fcat-fieldname = 'NTGEW'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='NTGEW'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 8.
wa_fcat-fieldname = 'ERSDA'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='ERSDA'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-col_pos = 9.
wa_fcat-fieldname = 'LAEDA'.
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-ref_fieldname ='LAEDA'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-hotspot = 'X'.
append wa_fcat to it_fcat.
clear wa_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_GRID_TITLE = 'ALV REPORT-SELECTED PLANT'
IT_FIELDCAT = it_fcat[]
TABLES
T_OUTTAB = IT_DISP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
endform.