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: 

ALV-Grid-Error: "Fieldcatalog can not be detected" (translated from german)

Former Member
0 Kudos

Hi,

I want to print out (on the screen) an internal Table about ALV.

The function "REUSE_ALV_FIELDCATALOG_MERGE" set sy-subrc

at 1, which means "inconsistent_interface".

See below, the three code-snippets!

Thanks a lot!

Here the code, how I use this function:

-


CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'IT_TMP'

i_inclname = g_repid

CHANGING

ct_fieldcat = it_fieldcat

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.

............................................................

And here the code for the internal table "IT_TMP":

-


First the declaration of a type:

-


Data: BEGIN OF besuche ,

kunnr LIKE knvv-kunnr,

name1 LIKE kna1-name1,

kndtyp LIKE kna1-katr7, "Basiskunde / Topkunde

kndtyp_txt LIKE tvk7t-vtext,

bes_termin LIKE zcrm_kundenbesu-kontakt,

bes_art LIKE zcrm_kundenbesu-besuchsart,"1=Vor Ort, 5=NL

bes_art_txt TYPE zcrm_tbart_t-bez,

bzirk LIKE knvv-bzirk,

bztxt LIKE t171t-bztxt,

vtweg LIKE knvv-vtweg,

vttxt LIKE tvtwt-vtext,

vkgrp LIKE zcrm_kundenbesu-verk,

vktxt LIKE tvgrt-bezei,

soll_bes_anz TYPE i,

END OF besuche.

-


Second the declaration the standard table:

-


it_tmp like standard table of besuche.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Perhaps it's stupid, but have you filled the variable <b>G_REPID</b> ?

<b>G_REPID = SY-REPID.</b>

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

.............................

Max

5 REPLIES 5

Former Member
0 Kudos

Hi

try this:

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'BESUCHE'

i_inclname = g_repid

CHANGING

ct_fieldcat = it_fieldcat

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.

WT_FIELDCAT-TABNAME = 'IT_TMP'.

MODIFY IT_FIELDCAT FROM WT_FIELDCAT TRANSPORTING TABNAME WHERE TABNAME = 'BESUCHE'.

Max

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This syntax is rather picky, I know that header lines are obselete, but in this case with this older technology, I believe it may be required. Try adding the HEADER LINE extension to your internal table declaration.

data:  it_tmp like standard table of besuche WITH HEADER LINE.

Regards,

RIch Heilman

Former Member
0 Kudos

Hi

Perhaps it's stupid, but have you filled the variable <b>G_REPID</b> ?

<b>G_REPID = SY-REPID.</b>

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

.............................

Max

Former Member
0 Kudos

Thank you all very much! You're so great!

All three hints together were the solution!

It works....thanks a lot!

0 Kudos

Excellent, if working now, make sure max gets some points and mark this thread as solved. Thanks.

Regards,

Rich Heilman