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

ALV display

Former Member
0 Likes
938

Hello Experts,

I am new to ABAP development. Can you please tell me what am i doing wrong in the code. It is giving an error "field catalog not found".

Regards,

Sarnava.

1 ACCEPTED SOLUTION
Read only

former_member196157
Active Participant
0 Likes
907

hiiii

give field name and table name in capital letter

i.e.

ls_fcat-FIELDNAME = 'PARTNER'.

ls_fcat-TABNAME   = 'LT_FINAL'.

NOT LIKE

ls_fcat-FIELDNAME = 'partner'.

ls_fcat-TABNAME   = 'It_final'.

6 REPLIES 6
Read only

former_member196157
Active Participant
0 Likes
908

hiiii

give field name and table name in capital letter

i.e.

ls_fcat-FIELDNAME = 'PARTNER'.

ls_fcat-TABNAME   = 'LT_FINAL'.

NOT LIKE

ls_fcat-FIELDNAME = 'partner'.

ls_fcat-TABNAME   = 'It_final'.

Read only

arivazhagan_sivasamy
Active Contributor
0 Likes
907

Hi Saravana,

Below statement should come after endloop.

DELETE ADJACENT DUPLICATES FROM it_final COMPARING object_id.

Also,

already you have filled using append, so REUSE_ALV_FIELDCATALOG_MERGE may not be required.

Arivazhagan S

Read only

Former Member
0 Likes
907

In New fieldcat 'ls_fcat-fieldname' = 'Should be in CAPS'.

Thanks

Vijay

Read only

former_member187748
Active Contributor
0 Likes
907

Hi Sarnava,

the fieldname in field catalog are written in capital letters as shown here in bold letters

WA_FIELDCAT-COL_POS = 1.

   WA_FIELDCAT-FIELDNAME = 'VKORG'.

   WA_FIELDCAT-REF_FIELDNAME = 'VKORG'.

   WA_FIELDCAT-REF_TABNAME   = 'VBAK'.

   WA_FIELDCAT-TABNAME   = 'IT_FINAL'.

   WA_FIELDCAT-DDICTXT   = SPACE .

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

Read only

Former Member
0 Likes
907

Hai,

You have 7 field declarations in the final structure.But you filled 6 fields only.Put the letters in single codes as capitals .

ls_fcat-COL_POS = 1.

ls_fcat-FIELDNAME = 'PARTNER'."partner'.

ls_fcat-TABNAME   =  'IT_FINAL'.'It_final'.

ls_fcat-SELTEXT_M = 'Vendor Number'.

ls_fcat-SYMBOL = 'X'.

APPEND ls_fcat TO lt_fcat.

clear ls_fcat.

already you have filled using append, so REUSE_ALV_FIELDCATALOG_MERGE may not be required.

Read only

Former Member
0 Likes
907

Hi.

The reason for this is error is if the internal table structure field is not same has fieldcatalog  fields this error will occurs  for example

type : begin of ty_stru,

vbeln type vbak-vbeln,

erdat type vba-erdat,

end of ty_stru.

data : it_itab type table of ty_Stru with header line.


select vbeln erdat

from vbak

into table itab.



DATA : TFCAT TYPE SLIS_T_FIELDCAT_ALV,

            W_FCAT TYPE SLIS_FIELDCAT_aLV.



W_FCAT-COL_POS  = 1.

W_FCAT-FIELDNAME = 'VBELN'.

APPEND W_FCAT TO TFCAT.




W_FCAT-COL_POS  = 2.

W_FCAT-FIELDNAME = 'ERDAT'.

APPEND W_FCAT TO TFCAT.




call function 'RESUE_ALV_GRID_DISPLAY'.

EXPORTING

FCAT      =   TFCAT

CHANGING

ITAB       =   IT_ITAB.





HERE IAM DOINGG MANUALLY,IF YOU WANT TO FETCH ALL FIELDS FROM THE TABLE USE FIELDCATALOG MERGE FUNCTION MODULES.

Hope you got little bit idea to go further.

Thanks & Regards.

RV Karthikeyan.