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

How to read data from oData service by passing Id(employeeID) in XML view Model

<List id="invoiceList" class="sapUiResponsiveMargin" width="auto" items="{invoice>/EmployeeInfoSet(Key1='00209489')}"> <headerToolbar> <Toolbar> <Title text="{i18n>invoiceListTitle}" /> <ToolbarSpacer /> <SearchField width="50%" search="onFilterInvoices" selectOnFocus="false"/> </Toolbar> </headerToolbar> <items> <ObjectListItem title="{invoice>EmployeeNumber} x {invoice>Name}"> </ObjectListItem> </items> </List>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Sep 04, 2017 at 09:16 AM

    Hi ,

    To get the single entity you are doing it correct /<entity Set>(<key>) .. But why are you attaching the single entity to the list items ??


    Viplove Khushalani

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 04, 2017 at 08:09 AM

    Reading data from service depends on the call to service from your controller or framework.

    If you want a service to accept the employee id then your oData service should be designed to accept it and return the data for the provided service.

    The employee response, set the uri parameter of the oData service to JSON type.

    Now, the data comes to you in JSON format. Then, use simple object methods to access its content.



    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.