Skip to Content
avatar image
Former Member

Problem when creating deep entity functionality

Hi experts,

I have a problem when creating deep entity for my service.

I have 2 entity Types :

* Dealer

* Bank

I have 2 entity Sets :

* Dealers

* Banks

The relationships of (Dealer : Bank) is 1 : N

I redefined /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY method.

by calling the following method

call method io_data_provider->read_entry_data( importing es_data = ls_data ).

then I execute 'POST' from gateway client

'/sap/opu/odata/sap/ZMASTERDATA_SRV/Dealers'

with XML request that has 1 Dealer and 2 banks data.

and I got the error message 'Method 'DEALERS_CREATE_ENTITY' not implemented in data provider class'

the thing that I do not understand - how the system will know to call 'Deep Entity' method instead of 'Create Entity' ?

do I need to implement 'Create Entity' method in this case ?

Really appreciate your help !!

Please let me know if you need more information from me.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 23, 2013 at 09:06 PM

    Hi Krishna,

    Thanks for your response.

    so I put a breakpoint in create_entity and create_deep_entity methods below.

    then I executed the URI in the Gateway client - it brought me to

    create_entity method.

    and this is their response

    and back to my original question - i don't know how the system will know to call 'Deep Entity' method instead of 'Create Entity' ?

    Please let me know what you think.

    Thank You,

    -Martin-



    sap5.jpg (68.0 kB)
    sap6.jpg (73.2 kB)
    sap7.jpg (58.1 kB)
    sap8.jpg (81.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Siva,

      I would suggest below approach even though u have hard coded header values.

      1. Use SEGW to model ur service.

      Create entities and create association & navigation between them with appropriate cardinality as per ur scenario.

      In ur use case Header entity to Item entity with cardinality 1 to N

      2. Implement Create_Deep_Entity method in DPC_EXT class manually and call ur logic.

      3. Use JSON payload which be easy to generate that from UI application.

      However XML payload can also be used.

      4. JSON Sample payload ->

      {

      "Id":"01",

      "Name":"Ashwin",

      "Name2":"Dutt",

      "HeaderItem":[{"IdO":"10","NameO":"TestO1"},

      {"IdO":"20","NameO":"TestO2"}]

      }

      Refer below for all the details to accomplish ur scenario.

      Step by Step development for CREATE_DEEP_ENTITY operation

      Regards,

      Ashwin

  • Sep 22, 2013 at 03:26 PM

    Hi Martin,

    Framework looks into the Payload (request body) to decide whether call Normal Create method or Deep Create. So for me the problem seems to be with your request body. May be you can post it here.

    Thanks

    Krishna

    Add comment
    10|10000 characters needed characters exceeded