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: 

Question on REUSE_ALV_FIELDCATALOG_MERGE ?

Former Member
0 Kudos

About the parameter I_INTERNAL_TABNAME of REUSE_ALV_FIELDCATALOG_MERGE:

 DATA: BEGIN OF itab occurs 0,
         matnr1 LIKE mara-matnr,
         matnr2 TYPE mara-matnr,
       END OF itab.

When itab is imported, the exported CT_FIELDCAT contains only 1 record with fieldname 'MATNR1', WITHOUT a record 'MATNR2'. I was puzzled.

The document of the function says: "Dictionary references are only considered if the keywords LIKE or INCLUDE STRUCTURE (not TYPE) are used."

  DATA <f> TYPE <type>.
  DATA <f> LIKE <obj>.

I'm wondering, does only this declaration difference hide 'MATNR2'?

If so, what's the real difference between the two kinds of data object declarations in this situation?

Thanks to everyone. Any suggestion is appreciated.<u></u>

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If you use LIKE the field takes up all the dictionary field properties...

If you use TYPE the field takes up only the <b>datatype</b> of the referenced field.

Ps: Reward helpful posts.

Regards,

Wenceslaus.

5 REPLIES 5

Former Member
0 Kudos

Hi,

If you use LIKE the field takes up all the dictionary field properties...

If you use TYPE the field takes up only the <b>datatype</b> of the referenced field.

Ps: Reward helpful posts.

Regards,

Wenceslaus.

0 Kudos

Thank you, Wenceslaus G.

Could you help to list any property that LIKE takes up while TYPE doesn't?

0 Kudos

Hi,

The reference using LIKE takes Field Description, Output Length, Sel text

Ps: Reward helpful posts.

Regards,

Wenceslaus.

0 Kudos

Thank you very much.

former_member188685
Active Contributor
0 Kudos

Hi,

type declarations the FM will not accept, like declarations it will take. or else if you don't want to change the declaration then go for manuall filling.

if you use fm then use LIKE not type

Regards

vijay