Skip to Content
0

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

Sep 04, 2017 at 07:41 AM

27

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sharath M G 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

Share
10 |10000 characters needed characters left characters exceeded
VIPLOVE KHUSHALANI Sep 04, 2017 at 09:16 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded