Skip to Content
avatar image
Former Member

Problem in creating OData Service

Hi

I was following the steps in the guide Step-by-step guide to build an OData Service based on RFCs – Part 2

And ran into following error.

Can someone please help.

odataerror.png (222.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 06, 2015 at 10:20 AM

    Hello ,

    In the Guide which you referring to please see the below screen where we are mapping all the entity properties to one output table called header data are you doing the same ?

    multiple output tables cannot be mapped to single entity type with Mapping approach where as you can do that using Code based approach by Redefining entity set method in DPC_EXT

    Thanks

    Sri

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 06, 2015 at 10:44 AM

    Hi Dilshad,

    As the error itself states that you can not use more than 1 output table in case of query. Please check your mapping. The SEGW tool will not let you map properties from 2 o/p tables.

    If in any case you need to get the output from more than one table, you can do that in the GET_ENTITYSET method of respective entity set. In that method, you will find the code where we loop at the output table and populate the et_entityset table. Here you can alter the code as per your need and read the data from multiple tables.

    Regards,

    Ekansh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 07, 2015 at 11:26 AM

    Hi

    Thanks Ekansh and Srikanth

    Your answer were really helpful, now i have only one table, but getting another error

    If anyone can shed some light here, really appreciate it

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      The screenshot of error states that the error is in the mapping of entityset WORKORDER_STANDARDset. Can you please send the full screen (with the RFC structure at the right hand side) screenshot of mapping for this entityset in query method.

  • Jan 08, 2015 at 02:16 PM

    Hi,

    I am assuming  in your RFC Mandatory input  Parameters orderid and number is there, which are mandatory to do input mapping. I didn't find any mapping for inputs in your mapping screen shot to RFC.

    If you dont want to do input mapping then for input parameters in RFC mark Optional check box.. and again check in segw.

    Regards,

    Venu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 02:34 PM

    Hi

    Thanks for the help all I was able to solve the mapping thing but still output table error remains

    Any thoughts on it would really be appreciated

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

    • The error is because you have mapped the properties to the ES_HEADER i.e. a structure and not the table thus it can contain only a single line. Since this is a GET_ENTITYSET or query mapping, the gateway expects that you would map the property to the table so that it can contain multiple lines to serve the purpose of Query.

      Hope this resolves your issue.

  • Jan 09, 2015 at 04:05 PM

    hi

    The following are some of the mapping rules for the query operation:

    • If the data source parameter you are mapping is a table, or structure, the mapping attribute is automatically defined according to the data source parameter type.In case, the data source parameter is of type, changing, Service Builder does not automatically set the direction; you must manually set the mapping direction.
    • If the data source attribute you are mapping is a table, the mapping attribute is changed to the type, output.
    • If the data source attribute you are mapping is a range table, the mapping attribute is changed to the type, input.
    • You can map only one table of type, output.
    • When mapping a property that is set as key, it must be of type, output.Key property must be mapped to one of the attributes in a table parameter in the remote function module or data source.Also, it can be mapped to the input parameter of a remote function module.In this case, it allows you to filter the results by the key property as well.

    You have to map  atleast one attribute to Output table of RFC. Query operation expecting this.

    Regards,

    Venu

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 04:08 PM

    Hi,

    and one more thing map that GET_Detail BAPI in GET_ENTITY (Read) operation. your issue will get resolved.

    Regards,

    Venu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 10, 2015 at 09:04 AM

    Hello Ahmed,

    You are mapping an input structure of your BAPI ES_HEADER as output which is causing the error.

    You need to map the out put table as the response while performing mapping.

    Correct this and issue will be resolved.

    Also note that while mapping in SEGW you cannot map more than one table as response.

    only one table can be mapped as response in SEGW while using performing mapping option.

    If at all you need to map more than one table as GW Response then in that case you need to create GW Model with different entities and association between them with appropriate cardinality and Create run-time objects.

    Then manually implement Expand Entity/Entity Set method by calling that BAPI inside it in DPC_EXT class.

    Refer -> Let's code association/navigation and data provider expand in OData service!

    Also while implementing QUERY there is no rule that input must be mapped. Its always an optional.

    Only rule is the Key properties of your GW Model need to be a part of out put mapping.

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded