Skip to Content
avatar image
Former Member

Using deep entity for both GET and CREATE

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 22, 2018 at 06:42 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • Jan 30, 2018 at 06:01 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded