cancel
Showing results for 
Search instead for 
Did you mean: 

get fieldcatalog for ALV

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I think u need to create a structure with that 2 fields and then create an internal table with that structure.

It will work.

Former Member
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

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

former_member195402
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

try to use sy-repid instead of sy-cprog