‎2010 Sep 15 10:05 AM
Hi,
I am new to ABAP .. I may sound stupid with this question.. What is the difference between TYPE and LIKE ... could anyone explain to me with examples..
Thanks,
Manasa
Moderator message: please search for available information before asking.
locked by: Thomas Zloch on Sep 15, 2010 11:28 AM
‎2010 Sep 15 10:10 AM
In modern ABAP development you should not use LIKE addition to declare variables. LIKE was used to reference ABAP Dictionary types. Nowadays you should use TYPE. There is one exception, though. You can use LIKE when you reference existing data objects (variables, internal tables), for example:
DATA: l_tab_po_items TYPE po_items,
l_wrk_po_items LIKE LINE OF l_tab_po_items.But besides this exception, forget about LIKE. In OO-context LIKE is forbidden (except referencing a data object).
Regards
Edited by: Krzysztof Usowicz on Sep 15, 2010 11:19 AM
‎2010 Sep 15 10:26 AM