Skip to Content
Dec 11, 2015 at 09:28 PM

Multilevel Deep Insert Issue


Hello fellow SAPers.

I have an issue figuring out how to make a multilevel deep insert to work out.

So far the issue I'm having is how to make a working types for it to work, the scenario is as follows.

We have our main entity, which is Insurance, insurances has header data, such as an ID and a few more fields.

Insurance has defined three navigation properties/associations with another three entities, that works correctly.

One of those entities is a beneficiary, for an insurance there can be n number of given beneficiaries.

Lastly, the beneficiary entity has two navigation properties/associations defined.

Issue comes when trying to fetch/fill the associated entities. The types we use in ABAP is something like this:

TYPES BEGIN OF insurancebeneficiaryset.
INCLUDE TYPE zcl_ztest_request_gene_mpc=>ts_insurancebeneficiary.
TYPES: imageset TYPE STANDARD TABLE OF zcl_ztest_request_gene_mpc=>ts_image WITH DEFAULT KEY,
electronicsignatureset TYPE zcl_ztest_request_gene_mpc=>ts_electronicsignature,
END OF insurancebeneficiaryset.

DATA: lt_insurance TYPE STANDARD TABLE OF insurancebeneficiaryset WITH DEFAULT KEY,
ls_insurance LIKE LINE OF lt_insurance.

DATA: BEGIN OF lty_full_insurance.
INCLUDE TYPE /cbcr/cl_pr_moborigin_mpc_ext=>ts_insurance.
DATA: insurancebeneficiaryset LIKE TABLE OF lt_insurance,
insurancemodalityset TYPE /cbcr/cl_pr_moborigin_mpc_ext=>ts_insurancemodality,
insurancepaymentset TYPE /cbcr/cl_pr_moborigin_mpc_ext=>ts_insurancepayment,
END OF lty_full_insurance.

When I do the query request to the set using an expand command, only the main info is being taken in consideration, so only insuranceModalitySet and InsutancePaymentSet is taken into consideration, however insuranceBeneficiaryset is getting ignored, as well as ImageSet and electronicSignature in the response, just like this:

We're using an expand_entityset to perform this test.

I've also checked, the expand properties are being called correctly, and the names for the types are set correctly.

I'm also facing the issue trying to call the two entities in the beneficiarySet in the URL:

If the URI is like this: InsuranceModalitySet,InsurancePaymentSet,InsuranceBeneficiarySet/ImageSet it "works".

If however, in the URI i try to expand the electronic signature set and the image set, it gives me this error:

With an URI like this: /InsuranceSet?$expand=InsuranceModalitySet,InsurancePaymentSet,InsuranceBeneficiarySet/ImageSet/ElectronicSignatureSet or this /InsuranceSet?$expand=InsuranceModalitySet,InsurancePaymentSet,InsuranceBeneficiarySet/ImageSet,ElectronicSignatureSet

Perhaps I'm not calling the URI correctly or something else.

If any of you guys could give me any idea of what's the error it would be highly appreciated, in the mean time I'll still run some tests and figure out what's wrong.



pastedImage_0.png (58.3 kB)
pastedImage_1.png (52.9 kB)