Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 04, 2017 at 08:09 AM
    -1

    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.

    Regards,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded

  • 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 ??

    Thanks

    Viplove Khushalani

    Add comment
    10|10000 characters needed characters exceeded