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: 

difference betwen v1 like mara-matnr and v1 type mara-matnr

Former Member
0 Kudos

Hi All,

Can any body tell me what's the difference between the above delarations:

v_matnr like mara-matnr,

v_matnr type mara-matnr.

since both will accept.

Thanks&Regards

Mahesh

5 REPLIES 5

Former Member
0 Kudos

Hi Ravikanth,

SAP help does not give the difference between those 2 types of the declaration.

Thanks&Regards

Mahesh

Former Member
0 Kudos

hi,

<b>v_matnr like mara-matnr</b> in this u r creating a dataobject with reference to dataelement.

<b>v_matnr type mara-matnr</b> in this u r creating a dataobject with reference to domain.

since domain and dataelement are both same for material number MATNR, u can use both in this case.

0 Kudos

I would suggest you check here /people/marilyn.pratt/blog/2005/11/09/why-don146t-they-accept-my-code-samples

and here : https://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5ac31178-0701-0010-469a-b4d7fa2...

Hope this helps.

Former Member
0 Kudos

i dont think ther is any difference between the two,..

when u say mara-matnr, it is refering to the matnr FIELD in the mara table ( not a data element or a domain as i feel )... now this field is linked to both the data element as weel as the domain...hence i dont c any diff..

just that like is normally used to refer to data objects n type to data types..

here the field is acting as an object as well as the type...

pl let me know if my understanding is wrong...