Application Development 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: 

Problem with Field catalog

Former Member
0 Kudos

Guys, Please help me.. I have been breaking my head with this...! The fieldcatalog is not getting populated. Please help me.

REPORT ztest.

TYPE-POOLS: slis.

DATA: lt_fcat TYPE slis_t_fieldcat_alv.

DATA: BEGIN OF gt_log OCCURS 0,

vbeln LIKE vbbe-vbeln,

posnr LIKE vbbe-posnr,

message TYPE bapi_msg,

color_line(4),

END OF gt_log.

*Definition of local variables for Field catalog

DATA: lv_program_name LIKE sy-repid,

lv_internal_tabname TYPE slis_tabname. "Internal table for ALV

lv_program_name = sy-repid.

lv_internal_tabname = 'GT_LOG'.

*Field Catalog

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = lv_program_name

i_internal_tabname = lv_internal_tabname

CHANGING

ct_fieldcat = lt_fcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

6 REPLIES 6

Former Member
0 Kudos

Hi Friend,

Looking at your code, I found that you have not the fieldcatalog at all.

You need to fill the fieldcatalog with all the fields you want to display in the alv.

Check the following links regarding field catalog:

http://abap-gallery.blogspot.com/2007/07/field-catalog-in-alv.html

Check this link for sample program:

http://www.saptechnical.com/Tutorials/ALV/SampleALVGridProgram.htm

Hope this helps you.

Any queries, get back to me.

Regards,

Chandra Sekhar

0 Kudos

Dude.. stop advertising your website links here.

The function module was supposed to populate the field catalog based on the Internal table, But some how it's not working.. any one else... please help me.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Make sure to pass the I_INCLNAME as well.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    i_program_name         = lv_program_name
    i_internal_tabname     = lv_internal_tabname
    i_inclname             = lv_program_name    "<--- Here
    i_bypassing_buffer     = 'X'

Regards,

Rich Heilman

0 Kudos

Rich, Thanks a lot it worked.

0 Kudos

Very good. Please be sure to close your threads by marking as answered, or if a particular answer has solved your problem, you can mark as solved next to that post.

Regards,

Rich Heilman

Former Member
0 Kudos

Answered