HI Mounika,
If you want to find the difference between type and like, I suggest you to create a structure using LIKE and TYPE you will find the exact difference.
*******************************************
TYPES: BEGIN OF itab1,
*--- using type---*
MATNR TYPE MATNR,
ERSDA TYPE ERSDA,
*--- using like---*
*ERNAM TYPE CHAR10,
ERNAM LIKE CHAR10,
END OF itab1.
data : itab1 like mara occurs 10 with header line.
data : itab2 type mara occurs 10 with header line.
*********************************************************
If you create a structure like this you will encounter an error.
"CHAR10" must be a flat structure. You cannot use internal tables,strings, references, or structures as components.
Try to create using type you wont get any error.
If you use like, it will accept only the referenced ones in our case char10 is not referenced , if you use type it can accept the both.
Please make sure that you don't use "like" in your developments as they are obsoleted.
Regards,
Girish Kumar v.