Skip to Content
avatar image
Former Member

LIKE and Type in abap statements

Hello All ,

I have a question regarding the 'Like' and' Type'

I have created a badi XXX , The method has a changing parameter 'A' which is referenced to a structure .

The typing method I have mentioned in the method ( in the parameter list ) is TYPE .( I feel it should have been Like ). Can this cause an issue while writing abap statements in the method ?

Thanks in advance .

Best Regards,

swetha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Oct 07, 2008 at 06:28 AM

    Hi,

    This like and type keywords are very similar.

    Whenever you reference a database object most of the times you use TYPE. But in your program you are creating a variable and referring some other variable in the same program you can use LIKE.

    Eg : data : w_matnr TYPE mara-matnr.

    data : l_matnr LIKE w_matnr.

    Regards,

    Pramod

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 07, 2008 at 06:29 AM

    hi

    type is used when reffering sap datatypes,

    LIKE is used when reffering sap datatobjects.

    data:xyz type c,

    abc like xyz.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 19, 2008 at 09:47 AM

    hi..

    Type is a keyword to declare the data type..

    Like is a keyword to declare Dataobjet..

    Ex.

    A type I value 5,

    Blr Like City.

    Regards,

    Karthik.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 19, 2008 at 12:24 PM

    Hi,

    Use TYPE instead of LIKE, as TYPE only get technical attributes (data type and data length) while LIKE declaration gets all semantic and technical attributes of the field.

    Thanks,

    Kartavya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 19, 2008 at 11:40 PM

    Maybe press F1 on both LIKE and TYPE.

    Rob

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2008 at 03:25 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 03:42 AM

    Thank you for all the help

    Add comment
    10|10000 characters needed characters exceeded