0% found this document useful (0 votes)
64 views3 pages

ALV FM Field Catalog Setup Guide

The document outlines the configuration of an ALV (ABAP List Viewer) function module call, specifying key fields and field catalog settings for header and item tables. It details the setup for headers such as 'MATNR', 'WERKS', and 'LGORT', along with associated fields in the item table 'BESTAND'. The function is intended to display hierarchical data with specific layout and sorting options.

Uploaded by

tilottama.paul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views3 pages

ALV FM Field Catalog Setup Guide

The document outlines the configuration of an ALV (ABAP List Viewer) function module call, specifying key fields and field catalog settings for header and item tables. It details the setup for headers such as 'MATNR', 'WERKS', and 'LGORT', along with associated fields in the item table 'BESTAND'. The function is intended to display hierarchical data with specific layout and sorting options.

Uploaded by

tilottama.paul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

ALV FM call

keyinfo-header01 = 'MATNR'.
keyinfo-header02 = 'WERKS'.
keyinfo-header03 = 'LGORT'.

Here in my case Header and item were related by the above 3 fields. Pass header
name”HEADER” and item table name “BESTAND” in the FM as follows. And the Field catalog is
filled as follows. Point to note is Field-cat is set “X” in those fields which are also in Item but
please check that this is what I could understand.  Let’s hope this works out …All the best 

CLEAR fieldcat.
fieldcat-fieldname = 'MATNR'. " Material number
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MCHA'.
fieldcat-key = 'X'.
fieldcat-col_pos = '2'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'MAKTX'. " Materialkurztext
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MAKT'.
fieldcat-key = 'X'.
fieldcat-col_pos = '3'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'MAKTG'. " Materialkurztext
fieldcat-tabname = 'HEADER'. " in Großschreibung
fieldcat-ref_tabname = 'MAKT'. " für Matchcodes
fieldcat-no_out = 'X'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'WERKS'. " Werk
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MCHA'.
fieldcat-key = 'X'.
fieldcat-col_pos = '4'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'NAME1'. " Name (des Werkes)
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'T001W'.
fieldcat-no_out = 'X'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'LGORT'. " Lagerort
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MARD'.
fieldcat-key = 'X'.
fieldcat-col_pos = '5'.
APPEND fieldcat TO p_fieldcat.

* Positionsfelder:
CLEAR fieldcat.
fieldcat-fieldname = 'AMPEL'. "
fieldcat-tabname = 'BESTAND'.
fieldcat-col_pos = '1'.
APPEND fieldcat TO p_fieldcat.
IF lagrlz = x.
CLEAR fieldcat.
fieldcat-fieldname = 'MHDRZ_VZ'. " Restlaufzeit VZ
fieldcat-tabname = 'BESTAND'.
fieldcat-ref_fieldname = 'MHDRZ'.
fieldcat-ref_tabname = 'MARA'.
fieldcat-col_pos = '2'.
fieldcat-outputlen = '6'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'EINDA_VZ'. " Einheit 'Tage' VZ
fieldcat-tabname = 'BESTAND'.
fieldcat-seltext_s = text-014.
fieldcat-seltext_m = text-015.
fieldcat-seltext_l = text-016.
fieldcat-col_pos = '3'.
fieldcat-outputlen = '6'.
APPEND fieldcat TO p_fieldcat.
CLEAR fieldcat.
fieldcat-fieldname = 'MHDAT'. " Haltbarkeit [Link]
fieldcat-tabname = 'BESTAND'.
fieldcat-ref_fieldname = 'VFDAT'.
fieldcat-ref_tabname = 'MCHA'.
fieldcat-seltext_s = text-017.
fieldcat-seltext_m = text-018.
fieldcat-seltext_l = text-019.
fieldcat-outputlen = '14'.
fieldcat-col_pos = '4'.
APPEND fieldcat TO p_fieldcat.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'


EXPORTING
i_callback_program = repid
i_callback_pf_status_set = 'STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = layout
it_fieldcat = fieldcat[]
* IT_EXCLUDING =
* it_special_groups = gruppen[]
it_sort = sumsort[]
* IT_FILTER =
* IS_SEL_HIDE =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE =0
* I_SCREEN_END_COLUMN =0
* I_SCREEN_END_LINE =0
i_default = 'X'
i_save = 'A'
is_variant = variante
* IT_EVENTS =
* IT_EVENT_EXIT =
i_tabname_header = 'HEADER'
i_tabname_item = 'BESTAND'
is_keyinfo = keyinfo
is_print = print
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
TABLES
t_outtab_header = header
t_outtab_item = bestand.
* exceptions
* program_error =1
* others = 2.

You might also like