Sorting on Tables
Hello All,
I am trying to sort a Webdynpro Table. The Table is using a Row Group Element.
The Context Node is Structure is:
Parent Node
|_ Sub Node
Parent Node is bound to the table and the Sub Node is bound Row Group Element.
For sorting I am using the Class TableSorter.java, This works well if I have a Table without Row Group Element. But it doesnt sort correctly when I use Row Group Element (Sorting is only done on the first rows of the Sub Nodes ie Each Sub Node First rows are compared and then sorted).
Can any one help me in this?
Thanks in advance.
Anish
Edited by: Anish Saxena on Jun 4, 2010 3:09 PM
Have you read this blog?
It contains an updated table sorter class. Not sure if it handles child nodes thou.
/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s
Similar Messages
-
Issue with value of transient attribute after filtering or sorting a table
Hi guys,
i'm using jdev 11.1.1.4.0 .
i've the use case :
- a table with a column containing a checkbox to mark the selection of a row
<af:column align="center" sortProperty="TemIsChosen" filterable="true"
sortable="true" id="c6">
<af:selectBooleanCheckbox value="#{row.bindings.TemIsChosen.inputValue}" autoSubmit="true"
shortDesc="#{bindings.ServersIndicTempVVO.hints.TemIsChosen.tooltip}"
id="sbc1"
valueChangeListener="#{backing_initIndicatorsTemp.onSelectTemp}"/>
</af:column>
- i select one or more rows with checkboxes
- if i filter or sort the table, the selection of the checkboxes reset to not selected (value false by default).
I understand that for the framework, it's a normal behavior because for filtering or sorting , it re-executes the query from database. And transient attribute is not persistent, so it goes back to the default initial value "false".
What i would appreciate, it's that filtering or sorting has no effect on the value of the transient attribute, ie end user selection remains.
I tried to modify query mode of the ViewObject to filter with in-memory data. It works fine but if you reset filter inputs you can't retrieve correct RowSet. Only new RowSet is stored, old is lost.
So now it's the filtering feature that doesn't work as expected.
How can i implement my use case withouth the troubles i've described.
Best regards,
DavidHi Frank,
no it's a view object level attribute inside a read-only view object.
The view object doesn't use any entity.
Here is the definition of the attribute in the xml file of the VO, if can help you :
<ViewAttribute
Name="TemIsChosen"
IsSelected="false"
IsPersistent="false"
PrecisionRule="true"
Type="java.lang.Boolean"
ColumnType="BIT"
AliasName="VIEW_ATTR"
SQLType="BIT"
Passivate="true">
<Properties>
<SchemaBasedProperties>
<TOOLTIP
ResId="ADD"/>
<DISPLAYWIDTH
Value="50"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
David -
How to find min and max of a field from sorted internal table
Hi,
I have sorted Internal Table by field f1.
How do I find max and min value of f1.
For min value of f1 I am using,
READ TABLE IT1 INDEX 1.
IT1-F1 = MIN.
Is this correct? And how do I find the max value of f1 from this table.
Thanks,
CDYes, that is right, and you can get the max like this.
data: lv_lines type i.
* get min
READ TABLE IT1 INDEX 1.
MIN = IT1-F1.
* get max
lv_lines = lines( it1 ).
read table it1 index lv_lines.
MAX = IT1-F1.
Regards,
Rich Heilman -
Sorting a table in numbers for iPad
Hello,
can anyone help me figure out how to sort a table, such as a league table sorted by points?
ThanksGenerally, you are more likely to get an answer if you post in the iWork for iOS forum at
https://discussions.apple.com/community/app_store/iwork_for_ios
Cheers, Tom -
Hi,
I like to use the Sort Filter Table function (right click on the Matrix, plus the SAP icon to be activated) in my Add-On, Matrix.
Could you please provide me the code?
Thank you,
RuneHi Szymon Lipnicki,
I will open a new Forum ticket, because I cannot give you 10 points in this ticket anymore...
I will post a new ticket and please drop your answer in the new ticket. The Subject is "Filtering User Matrix"
Thank you very much, this is good news!!!
Thank you,
Rune -
I am using a hash table with 2 columns. The first one has strings and is the key. The second column has integers.
I need to sort this table on the first column and print the contents of the table.
Then i need to sort it on the second column and print the results.
How do i sort the hastables.
Please let me know as soon as possible.
Thanks and Regards,
VijayYou got it all wrong. Hashtables cannot be sorted because then it would not be a hashtable. The content of the Hashtable can be sorted.
What you want to do is get the key Set (keySet() method) of the Hashtable, wrap it in a List (e.g. LinkedList), sort that (see java.util.Collections for sorting) and then print out the contents of the Hashtable in the order pointed out by the keys in the sorted List.
Then you can do the same for the values() Collection of the Hashtable.
Pointers:
http://java.sun.com/j2se/1.4/docs/api/java/util/Hashtable.html
http://java.sun.com/j2se/1.4/docs/api/java/util/Set.html
http://java.sun.com/j2se/1.4/docs/api/java/util/List.html
http://java.sun.com/j2se/1.4/docs/api/java/util/LinkedList.html
http://java.sun.com/j2se/1.4/docs/api/java/util/Collections.html -
Hi friends,
I am having a problem when sorting the table control dynamically based on the fields selectd.
sorting is not working, when you select multiple fields ( one numeric field and one character field ) I have written code for handling multiple field sort,gettting field names correctly, everything looks fine but internal table is not getting sorted.
Is it related unicode issue..?
Any help will be appreciated.
Sample code:
loop at tc_control into lc_cols.
case lc_cols-selected.
wehn 'X'.
split lc_cols-screen-name at '-' into gv_tabname gv_fieldname.
move gv_fieldname gs_struc+lv_off(20)
add 20 to lv_off.
endcase.
endloop.
if ok_code = 'ASCE'.
sort itab by (gs_struc-field1) (gs_struc-field2) ..... ascending
endif.
Thanks in advance
Thiru.pHi
Try using an internal table for the field names..
Example
DATA: BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
WERKS TYPE WERKS_D,
END OF ITAB.
DATA: ITAB_FIELD(30) OCCURS 0 WITH HEADER LINE.
DATA
ITAB-MATNR = 'ABC'.
ITAB-WERKS = 'ABCD'.
APPEND ITAB.
ITAB-MATNR = 'ABC'.
ITAB-WERKS = 'ABC'.
APPEND ITAB.
SORT INTERNAL TABLE
ITAB_FIELD = 'MATNR'.
<b>APPEND ITAB_FIELD.</b>
ITAB_FIELD = 'WERKS'.
<b>APPEND ITAB_FIELD.</b>
<b>SORT ITAB BY (ITAB_FIELD).</b>
LOOP AT ITAB.
WRITE: / ITAB-MATNR,ITAB-WERKS.
ENDLOOP.
Thanks
Naren -
Problem in sorting of table data
Hi all,
I had gone through the PDF given (Developing with tables in webdynpro).
i got struck in creating TableSorter.java file...
can any one tell me how to create that java file in my project and how to send the colum which i want to sort to TableSorter.java
Regards
PadmaTo implement it ,create a value attribute say "sorter" of java native type
com.sap.tc.webdynpro.tests.utils.TableSorter. (The package name MIGHT be different.)
In wdDoModifyView,obtaine a refernce to the table objject like
table = (IWDTable)view.getElement("table ui name);
and use
wdContext.currentContextElement().setSorter(
new TableSorter(table, wdThis.wdGet
<action name for sort>Action(), null));
Now inside that action handler,
wdContext.currentContextElement().getTableSorter().sort(wdEvent,
wdContext.node<nodename>());
also chk it
Re: Sort a table
sort table columns
Table Sorting ( In Case Insensitive order)
null -
Hello -
I need to sort the table view by the sub-totals. So if I have a table view like
Car red 2
blue 2
green 2
Total Car 6
Bike black 5
blue 5
Total Bike 10
Trucks Yellow 3
Grey 4
Total Trucks 7
And I want to sort them on the subtotals. My expected report should be like:
Bike black 5
blue 5
Total Bike 10
Trucks Yellow 3
Grey 4
Total Trucks 7
Car red 2
blue 2
green 2
Total Car 6
When I do Sum(measure by Vehicle), and sort on it, I loose the grouping (or suppression of data) for Bike, Car and Trucks. What I get is:
Bike black 5 10
Total Bike 5 10
Bike blue 5 10
Total Bike 5 10
Trucks Yellow 3 7
Total Trucks 3 7
Trucks Grey 4 7
Total Trucks 4 7
Car red 2 6
Total Car 2 6
Car blue 2 6
Total Car 2 6
Car green 2 6
Total Car 2 6
Is this a bug that the suppression on the column is lost or am I not following some steps. I dont want to put this in a pivot table view.
Thanks in advance.Hello -
I need to sort the table view by the sub-totals. So if I have a table view like
Car red 2
blue 2
green 2
Total Car 6
Bike black 5
blue 5
Total Bike 10
Trucks Yellow 3
Grey 4
Total Trucks 7
And I want to sort them on the subtotals. My expected report should be like:
Bike black 5
blue 5
Total Bike 10
Trucks Yellow 3
Grey 4
Total Trucks 7
Car red 2
blue 2
green 2
Total Car 6
When I do Sum(measure by Vehicle), and sort on it, I loose the grouping (or suppression of data) for Bike, Car and Trucks. What I get is:
Bike black 5 10
Total Bike 5 10
Bike blue 5 10
Total Bike 5 10
Trucks Yellow 3 7
Total Trucks 3 7
Trucks Grey 4 7
Total Trucks 4 7
Car red 2 6
Total Car 2 6
Car blue 2 6
Total Car 2 6
Car green 2 6
Total Car 2 6
Is this a bug that the suppression on the column is lost or am I not following some steps. I dont want to put this in a pivot table view.
Thanks in advance. -
Dear SAP Experts,
For this problem I recd the reply and also followed this step, but still there is the problem.
Step 1:
Insert a module line after the module "LISTE_INITIALISIEREN" .
e.g.
PROCESS BEFORE OUTPUT.
MODULE LISTE_INITIALISIEREN.
MODULE sort .
LOOP AT EXTRACT ...
Step 2:
In your new module (in my example "sort"), do the sorting as follows. I will sort my table by the field "f3" .Thank God because ABAP gives assignment regardless of structures of both sides. Here what I mean:
e.g.
MODULE sort OUTPUT.
DATA gt_ztest LIKE ztest OCCURS 1 WITH HEADER LINE .
*--Getting the content of extract in an internal table
*-having the structure of my table.
gt_ztest] = extract[ .
*--Sorting it
SORT gt_ztest BY f3 .
*--Restoring extract from my sorted table
extract] = gt_ztest[ .
ENDMODULE. " sort OUTPUT
here in this code, which is given above:
gt_ztest] = extract[ .
when I put this code it shows syntax error...
PLease help me to solve the problem.
Regards
Lakshmikanth KDear SAP Experts,
For this problem I recd the reply and also followed this step, but still there is the problem.
Step 1:
Insert a module line after the module "LISTE_INITIALISIEREN" .
e.g.
PROCESS BEFORE OUTPUT.
MODULE LISTE_INITIALISIEREN.
MODULE sort .
LOOP AT EXTRACT ...
Step 2:
In your new module (in my example "sort"), do the sorting as follows. I will sort my table by the field "f3" .Thank God because ABAP gives assignment regardless of structures of both sides. Here what I mean:
e.g.
MODULE sort OUTPUT.
DATA gt_ztest LIKE ztest OCCURS 1 WITH HEADER LINE .
*--Getting the content of extract in an internal table
*-having the structure of my table.
gt_ztest] = extract[ .
*--Sorting it
SORT gt_ztest BY f3 .
*--Restoring extract from my sorted table
extract] = gt_ztest[ .
ENDMODULE. " sort OUTPUT
here in this code, which is given above:
gt_ztest] = extract[ .
when I put this code it shows syntax error...
PLease help me to solve the problem.
Regards
Lakshmikanth K -
How can I sort a table using more than one column in Numbers or in Pages?
How can I sort a table using more than one column in Numbers or in Pages?
Hi Ron,
On the right side of the Toolbar click the Sort and Filter button, then select Sort.
You can then set up a multiple column sort.
Click Add A Column, Specify the sort for that column, Repeat.
Jerry -
Sorting internal table by date
Hello experts,
i wat to sort internal table in asscending order and am using the code as follows,
APPEND wa_final TO it_final.
sort it_final by edatu vbeln ASCENDING.
am getting output as 05.09.2008
10.09.2008
27.08.2008
but i want in 27.08.2008
05.09.208
10.09.2008
please help me ASAP.
Thanks,
vino....Hi
I think you uploaded date field as your output format. If it is in ddmmyyyy format, when you sort it, automatically it will sort. Check your input entries.
Otherwise, what you had written is correct.
check your code
Regards,
Dhanunjaya Reddy. -
Sorting Dynamic Table by specific field
Hi guys,
I need to sort a dynamic table (without header line) by a certain field in order to achieve the client requierment. I really don't have any clue about how can i do this, because, it appears that is not possible to declarate a field symbol type standar table with a headerline...
Regards,
EricTry this:
TABLES T001.
DATA: T_T001 LIKE STANDARD TABLE OF T001.
FIELD-SYMBOLS: <TABLE> TYPE TABLE.
DATA: FIELD1(30),
FIELD2(30),
FIELD3(30).
SELECT * FROM T001 INTO TABLE T_T001.
ASSIGN T_T001[] TO <TABLE>.
FIELD1 = 'BUTXT'.
SORT <TABLE> BY (FIELD1) (FIELD2) (FIELD3).
LOOP AT <TABLE> INTO T001.
WRITE: / T001-BUTXT, T001-BUKRS.
ENDLOOP.
U have to decide how many fields can be used to sort the table: in my example I suppose the user can use max 3 fields in the same time.
The ALV use this way to sort the table.
Max -
Sort a Table with data extracted form Another table
I have a MAster Table that consist of many columns of data. I have extracted data (rows) from the table to another table for a list. I used vlookup to get the extracted data. In my new table everything is list ed out perfectly. I want to sort the table using one of the columns. I tried the reorganize button and just sorting on that one column and it won't sort. I know I'm doing something wrong whether the way I am extracting the data,or something else. Do I use lookup and large or small function to list and sort it from the main table? I stumped. Anybody have sugestions?
Hi tj,
"The Master file is the second image. I have extracted the data for the second table(second image). "
Hmmm...
Both tables are the second image. Good trick!
Good thing you included the description.
The (modified) Master table is Table 1 on Sheet 15. From this, you are extracting the participants for "R & B Winter Sk8 Jam. You want the extracted rows to be displayed on the Contestant Sheet table sorted by Division.
I see two possible lines of attack here:
The simplest might be to presort the Master table on Division, then within that sort, on last name, then on first name. With the Master table in that order, extracting the data using the index you are currently using should pull the rows in the desired order.
Construct an index of numerical values constructed from the sum of:
-- a very large number corresponding to the event, pulled from a Lookup table.
-- a large numbers corresponding to the division, pulled from a second Lookup table.
-- a small number corresponding to he count (from the top of the main tale to the current row) of Sk8ers entered in each event. (This, I think, would be the same as the count in your Index column.)
Retrieval would be done using RANK to determine the smallest and largest index values to retrieve, and SMALL to collect data from the rows with index values within that range.
No. 2 is at the concept stage, and is open to anyone wanting to give it a go.
Regards,
Barry -
Problem sorting the table .
hi
iam trying to sort the table in ascending
and descending order ,
but iam not able to sort my model node table .
below is the code i have written
and other thing i have created a class called Tablesorter.java
and copied the code of the TableSorter present in
IDE\eclipse\examples as i was not able to copy and
paste the TableSorter Class , in the
src\pkg.
import com.sap.tc.webdynpro.tests.utils.TableSorter;
if(firstTime)
view.nowCreateAllCustomExtensionFields();
IWDTable tab= (IWDTable)view.getElement("Table");
wdContext.currentContextElement().setCustomerTableSorter(new TableSorter(tab,wdThis.wdGetTableSortAction(),null,new String[] {"Customers") ));
in the above coding i am getting error as Constructor TableSorter is undefined.
wdContext.currentContextElement().getCustomerTableSorter().sort(wdEvent,wdContext.nodeCustomers());
can any one help me out ?hi
thanks for the response
i cannot copy the model node data to the value node
as i am performing some operations in the itemlistbox
and then populating the model node table
and there will be thousands of data , so copying
the data to the value node will affect the performance
and other thing is i have one more table of model node
where i have to perform sorting , so is there a way
that TABLESORTING can be directly performed on the
model node , i have to perform ascending and descending order sorting on the two tables w.r.t the columns
can any one help me out ? -
Sorting on tables in smart form
hi all,
i want to sort my table (at the time it is displayed) on smart form.
i don't have any options to sort it before.
plz help me.
thanksHi,
It is possible ABAP programing code...
In smart form is not possible.. while calling function module which is generated by smart form. u will sort interal talbe.
Hope this help.... assign points.\
raj
Maybe you are looking for
-
Hi I have windows server 2012 which is my domain controller. It has 2 hyper visor virtual machine that they are 2012 too. I have an additional domain controller in another location too. I want to know, how can I restore a bare metal or system state b
-
How much space does a Windows 7 install take on a Mac?
How much space does a Windows 7 install take on a Mac?
-
Command to see WWN no in solaris
Could anyone tell me what is WWN no. & which command is used to see WWN no.
-
IMovie 11 can't see my videos/pictures.
I recently purchased an external harddrive. I then moved all my video and picture files to that drive, hoping I did it properly and actually grabbed all my video and pictures. Now that I start up iMovie, I don't see all the footage I had before. I al
-
Printing to a shared mac printer from xp please help
Hi, I'm having real trouble printing from my girlfriends xp laptop to a printer connected to my imac running OS 10.6.2 I believe I've tried everything and there was a point where it was working beautifully then it just stopped. I think i need just a