2006 Aug 28 5:34 AM
Hi
I waana develop an alv report(OOPS) using 3 different tables. I waana know since i have to output fields from 3 different tables depending upon selection criteria. So can any body tell me how to use field catalog or field catalog merge using class.... not function REUSE alv
Hello Preet
If you have the structure for you ALV list already defined in the DDIC then use the name of structure to receive the fieldcatalog from LVC_FIELDCATALOG_MERGE.
However, if you haven't defined a DDIC structure but use a type defined within your program you can still use function module LVC_FIELDCATALOG_MERGE. Simply call the function module with your 3 different tables and collect the fieldcatalog into the same itab (e.g. gt_fcat). Then remove all unnecessary fields and duplicates and, if necessary, re-order the remaining fields.
* First sort the fields in the catalog in the required order
* Then renumber them.
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat.
ENDLOOP.Regards
Uwe
2006 Aug 28 5:42 AM
T Code - DWDM for various examples in OOPS.
Plz reward if useful.
Thnx
2006 Aug 28 5:46 AM
Hello Preet,
For creating the Field catalog
Internal table for Field Catalog
DATA: G_T_FIELDCAT_C TYPE LVC_T_FCAT,
G_R_FIELDCAT TYPE LVC_S_FCAT.
FORM BUILD_FIELD_CATALOG .
DATA: L_F_COUNT TYPE I VALUE '0'.
*/ Add properties values to ALV Catalog
ADD 1 TO L_F_COUNT.
PERFORM ADD_CATALOG USING 'MTART' 'C' SPACE L_F_COUNT "Sales Org
TEXT-005 4 SPACE SPACE SPACE.
ADD 1 TO L_F_COUNT.
PERFORM ADD_CATALOG USING 'VKORG' 'C' SPACE L_F_COUNT "Sales Org
TEXT-001 4 SPACE SPACE SPACE.
ADD 1 TO L_F_COUNT.
PERFORM ADD_CATALOG USING 'MATNR' 'C' SPACE L_F_COUNT
TEXT-002 18 'MATN1' SPACE SPACE.
ADD 1 TO L_F_COUNT.
PERFORM ADD_CATALOG USING 'STAWN' 'C' SPACE L_F_COUNT
TEXT-004 13 SPACE SPACE SPACE.
ENDFORM. " build_field_catalog
FORM ADD_CATALOG USING P_FNAME
P_INTTYPE
P_KEY
P_COL_POS
P_COL_TEXT
P_INTLEN
P_CONV
P_EDIT
P_HOTSPOT.
CLEAR G_R_FIELDCAT.
G_R_FIELDCAT-FIELDNAME = P_FNAME.
G_R_FIELDCAT-INTTYPE = P_INTTYPE.
G_R_FIELDCAT-KEY = P_KEY.
G_R_FIELDCAT-COL_POS = P_COL_POS.
G_R_FIELDCAT-COLTEXT = P_COL_TEXT.
G_R_FIELDCAT-OUTPUTLEN = P_INTLEN.
G_R_FIELDCAT-CONVEXIT = P_CONV.
G_R_FIELDCAT-EDIT = P_EDIT.
G_R_FIELDCAT-HOTSPOT = P_HOTSPOT.
APPEND G_R_FIELDCAT TO G_T_FIELDCAT_C.
ENDFORM. " add_catalog
If useful reward.
Vasanth
2006 Aug 28 6:17 AM
Hi,
You can do in two ways.
one is
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT.
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-HOTSPOT = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.another is
create the structure in SE11 with all the fields from 3 tables and then pass it to the FM.
using the function,
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZSTRUC'
changing
ct_fieldcat = pt_fieldcat.Regards
vijay
2006 Aug 28 6:47 AM
Hello Preet
If you have the structure for you ALV list already defined in the DDIC then use the name of structure to receive the fieldcatalog from LVC_FIELDCATALOG_MERGE.
However, if you haven't defined a DDIC structure but use a type defined within your program you can still use function module LVC_FIELDCATALOG_MERGE. Simply call the function module with your 3 different tables and collect the fieldcatalog into the same itab (e.g. gt_fcat). Then remove all unnecessary fields and duplicates and, if necessary, re-order the remaining fields.
* First sort the fields in the catalog in the required order
* Then renumber them.
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat.
ENDLOOP.Regards
Uwe
2006 Aug 29 3:36 AM
hi can u provide me some example code oh this how to use LVC_fieldcatalog_merge.. Since i have to use fields from 3 different tables
2006 Aug 28 6:48 AM
hi
good
go through these links
http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/43/8d75856536267fe10000000a1553f7/content.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f5fed2fe11d2b467006094192fe3/content.htm
thanks
mrutyun
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |