12-28-2007 7:07 AM
Hi Freinds,
Can any one explain fieldcatalog merge, i know there are 3 types of fieldcatalog merge, can any one explain in detail and any sample programs ?
thanks and regards
vijaya
12-28-2007 7:09 AM
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'API_VALI'
CHANGING
ct_fieldcat = xfield
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
here I am using the SAP standard structure so I can use merge FM .. if you develop ur own structure or internal table, it would be better to declare you field with like ..
data: begin of itab
vbeln like vbak-vbeln
Edited by: jackandjay on Dec 28, 2007 2:09 AM
12-28-2007 7:09 AM
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'API_VALI'
CHANGING
ct_fieldcat = xfield
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
here I am using the SAP standard structure so I can use merge FM .. if you develop ur own structure or internal table, it would be better to declare you field with like ..
data: begin of itab
vbeln like vbak-vbeln
Edited by: jackandjay on Dec 28, 2007 2:09 AM
12-28-2007 7:12 AM
it's better to prepare your fieldcatalog yourself i.e. not using the FM.
DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_CAT TYPE SLIS_FIELDCAT_ALV,
PERFORM POPULATE_FIELDCAT USING:
'IT_VBAK' 'BOX' ' ' ' ' ' ' ' ' ' ',
'IT_VBAK' 'LIGHT' '01' 'LIGHT' ' ' ' ' ' ',
'IT_VBAK' 'VBELN' '01' 'SALES_ORDER' 'X' 'X' ' ' ' ',
'IT_VBAK' 'AUDAT' '02' 'SD_DATE' ' ' 'C200' ' ' ' ',
'IT_VBAK' 'AUART' '03' 'SD_TYPE' ' ' 'C600' ' ' ' ',
'IT_VBAK' 'NETWR' '04' 'SD_VALUE' ' ' 'C310' 'X' ' ',
'IT_VBAK' 'WAERK' '06' 'SD_CURRENCY' ' ' 'C301' ' ' ' ',
'IT_VBAK' 'VKORG' '05' 'SD_ORG' ' ' 'C311' ' ' ' ',
'IT_VBAK' 'ICON' '07' 'ICON' ' ' ' ' ' ' 'X'.
FORM POPULATE_FIELDCAT USING TAB FLD COL TXT KEY CLR SUM ICN.
CLEAR WA_CAT.
WA_CAT-TABNAME = TAB.
WA_CAT-FIELDNAME = FLD.
WA_CAT-COL_POS = COL.
WA_CAT-REPTEXT_DDIC = TXT.
WA_CAT-KEY = KEY.
WA_CAT-JUST = 'C'.
WA_CAT-OUTPUTLEN = 10.
*WA_CAT-EMPHASIZE = CLR.
WA_CAT-DO_SUM = SUM.
WA_CAT-ICON = ICN.
APPEND WA_CAT TO FLDCAT.
ENDFORM. " POPULATE_FIELDCAT
Reward if useful
Regards
ANUPAM
12-28-2007 7:13 AM
Hi,
LVC_FIELDCATALOG_MERGE
it is used in oops
REUSE_ALV_FIELDCATALOG_MERGE
it is used in simple ALV
Regards,
pRashant
12-28-2007 7:20 AM
Hi,
Fcat merge: Preparing the display format like column preferences and descriptions etc....
U can activate a lot of options like sum, variants etc...
1)Suppose u have itab with fields one two three with same discriptions(DDIC). U want to display as is then u can use following process.
Use REUSE_ALV_FIELDCATALOG_MERGE function module.
It will display as is order and descriptions from DDIC.
2)U want to display order as three(3) one(1) two(2) and desc as is then u can use following process.
populate fieldcat manually. like
x_fieldcat-col_pos = lc_pos.
x_fieldcat-tabname = lc_tabnam.
x_fieldcat-fieldname = lc_field2.
x_fieldcat-seltext_l = text-002.
APPEND x_fieldcat TO i_fieldcat.
regards,
Subbu
12-28-2007 7:25 AM
Hi
A field catalog is prepared using the internal table (I_FIELDCAT) of type SLIS_T_FIELDCAT_ALV. Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields).
When compared to use the FM "REUSE_ALV_FIELDCATALOG_MERGE",manual developement of Fieldcatalog is better.In manual development we can gv colors,sizes and etc.These r not possible by using FM.
e.g.
FLDCAT-FIELDNAME = 'VBELN'.
FLDCAT-SELTEXT_M = 'Sales Document'.
FLDCAT-COL_POS = 0.
*FLDCAT-EMPHASIZE = 'C411'.
FLDCAT-OUTPUTLEN = 20.
FLDCAT-KEY = 'X'.
*FLDCAT-NO_OUT = 'X'. "It hides the field from display
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'ERDAT'.
FLDCAT-SELTEXT_L = 'Record Date created'.
FLDCAT-COL_POS = 1.
FLDCAT-KEY = 'X'.
FLDCAT-JUST = 'R'. "Right(R)/Left(L)/Center(C) Justification
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'ERNAM'.
FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.
FLDCAT-COL_POS = 2.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
fell free to ask,if u hv any doubts regarding ALV's
award points if it is useful.
Thank you
chandu