Alv itab fcat

Aus SAP-Wiki
Wechseln zu: Navigation, Suche
*&---------------------------------------------------------------------*
*&      Form  alv_fcat
*&---------------------------------------------------------------------*
*       Feldliste der ALV-Tabelle
*----------------------------------------------------------------------*
form alv_fcat
  changing ct_fcat type LVC_T_FCAT.

  data: ls_fcat type LVC_S_FCAT.

* Field =
  ls_fcat-fieldname   = 'KUNNR'.   "Feldname interne Tabelle
  ls_fcat-ref_table   = 'KNA1'.    "Tabellenname typisierte Tabelle
  ls_fcat-key         = 'X'.       "Spalte ist Key-Spalte (blau und fix beim Scrollen)
  append ls_fcat to ct_fcat.
  clear ls_fcat.
  
* Field =
  ls_fcat-fieldname   = 'LAND1'.
  ls_fcat-ref_table   = 'KNA1'.
  append ls_fcat to ct_fcat.
  clear ls_fcat.
  
* Field =
  ls_fcat-fieldname   = 'NAME1'.
  ls_fcat-ref_table   = 'KNA1'.
  append ls_fcat to ct_fcat.
  clear ls_fcat.
  
* Field =
  ls_fcat-fieldname   = 'ORT01'.
  ls_fcat-ref_table   = 'KNA1'.
  append ls_fcat to ct_fcat.
  clear ls_fcat.
  
* Field =
  ls_fcat-fieldname   = 'PSTLZ'.
  ls_fcat-ref_table   = 'KNA1'.
  append ls_fcat to ct_fcat.
  clear ls_fcat.

* Field =
  ls_fcat-fieldname   = 'STRAS'.
  ls_fcat-ref_table   = 'KNA1'.
  append ls_fcat to ct_fcat.
  clear ls_fcat.  

** Field = Original Language
*ls_fcat-fieldname    = .         "Feldname der internen Tabelle
*ls_fcat-ref_field    = .         "Feldname des referenzierten Feldes Datenbanktabelle
*ls_fcat-ref_table    = .         "Tabellenname der referenzierten Datenbanktabelle
*ls_fcat-reptext      = .         "Überschriftbeschreibung
*ls_fcat-seltext      = .         "Überschriftbeschreibung
*ls_fcat-outputlen    = 10.       "Spaltenbreite
*ls_fcat-emphasize    = 'C300'.   "Spaltenfarbe (C300 = beige) zrebconstants=>cv_color_fcat_gelb
*ls_fcat-edit         = 'X'.      "Spalte ist eingabefähig
*APPEND ls_fcat TO ct_fcat.
*CLEAR ls_fcat.

endform.                    " alv_fcat