on 01-21-2011 4:23 AM
Hi experts,
i get doubts about getting fieldcatalog via function module LVC_FIELDCATLOG_MERGE & REUSE_ALV_FIELDCATALOG_MERGE.
declare one internal table like below:
DATA:BEGIN OF it_alv_data OCCURS 100,
project LIKE proj-pspnr,
plan_cost LIKE cosb-wog001,
END OF it_alv_data.
DATA:it_fieldcat1 TYPE LVC_T_FCAT,
it_fieldcat2 TYPE SLIS_T_FIELDCAT_ALV.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_INTERNAL_TABNAME = 'IT_ALV_DATA'
CHANGING
CT_FIELDCAT = GT_FIELDCAT1[] .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-cprog
i_inclname = sy-cprog
i_internal_tabname = 'IT_ALV_DATA'
changing
ct_fieldcat = gt_fieldcat2[].
GT_FIELDCAT1[] can not get records while gt_fieldcat2[] can be filled.
Can you please kindly explain why different results for the two fieldcat internal table.
and what should be noticed if we want get fieldcat via internal table.
thanks,
Aumas.
I think u need to create a structure with that 2 fields and then create an internal table with that structure.
It will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I aggree with Anuradha P .You should create a structure and getting the fields to here tables from.LVC_FIELDCATALOG_MERGE function uses structure like below.
call function 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE = 'X'
I_STRUCTURE_NAME = zmystr
I_CLIENT_NEVER_DISPLAY = 'X'
" I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME = itab
changing
ct_fieldcat = it_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Try to call in sequence
- K_KKB_FIELDCAT_MERGE giving internal table/structure name and include name
- LVC_TRANSFER_FROM_KKBLO to convert catalog format between the tools
or use CL_SALV* tools.
Regards,
Raymond
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
fm LVC_FIELDCATLOG_MERGE is calling fm K_KKB_FIELDCAT_MERGE, which only can get informations of internal tables, if they are defined globally in a TOP include (include name with suffix "TOP").
Regards,
Klaus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try to use sy-repid instead of sy-cprog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.