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

Function Import via Eclipse Kepler

Hi,

We are trying to implement function import using eclipse kepler SAP Platform Tools. We created a stored procedure with name GetStudentName as below.

CREATE PROCEDURE GetStudentName(

@studentid INT --Input parameter , Studentid of the student

)

AS

BEGIN

SELECT FirstName+' '+LastName As FullName FROM MarkList WHERE StudentID=@studentid

END

We created ODataModel with entity types and function imports with the same name as stored procedure created before.

The deployed service document looks like below

<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">

<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData"xmlns:ux="http://www.sap.com/Protocols/OData4SAP/UX" xmlns:gp="http://www.sap.com/Protocols/SAPData/GenericPlayer" m:DataServiceVersion="1.0">

<Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="MarkOdataModel">

<EntityType Name="Exam">

<Key>

<PropertyRef Name="StudentID"/>

</Key>

<Property Name="StudentID" Type="Edm.String" Nullable="false"/>

<Property Name="FirstName" Type="Edm.String"/>

<Property Name="LastName" Type="Edm.String"/>

<Property Name="Subject" Type="Edm.String"/>

<Property Name="Marks" Type="Edm.String"/>

</EntityType>

<EntityType Name="PhoneBook">

<Key>

<PropertyRef Name="PhoneBookID"/>

</Key>

<Property Name="PhoneBookID" Type="Edm.String" Nullable="false"/>

<Property Name="Name" Type="Edm.String"/>

<Property Name="Address" Type="Edm.String"/>

<Property Name="PhoneNo" Type="Edm.String"/>

</EntityType>

<EntityType Name="MarksView">

<Key>

<PropertyRef Name="StudentID"/>

</Key>

<Property Name="StudentID" Type="Edm.String" Nullable="false"/>

<Property Name="FirstName" Type="Edm.String"/>

<Property Name="LastName" Type="Edm.String"/>

<Property Name="Subject" Type="Edm.String"/>

<Property Name="Marks" Type="Edm.String"/>

</EntityType>

<EntityContainer Name="default" m:IsDefaultEntityContainer="true">

<EntitySet Name="MarkList" EntityType="MarkOdataModel.Exam"/>

<EntitySet Name="PhoneBook" EntityType="MarkOdataModel.PhoneBook"/>

<EntitySet Name="MARKVIEW4" EntityType="MarkOdataModel.MarksView"/>


<FunctionImport Name="GetStudentName" m:HttpMethod="GET">

<Parameter Name="studentid" Type="Edm.Int16" MaxLength="0" Precision="0" Scale="0"/>

</FunctionImport>


</EntityContainer>

</Schema>



Now we are trying to access https://xxx.xxx.x.xxx:8083/gateway/odata/SAP/SAP_TESTSERVICE;v=1/GetStudentName?$studentid=1011

We are getting the following error:


<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code/>

<message xml:lang="en-US">Requested entity could not be found.</message>

</error>



Please help us to resolve this issue?

ODataModel.jpg (352.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Apr 28, 2015 at 12:57 PM

    Hi Shibu,

    IGW doesn't support function import. Enabling Database Content as OData Services - Data Integration using Integration Gateway - SAP Library

    CC: Bjoern Woppmann , Former Member

    Regards,

    JK

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 11, 2015 at 08:25 AM

    Hi,

    Using $filter on service created, we are successful in making simple queries.

    for example

    store.executeReadEntitySet("tablename" + "?$filter=status+eq+'active'"

    , null);

    we are able to make complex queries too

    $filter=x eq 'a' and y eq 'b' and z eq 'c'


    Now we are trying with table join.

    Please clarify that this can be done through SAP NetWeaver Gateway 2.0 only?

    Add a comment
    10|10000 characters needed characters exceeded

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.