‎2007 Jan 24 9:01 AM
can any one give the code for implementation of both UPCASTING and DOWNCASTING
thanks in advance
vinayaka
‎2007 Jan 24 9:10 AM
well there is no code
if you want to cast just use the operator for equality ("=").
this as well works for abap objects.
‎2007 Jan 24 9:12 AM
Hi,
Check the below code, in which a field symbol has been declared of type ANY and downcasted into type SFLIGHT at runtime.
FIELD-SYMBOLS <pt> TYPE ANY.
DATA wa_sflight TYPE sflight.
ASSIGN wa_sflight-planetype TO <pt>.
WRITE <pt>.
Hope this helps.
Reward points if found useful...!
Cheers
Abhishek