Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DOWNCASTING

Former Member
0 Likes
434

can any one give the code for implementation of both UPCASTING and DOWNCASTING

thanks in advance

vinayaka

2 REPLIES 2
Read only

Former Member
0 Likes
402

well there is no code

if you want to cast just use the operator for equality ("=").

this as well works for abap objects.

Read only

Former Member
0 Likes
402

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