Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

***********Query regarding ALV*************

Former Member
0 Likes
434

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******

2 REPLIES 2
Read only

Former Member
0 Likes
403

HI,

use REUSE_ALV_FIELDCATALOG_MERGE in combination with LVC_TRANSFER_FROM_SLIS.

Regards

Sudheer

Read only

Former Member
0 Likes
403

hi,

By exporting the ur structure name to the field i_structure_name to the FM LVC_FIELDCATALOG_MERGE wont help.

The value to be passed to the i_structure_name should be the standard database table /structure. The internal table name is to be passed to the i_internaltable_name field

You can create a fieldcataog as per the following code

TYPE-POOLS slis.

DATA : gt_fieldcat TYPE slis_t_fieldcat_alv ,

gwa_fieldcat TYPE LINE OF slis_t_fieldcat_alv ,

DATA : BEGIN OF itab OCCURS 0,

rec_num(6) TYPE c,

mesgtyp TYPE c,

message(50) TYPE c,

icon(4) TYPE c, "NOTE

END OF itab.

*Field catalog

REFRESH gt_fieldcat .

CLEAR gwa_fieldcat.

gwa_fieldcat-fieldname = 'REC_NUM'.

gwa_fieldcat-seltext_l = 'REC_NUM'.

APPEND gwa_fieldcat TO gt_fieldcat .

CLEAR gwa_fieldcat.

gwa_fieldcat-fieldname = 'ICON'.

gwa_fieldcat-seltext_l = 'ICON'.

*gWA_FIELDCAT-ICON = 'X'. "NOTE

APPEND gwa_fieldcat TO gt_fieldcat .

CLEAR gwa_fieldcat.

gwa_fieldcat-fieldname = 'MESSAGE'.

gwa_fieldcat-seltext_l = 'MESSAGE'.

APPEND gwa_fieldcat TO gt_fieldcat .