Generating the Field Catalog Manually

http://abaper.cn/admin/admin_default.asp
http://www.sapdev.co.uk/reporting/alv/alv_variousfcat.htm 
1. OO ALV 不能直接通过函数获得alv的field catalog,只有用FM的方式获得itab的fieldcatalog然后转换成OO的 TABLES: LVC_S_FCAT.
 
TYPE-POOLS: SLIS.
 
DATA: GT_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
DATA: GT_REPID TYPE SY-REPID.
 
GT_REPID = SY-REPID.
 
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
     EXPORTING
          I_PROGRAM_NAME     = GT_REPID
          I_INTERNAL_TABNAME = 'ITAB'
          I_INCLNAME         = GT_REPID
     CHANGING
          CT_FIELDCAT        = GT_FIELDCATALOG[].
 
DATA: GT_LVC_FIELDCATALOG TYPE LVC_T_FCAT.
 
 
LOOP AT GT_FIELDCATALOG.
  MOVE-CORRESPONDING GT_FIELDCATALOG TO LVC_S_FCAT.
  APPEND LVC_S_FCAT TO GT_LVC_FIELDCATALOG.
ENDLOOP.

 

http://help.sap.com/saphelp_bw/helpdata/en/52/5f060de02d11d2b47d006094192fe3/content.htm

 

Output table fields with DDIC reference

Output table fields without DDIC reference

Explanation

FIELDNAME

FIELDNAME

Name of the field of the internal output table

REF_TABNAME

 

Name of the DDIC reference structure

REF_FIELDNAME

 

Name of the DDIC reference field (only needed if other than FIELDNAME )

 

INTTYPE

ABAP data type of the field of the internal output table

 

OUTPUTLEN

Column width

 

COLTEXT

Column header

 

SELTEXT

Column description in column selection for layout


你可能感兴趣的:(Field)