what is difference b/w like and type statements?give
example? when to use like and when to use type?

Answer Posted / guest

when refering to type-pool you need to use TYPE
declaration, and LIKE is used to refer your already
declared variable. And for declaring native types 'N' 'C'
you cannot use LIKE there.

data: matnr like mara-matnr,
matnr1 type mara-matnr.

will not make any difference in the program. however

data: matnr type mara-matnr,
matnr1 like matnr. when the attribute of matnr
changes will affect matnr1 also.

and LIKE statement become obselete in Object programming.
you can use TYPE statements only there.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain buffering

893


What is a multiple line field? : abap bdc

615


What is search help exit? : sap abap data dictionary

725


What is hotspot?

928


What is Buffering Concept? When should a Table be buffered?

11807






How to specify a client for database table processing?

617


What are the advantages and disadvantages of ABAP query tool?

581


How to create a button in selection screen ?

1491


What is going life actually? What is the role of a functional consultant in it? : sap abap hr

551


What do you do when the system crashes in the middle of a BDC batch session?

697


How do we assign dynamic views while creating material master and generating bdc? : abap bdc

633


Different between Interface and Abstract classes?

1119


What are interface/conversion programs in SAP?

597


How do you import pay scale data from non sap to sap? : sap abap hr

584


Give few names of pooled tables in sap ?

1505