Skip to Content
author's profile photo Former Member
Former Member

Fetch data based on input in OData service

Hi everyone,

I created BAPI to fetch sales details of a given customer.

Import parameter

CUST_NO

Export Parameter

RETURN

Tables: SALES_TAB (Table having 4 columns given below)

* SO_NO

* SO_DATE

* NET_VALUE

* CURRENCY

BAPI working fine.

Now I want to create a OData service by importing the above BAPI function.

I have little confusion while selecting the fields to create a model.

I want to take RETURN structure also.

Another question is do I need to go with GetEntity (Read) or GetEntitySet (Query) for my above BAPI.

Please help.

Ravinder.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Apr 22, 2016 at 01:26 PM

    Hi Ravinder,

    Please look at the following post that will clarify our idea on developing odata services:

    Step-by-step guide to build an OData Service based on RFCs – Part 1

    Step-by-step guide to build an OData Service based on RFCs – Part 2

    Step-by-step guide to build an OData Service based on RFCs – Part 3

    Regarding your question about GetEntity and GetEntitySet your answer below:

    'GetEntitySet (Query)' is to get a array of values i.e. if you need to get multiple records from a database table/tables


    'GetEntity (Read)' is used to get one single record i.e. all the details of a particular employee/customer.

    Let’s code CRUDQ and Function Import operations in OData service!


    Regards,

    Emanuel

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You need to implement filter. Your odata call would look somwhat like -

      http://<server>:<port>/.../SalesOrderSet?$filter=(CustomerNo eq '1000232')

      To do this you would need to implement operation GetEntitySet. If you need to query by Sales Order Number, then it you would need to implement GetEnitity operation.

      http://<server>:<port>/../SalesOrder('9000231')

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.