on 01-30-2008 6:55 AM
Hi Experts,
My requirement is to call a Bapi from r/3 and show the result in a Table UI Element, here am doing a direct binding with the context attribute and table ui. Till now everthing is according to requirement .
Now further to it I have to automatically sort the table based on one attribute of the node say "Fpperiod". I am trying to sort the model node just after the ".....execute()" method,
1. I dont need any sorting/ filtering options in the View .
. wdContext .nodeBapi_Get_Payroll_Result_List_Input()
.nodeOutput() .nodeResults_Out().sortElements(new Comparator()public int compare(Object x, Object y) {
int iX, iY;
IPublicTable.IResults_OutElement rx =
(IPublicTable.IResults_OutElement) x;
IPublicTable.IResults_OutElement ry =
(IPublicTable.IResults_OutElement) y;
iX = Integer.parseInt(rx.getFpperiod());
iY = Integer.parseInt(ry.getFpperiod());
while (rx.getFpperiod() != null && ry.getFpperiod() != null) { rx.getFpperiod().compareTo(ry.getFpperiod()); } return iY - iX; } });
But its not working, and also if anyone could help me how the "comapre() " works it would be of great help ...
Can anyone help me with it .
Thanks in Advance
Tony
What is the data type of attribute "Fpperiod" and how should it be sorted?
For understanding the Comparator interface, please have a look at the JDK doc.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fpperiod type -- com.model.table.types.Faper
Just breif you regarding sorting requirements, model returns a table , and when I display the result in the view ( Table UI element ) I want
it to be displayed based on Fpperiod attribute of the node .
Regards,
Antony
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin ,
Thank you for giving it a look . Regarding Fperiod , Model uses following Bapi,
Bapi_Get_Payroll_Result_List_Input and Fperiod is contained in the structure of table parameter "Results.
Fperiod determinies the period for the pay roll run .
For Reference below mentioned is the code i am using to get the latest period, after executing the model .
Bapi7004_Rl payperiod = null;
while (itr_period.hasNext()) {
payperiod = (Bapi7004_Rl) itr_period.next();
pay_per.add(payperiod.getFpperiod());
}
Collections.sort(pay_per);
pay_str = pay_per.getLast().toString();
Hope you can figure out from the above code .
And as per the previous post dou you think the compare() code am using will be sufficient enough to achive sorting .
Regards,
Tony
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.