on 2024 Jun 10 1:37 PM
Hi experts,
As far as I know, CAST operation ?= only works for object reference. Is there any other difference?
Besides, is casting only possible for objects that has relationship, e.g., interface and class or super class and sub class. For objects that has no relationship, is it possible to do casting?
Regards,
Eric
Request clarification before answering.
CAST can be used in-line; typically during method calls. Example:
my_method( obj = CAST #( lo_something ) ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Read first some basics such as Oo Design Principles as well as Abap documentation =, ?=, Upcast and Downcast and Assignment Rules for Reference Variables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.