cancel
Showing results for 
Search instead for 
Did you mean: 

Multilevel Deep Create via Gateway!

former_member184598
Participant
0 Kudos

Hi,

Does anyone know if its possible to created multilevel deep create via Gateway?

For Example: I want to create 3 levels deep hierarchy via Gateway in 1 go:

Level 1: Project to Group Products

Level 2: Group Products to Group Sales Articles

Level 3: Group Sales Articles to Article Market Listing

If not, I will have to break these into multiple Asynchronous deep calls bound with some logical keys

Regards,

Saumil Jyotishi

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Saumil,

Multi level Deep Insert is very much possible. Do you have Fiori Sales Quotation Application in your system? This OData service uses multi level deep insert like this.

Sales Quotation header

     Sales Quotation Items

          Pricing Conditions

With Associations/Navigations setup right, this is as simple as deep insert.

         

Thanks

Krishna

Answers (7)

Answers (7)

former_member206574
Active Participant
0 Kudos

Hi Saumil,

You can refer the below link for create deep entity blog Syam Babu. It explains clearly.

Regards,

Venu

Former Member
0 Kudos

Hi Saumil,

How will be your deep entity type in the MPC_EXT class?

Can you please give me an example.

Thanks & Regards,

Jhansi.

         

    

SyambabuAllu
Contributor
0 Kudos

Hi Saumil,

Yes we can achieve....We already implemented kind scenario.

Thanks,

Syam

former_member184598
Participant
0 Kudos

So,

We did a small POC and I can get 3 levels nesting in read_entry_data in Gateway

If anyone needs an example, here is the sample JSON model we used for prototyping:

{
"employeeNumber": "00000001",
"employeeName": "Santi",
"Countries": [
{
"countryCode": "GB",
"countryName": "GreatBritain",
"Addresses": [
{
"houseNumber": "20 Old Bakery",
"postCode": "OX11JP",
"PhoneNumbers": [
{
"phoneNumber": "12345"
}
]
},
{
"houseNumber": "28 Old Bakery",
"postCode": "OX11JP",
"PhoneNumbers": [
{
"phoneNumber": "12345"
}
]
}
]
}
]
}

AshwinDutt
Active Contributor
0 Kudos

Hello Saumil,

Thanks for sharing the JSON payload.

May be u can just share the below as well so that others can get entire idea on the whole scenario

This will help how they can model service and code deep structure as well.

1. Screen shot of Associations & Navigation between entities with cardinality.

2. Deep structure which u have created in DPC level to capture the data coming from as payload.

Its just an suggestion

Regards,

Ashwin

former_member184598
Participant
0 Kudos

Hi Ashwin,

As I described before, the scenario here to create 4 nested entities (3 Levels of deep create).

What we did in POC or what you can do: Create associations and navigations (nothing special, the way you would do normally). As shown below:

Grand Parent -> Parent -> Child -> Grand Children

Then, create a nested ABAP types in your DPC_EXT class for these entities (One type embedded in other all the way through).

Then, in read entry data method of the API, Gateway should be able to give you these things via your nested structure (Again nothing special).If we know some ABAP, we can do whatever we want with this data

You can test this kind of deep create via a payload similar to what I have described above.

Now, The real question is how will I read this in 1 go . As you know $expand has its own limitations.

former_member184598
Participant
0 Kudos

One way to read this payload could be:

If we use some APIs to create a nested JSON Model and sent to UI as string. Then, UI must parse this string to create the model and display.

former_member184598
Participant
0 Kudos

Turns out its possible to read 4 levels deep data in 1 go with the help of Complex Types and $expand.

Here is an example of working URL:

bpmodata/taskdata.svc/21effb75608911e4b216000002d08e4e/InputData('21effb75608911e4b216000002d08e4e')?$expand=ComplianceContextType/projectDetails/grp_products/gsa_List/Aml_List&$format=json

AshwinDutt
Active Contributor
0 Kudos

Hello Saumil,

Yes its possible through creating different entities and associations & navigation's between them with appropriate cardinality.

Regards,

Ashwin

former_member184598
Participant
0 Kudos

Hi Krishna,

Thanks for this info. I will try and have a look at this Service.

former_member184598
Participant
0 Kudos

Talking about multiple asynch calls, I see it as follows (All of this has to be created on a button click in UI):

Level 1: Project to Group Products

This can be 1 deep create and it will return the Group Product IDs created with response.

Level 2: Group Products to Group Sales Articles

This will be a series of deep calls by UI (for each Group product id from previous step) to create all Group Products and Sales Articles. Again as a response call will return the unique ids for Group Sales Articles.

Level 3: Group Sales Articles to Article Market Listing

This, again, will be a series of deep calls (for each Group Sales Article from previous step) to create all Group Sales Articles and Article Market Listing.

Has anyone tried such thing before?