cancel
Showing results for 
Search instead for 
Did you mean: 

Using deep entity for both GET and CREATE

0 Kudos

Just had a couple of days experience with Gateway service development, so apologies if this is a question that just goes against everything Gateway stands for 😉

Using manuals and blogs online, I've managed to create a service that will accept a deep entity (three simple fields and a table), convert that to the format the RFC function will accept and call the function. That works, awesome.

Now I would like to use the exact same deep entity to retrieve information from the backend system. So once again I redefine several methods in the DPC_EXT and MPC_EXT classes to get the deep entity populated. That works, but the result in the Gateway client only shows the simple fields. I assume this is because I cannot define the table in the entity properties, only the simple elements. Therefore the table doesn't get mapped and is lost in translation.

Of course there is Associations and the $expand option to combine Header and Item entities, but that seems like the long way around and will only work for GET_ENTITYSET. For CREATE, I haven't been able to find a solution, seems you can only create one record at a time. Can't imagine that's the way to go.

Am I on the right path here? Is it possible to re-use a deep entity for both GET and CREATE? Thanks in advance for the help!

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185414
Active Contributor
0 Kudos

Hi Egbert,

The appraoch you are following is not recommended.

You can use the same model - Same Parent Entity with Child entity for both Deep Create and $expand fetch but the GW framework has provided separate methods(Sepratation of concerns principle) for both these HTTP operations. Please have a look into <>GET_EXPANDED_ENTITYSET/<>GET_ENTITYSET or <>GET_EXPANDED_ENTITY/<>GET_ENTITY depending on your $expand use case. For Deep create there is only one method - <>_CREATE_DEEP_ENTITY.

Former Member
0 Kudos

Yes you can use the Deep Entity method for both Get and Create,if you want the output in Get in the same format as you were sending for Create. Add a flag variable.Set it to X when you have to do a Get operation and blank when you need it for Create functionality.

Here,you will have to use the concept of batch for fetching more than one record. Redefine the methods: /IWBEP/IF_MGW_CORE_SRV_RUNTIME~CHANGESET_BEGIN and /IWBEP/IF_MGW_CORE_SRV_RUNTIME~CHANGESET_END with blank implementation.

0 Kudos

Thanks for the reply! So in theory it is possible, although this still feels like hacking your way through the system, not using it like it was designed to be used. A flag to differentiate between GET and CREATE... but hey it's worth a shot and worst case I'll learn more about the inner workings of the gateway 🙂

Former Member
0 Kudos

You may or may not use a flag,that depends on the scenario. By flag here,I mean a distinguishing factor that you'll require between the GET and POST call.