on 10-20-2015 1:59 PM
Hi guys,
I've been having an issue with my data in my local storage.
The online request for the data is sorted out by the field I want it to by the back-end system.
SORT <fs_mtnrs> BY maktx.
As you can see the data is ordered by description.
But when I read the data from my local store, the things change. The list no longer keeps the sort from he back-end, and I have no other sort in the definition of the request.
I even wrote the request as it should be with no success: "/Materials?$filter=Brand eq 'TR'&orderby=Description"
Any ideas on why does it behave like this?
Thank you in advance,
Marius
order is implemented explicetly by GW service, it is not out of the box
like
DATA:
lt_tech_order TYPE /iwbep/t_mgw_tech_order,
otab TYPE abap_sortorder_tab,
oline TYPE abap_sortorder.
FIELD-SYMBOLS:
<column> LIKE LINE OF lt_tech_order.
lt_tech_order = io_tech_request_context->get_orderby( ).
LOOP AT lt_tech_order ASSIGNING <column>.
oline-name = <column>-property.
IF <column>-order = 'desc'.
oline-descending = 'X'.
ENDIF.
APPEND oline TO otab.
CLEAR oline.
ENDLOOP.
SORT et_entityset BY (otab).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
Where should I write this code in order to make i work? In a class on the GW system or in my data class of the service?
Thank you,
Marius
Hi Maksim,
I have like 80+ classes ... could you be more specific ? Is it on GW server or ERP ?
Thank you,
Marius
Hi Maksim,
I have 2 different servers, ERP and GW.
I get my data from the class Z_CL_SFA_MATERIALS_DATA.
1. You are saying that I have to add the code to my class and not to a standard class?
2. If "order is implemented explicitly by GW service" why does the sort work when I see the data Online?
Regards,
Marius
Thanks Dhananjay,
My Class is not created with SEGW. It's all hand made.
The "&orderby=Description" addition to my URL doesn't get passed. "lt_tech_order" is empty.
Any ideas ?
Regards,
Marius
Hi Marius,
How you are pass your data to local storage?
If you want to sort an array/list. you can use .sort function.
for example:
var SORTKEY = "someSortKey";
var DESCENDING = true;
var GROUP = false;
var oList = this.getView().byId("someList");
var oBinding = oList.getBinding("items");
var aSorter = [];
// you may use foo.bar.CustomSorter instead:
aSorter.push(new sap.ui.model.Sorter(SORTKEY, DESCENDING, GROUP));
oBinding.sort(aSorter);
refer from: xml - How to set sorter of a List in Controller in SAPUI5? - Stack Overflow
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik A,
Indeed, there is the sort option of the list, bu that messes up with other functionalities based on the OData data, and not the list data. If you sort the list, the indexes are not the same between the OData indexes and the list indexes, ergo it's not a viable option.
Thank you,
Marius
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.