2007 Jan 16 5:43 PM
Hi all,
I have defined a structure in the code using TYPES.
I want to build a field catalog for the structure.
To build the field catalog I use the Function Module LVC_FIELDCATALOG_MERGE and I am exporting the structure to the field i_structure_name .
But i find that the field catalog is not getting created.
If I pass a standard structure then the field catalog is geting created.
please tell me how to build the field catalog for a structure defined in the code.
Regards,
Vijay
*************ENTRIES WILL SURELY BE REWARDED******
Hi all,
I have defined a structure in the code using TYPES.
I want to build a field catalog for the structure.
To build the field catalog I use the Function Module LVC_FIELDCATALOG_MERGE and I am exporting the structure to the field i_structure_name .
But i find that the field catalog is not getting created.
If I pass a standard structure then the field catalog is geting created.
please tell me how to build the field catalog for a structure defined in the code.
Regards,
Vijay
*************ENTRIES WILL SURELY BE REWARDED******
2007 Jan 16 5:46 PM
2007 Jan 16 5:46 PM
Hi,
Please avoid to create duplicate records..Please close one of them..
Thanks,
Naren
2007 Jan 16 5:49 PM
Hi,
You need not create any structure in the data dictionary.
Call as following:
ws_repid is the sy-repid, WS_OPEN_SUM is an internal table.
CALL FUNCTION 'K_KKB_FIELDCAT_MERGE'
EXPORTING
i_callback_program = ws_repid
i_tabname = 'WS_OPEN_SUM'
i_inclname = ws_repid
CHANGING
ct_fieldcat = i_cat
EXCEPTIONS
inconsistent_interface = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-003.
ENDIF.
*Function module to get the field catalog in the lvc_t_fieldcat format
CALL FUNCTION 'LVC_TRANSFER_FROM_KKBLO'
EXPORTING
it_fieldcat_kkblo = i_cat
IMPORTING
et_fieldcat_lvc = i_fieldcatalog
EXCEPTIONS
it_data_missing = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-003.
ENDIF.
2007 Jan 16 5:54 PM
Hello Bala,
You have define fields as<b> Like mara-matnr.</b>
If it is type <b>mara-matnr</b>then the fieldcat will not be created.
Check this.
If useful reward.
vasanth
2007 Jan 16 6:28 PM
Hi,
this ids the FM you are using,
IMPORTING
VALUE(I_BUFFER_ACTIVE) OPTIONAL
VALUE(I_STRUCTURE_NAME) LIKE DD02L-TABNAME OPTIONAL
VALUE(I_CLIENT_NEVER_DISPLAY) TYPE SLIS_CHAR_1 DEFAULT 'X'
VALUE(I_BYPASSING_BUFFER) TYPE CHAR01 OPTIONAL
VALUE(I_INTERNAL_TABNAME) LIKE DD02L-TABNAME OPTIONAL
CHANGING
VALUE(CT_FIELDCAT) TYPE LVC_T_FCAT
here instead of using i_structure name use iinternal_tabname.
Regards,
Amit
reward all helpful replies.
2007 Jan 16 6:34 PM
Hi ,
I am not sure whether you can use the FM for types defined in the program , they need to be defined in the dictionary.
Regrad
Arun
2007 Jan 16 7:57 PM
If you want to have th MERGE function module gernerate the field cat based on an internal table, you must do it like this. You must use a DATA statement to define the structure and use LIKE to define the field types, also use LIKE to define the internal table.
report zrich_0002 .
type-pools: slis.
data: begin of xma,
matnr like makt-matnr,
maktx like makt-maktx,
end of xma.
data: ima like standard table of xma with header line.
data: fieldcat type slis_t_fieldcat_alv.
data: repid type syrepid.
repid = sy-repid.
select matnr maktx
into table ima
from makt
up to 100 rows
where spras = sy-langu.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = repid
i_internal_tabname = 'XMA'
i_inclname = repid
i_bypassing_buffer = 'X'
changing
ct_fieldcat = fieldcat.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
tables
t_outtab = ima.
Regards,
Rich Heilman
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |