I have the following code in ABAP, which I would like to simplify. I have a CDS View of type Z_I_CAR and an internal structure of type ZCAR and I need to make a data reference to the CDS View in order to hand it over to a BOPF Object.
It´s just an example and my structure has more than 60 fields. Is it possible to assign the corresponding fields of an internal structure to a data reference with a single command?
DATA: lr_car TYPE REF TO Z_I_CAR,
ls_car TYPE ZCAR.
CREATE DATA lr_car.
lr_car->model = ls_car-model.
lr_car->weight = ls_car-weight.
lr_car->height = ls_car-height.
..
..
Thank you and best regards Patrick
I didn't see any command for this yet. You can use your own implementation like below: