How to Sort Multiple Column In ALV_LIST_DISPLAY
Dear Experts,
Recently i've facing a problem to Sort multiple Column in ALV_LIST_DISPLAY.Whenever i need to sort 4 columns at a time , only 3 was sorted not the 4'th one.But i have already clearly mentioned in my sort section .Can anybody help me overcome this problem?
warm regards,
sameek mazumder.
Hi samgpi,
You should have no prolem with doing such sorting by using the parameter IT_SORT, available when using class or FM...
Can you paste you sort section here so we can have a closer look?
Kr,
Manu.
Similar Messages
-
ALV: How to sort multiple columns?
Hi all,
Good morning!
I have a requirement to sort multiple columns in ALV. I did a search and tried with following codes:
data: lo_config_alv type ref to cl_salv_wd_config_table.
lo_config_alv->if_salv_wd_table_settings~set_multi_column_sort( value = abap_true ).
But I still can not sort for multiple columns.
Please guide me how to do that.
Thanks,
KhanhHello,
If you want to sort ALV by multiple fields, then you have to create sort rule for each field and set sort position for each field to specify the sequence in which you want to sort multiple columns.
Here is a sample code:
* Sort rows by PRICE descending
DATA: lr_field1 TYPE REF TO cl_salv_wd_field.
DATA: lr_rule1 TYPE REF TO CL_SALV_WD_SORT_RULE.
lr_field1 = lv_value->if_salv_wd_field_settings~get_field( 'PRICE' ).
lr_field1->if_salv_wd_sort~create_sort_rule( EXPORTING sort_order = if_salv_wd_c_sort=>sort_order_descending
RECEIVING value = lr_rule1 ).
lr_rule1->set_sort_position( 2 ). "set the sort position to 2
* Sort rows by seatsmax descending
DATA: lr_field2 TYPE REF TO cl_salv_wd_field.
DATA: lr_rule2 TYPE REF TO CL_SALV_WD_SORT_RULE.
lr_field2 = lv_value->if_salv_wd_field_settings~get_field( 'SEATSMAX' ).
lr_field2->if_salv_wd_sort~create_sort_rule( EXPORTING sort_order = if_salv_wd_c_sort=>sort_order_descending
RECEIVING value = lr_rule2 ).
lr_rule2->set_sort_position( 1 ). "set the sort position to 1
* Sort rows by seatsocc descending
DATA: lr_field TYPE REF TO cl_salv_wd_field.
DATA: lr_rule3 TYPE REF TO CL_SALV_WD_SORT_RULE.
lr_field = lv_value->if_salv_wd_field_settings~get_field( 'SEATSOCC' ).
lr_field->if_salv_wd_sort~create_sort_rule( EXPORTING sort_order = if_salv_wd_c_sort=>sort_order_descending
RECEIVING value = lr_rule3 ).
lr_rule3->set_sort_position( 3 ). "set the sort position to 3
In the above code, the sequence of sorting would be seatsmax price seatsocc
If you dont specify the sort position, then the sequence of sorting would be the order in which the sort rules are created.
In the above example, if we didnt set sort positions for the fields, then order would be price seatsmax seatsocc.
Refer to this link for more info: https://cw.sdn.sap.com/cw/docs/DOC-33859
Hope this helps!
Regards,
Srilatha -
I am unable to sort multiple columns in a table created in Pages.
I had been using Appleworks up until I installed Lion and have now switched to iWork. I created a table within a Pages document and am able to sort a single column (using the Table Inspector and choosing Sort from Edit Rows and Columns) but the Sort option is grayed out when I attempt to sort multiple columns.
In another post, someone talked about this being a problem if you have merged fields. I do not believe I have done this (to be honest I don't know the function of merging fields).
This is very frustrating as I was easily able to sort these tables in Appleworks.Sharon Anderson wrote:
Thanks for your quick response! I have been trying that but then found that Numbers would only let me print in landscape view so I had to paste the table back into Pages. Is there a way to print in portrat view (from Numbers?)
Not so. In the lower left corner of the window, there's an icon that looks like a piece of paper. If you see this:
you are in Sheet View, or normal, mode. If you see this:
You are in Print View mode. Now you see the icons for portrait and landscape modes. Click your choice. Then arrange your content to fit the pages as you wish.
Jerry -
How to make Multiple column listbox in CS4 using tree view
Hi ,
I am a beginer in Indesign Cs4 plug-in creation.In one scenario i want to create multiple column listbox,i tried with one cloumn using tree view and that is working fine.so suggest how to create multiple column listbox using tree view.
thanks
ArunInDesign does not have a native multi-column widget. You have three options:
1) Use the treeview widget and align your widgets in the tree node to create the illusion of columns (stroke panel is an example - the Links panel in CS4 is a better example)
2) Go the way of the CellPanel SDK example and tweek it to work like a listbox
3) Create the User Interface in Flex -
How to add multiple columns?
Using designer API, how to add multiple columns to the repository tables? I want to add number of columns at a time instead of adding column by column.
Thanks in advance.Can you use sqlplus?
ALTER TABLE table_name ADD (column_name data_type), (Column_name datatype),...
Check the SQL Reference 11-9.
Hope this helps.
Bill Swanson -
How to retrieve multiple columns using "returning" in the Insert query.
hi,
wanted to know how to retrieve multiple columns using "returning" in the Insert Query.
For retrieving one column we write the query as follows:
Insert into TABLE values(1,2,3,4) returning COLUMN1 into PARAMETER
But can we retrive multiple columns in the same query?
am using oracle 10g and coding in .NETHi,
You can definetely get multiple values from a single query using the 'returning' clause.
Eg : insert into emp (empno, ename, job, deptno) values (7324,'ADAM','MARKETING',30) returning ename, deptno into var1, var2; PN : var1 & var2 to be declared as varchar2 & number respectively.
More insight into the 'RETURNING' clause in this link.
http://www.samoratech.com/PLSQL/swArtPLSQLReturn.htm
Regards,
Bhanu. -
How to insert multiple column in JExcel
Hello,
I'm having a problem with JXL, when I want to insert multiple columns by the below loop, but it doesn't work. It just insert two columns instead of 7 columns.
while (date.before(toDate)) {
sheet.insertColumn(1);
Label l = new Label(1,row++, "Day");
sheet.addCell(l);
sheet.addCell(new DateTime(1, row, date.getTime(), dateFormat));
Anyone know how to insert multiple columns in JXL?
Thanks!Check the while condition. May be it is iterating only two times
-
How to force multiple columns in the Details section
Hello,
My report has a lot of data in the Details section, but it could fit on one page if I could put it in three columns. Is there a way to do this?
The Details section has setting: Force the new page after certain number of visible records. This would be perfect for me if instead of multiple pages I could use multiple columns.
Thank you,
PeterThank you.
I think I see now how to format the columns.
Peter
Edited by: Peter Afonin on Sep 10, 2010 2:34 PM -
How to hide multiple columns in multicolumn listbox like as an excel sheet?
Hello All,
I have large amount of data that is to be displayed on multicolumn listbox. After displaying that, I want to hide or delete some columns from listbox in runtime.
I know how to hide one column using active cell property node. But I want to hide multiple columns. I am using LabVIEW 2011.
Thanks in advance.
Thanks & Regards,
ManishaThank you so much.
But I have total 12 columns and I don't want to delete columns serially. I want to delete inbetween columns, like in attached VI I want to delete column A & D only.
And in this user have to select it from frontpanel. I want this is to be done as in excel, like we select the entire column and either we hide it or delete it. One more thing I want to clear the data in multicolumn when I next time open my VI. How to do that?
I hope am clear in explaining my problem.
Thanks & Regards,
Manisha
Attachments:
Delete Column.vi 10 KB -
How to Sort single column in webdynpro table
Hi all
I have requirement as follows.
i have webdynpro table with the following columns like Date,firstname,lastname,address etc.
now when i run the the application the table is populating the data at runtime that is fine.
i need as soon as table is loaded , Date field in the table should be displayed the values in the decending order...i have the requirement as follows...
how to sort the single column in table ...by default the values of the column displayed with decending order as soon as table displays at runtime....i dont want to click any button specific button to do the sort for that column
Regards
binduHi, I solved the same problem by modifying the sort() method in the default TableSorter class so that it takes a column id and direction rather than an event.
I assume you have read the TableSorter tutorial.
Like this. (This was done on nw ce 7.1 btw but may work on older versions as well.
Oh and then you just call the sort method right after you have made the request
//Code that goes into controller/view to execute sorting
wdContext.currentContextElement().getPensionplanTableSorter().sort("MyColumnId", "Up", wdContext.nodePensionPlan());
//Part of TableSorter.java
//The original method that needs an event. Now it just calls the new method
public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
// find the things we need
String columnId = wdEvent.getString("selectedColumn");
String direction = wdEvent.getString("sortDirection");
sort(columnId, direction, dataSource);
//This is the new method.
public void sort(String columnId, String direction, IWDNode dataSource) {
if (columnId == null || direction == null ) {
return;
IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
NodeElementByAttributeComparator elementComparator =
(NodeElementByAttributeComparator) comparatorForColumn.get(column);
if (elementComparator == null){
//not a sortable column
column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
return;
// sorting
elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
dataSource.sortElements(elementComparator); -
Sorting multiple columns at a time
Hi All,
I have requirement which is web dynpro table loading with the data i need to sort the three columns
at a time. initially this sorted data is coming from Function module, but now the data is coming from BW to Web dynpro java
I have one method in sort class which will sort the table on one column at time. i need help in enhancing this method to work for three columns.
public void sort(String columnId, IWDNode dataSource) {
IWDTableColumn column =
(IWDTableColumn) table.getView().getElement(columnId);
ReversableComparator reversable =
(ReversableComparator) comparatorForColumn.get(column);
if (reversable == null)
return; // not a sortable column
// remove icon of previously sorted column
if (currentlySortedColumn != null
&& currentlySortedColumn.getHeader() != null)
currentlySortedColumn.getHeader().setImageSource(null);
// bookkeeping
if (column == currentlySortedColumn) {
// reversable.toggleReversed();
currentlySortedColumn = column;
// set icon in currently sorted column
/*if (currentlySortedColumn.getHeader() != null)
currentlySortedColumn.getHeader().setImageSource(
reversable.isReversed()
? "~sapicons/s_b_srtd.GIF"
: "~sapicons/s_b_srtu.GIF");
// sorting
dataSource.sortElements(reversable);
Regards,
Lakshmi KodavatiHi all,
The solution for EP6.40 Multiple column sorter
Class file:
http://wiki.sdn.sap.com/wiki/display/Snippets/Tablesorterbymultiplecolumns%28WebDynproJava%29
f you does not have WDTableColumnSortDirection try to modify the MultiAttributesNodeComparator and replace WDTableColumnSortDirection with the boolean flag-indicator of the sorting direction. Like this:
boolean sortAsc = true; // WDTableColumnSortDirection.UP
Call this class from web dynpro view
final MultiAttributesNodeComparator nodeComparator = new MultiAttributesNodeComparator();
nodeComparator.sortElements(new String[] {"InvoiceDate","Invoice","Contract"}, true, wdContext.nodeInvoiceListTable());
Thanks for Siarhei_Pisarenka
Edited by: narayana on Mar 25, 2010 10:02 AM
Edited by: narayana on Mar 25, 2010 10:05 AM -
How to sort a column directly after data is filled into the grid?
Hello,
I have a unbound field X, which is filled on fly in the RowLoaded2 column. If I click on the column header, I am able to sort the column.
I want to sort the column directly, but all attempts have failed.
I have tried to call in <anchor>_OnUpdate
<anchor>.bcol.Sort( "X", "ASC") but it does not work as long as the property is not mapped to a Segment field of a bdoc. For this test i just created my property X on the Business Objects behind the tablegrid
I have used <tablegridcontrol>.sortCol = 2, but it results into a StackOverflowException even for any other column.
Is there no way to sort the colum in this special kind of situation?
Regards,
AndreasHi,
you have to consider that when loading a tile for the first time always rowloaded2 is fired (several times) and afterwards onload. Maybe rowloaded2 again afterwards. So it should work to sort in onload.
But when clicking the <back> button in the menue the order of the fired events might be different!
Do you want to sort by an unbound column which is readonly or is it also editable (see other thread)? In this case things might be much more complicate... Normally another sorting should be done in onsave event but unfortunately you don't save anything as it is unbound...
Regards,
Wolfhard -
Hi,
I am a newbie in t-sql and i am stuck with pivoting multiple columns. Any help is greatly appreciated!.
My input table:
Storeid
ProductID
Location
Sat qty
sun qty
Mon qty
Sat Sales
Sun Sales
Mon Sales
123
1
IL
5
6
2
120
88
200
333
1
GA
2
3
8
200
120
80
456
2
CA
4
7
3
50.5
93
300
I want to achieve output as below:
Day
StoreID
ProductID
Location
Qty
Sale
Saturday
123
1
IL
5
120
Saturday
333
1
GA
2
200
Saturday
456
2
CA
4
50.5
Sunday
123
1
IL
6
88
Sunday
333
1
GA
3
120
Sunday
456
2
CA
7
93
Monday
123
1
IL
2
200
Monday
333
1
GA
8
80
Monday
456
2
CA
3
300
Please help me in writing t-sql query to get above output. Thank you !this?
SELECT 1 AS dayNo,'Saturday' AS DayName,Storeid,ProductID,Location,Satqty AS Qty,SatSales AS Sales
FROM table
UNION ALL
SELECT 2,'Sunday' AS DayName,Storeid,ProductID,Location,Sunqty AS Qty,SunSales AS Sales
FROM table
UNION ALL
SELECT 3,'Monday' AS DayName,Storeid,ProductID,Location,Monqty AS Qty,MonSales AS Sales
FROM table
ORDER BY DayNo,Storeid
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
How to update multiple columns from different tables using cursor.
Hi,
i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
I have a code written as follows :
DECLARE
v_mydept1 TEST1.DEPT_CD%TYPE;
v_mydept2 TEST2.DEPT_CD%TYPE;
CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO v_mydept1,v_mydept2;
EXIT WHEN C1%NOTFOUND;
UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
END LOOP;
COMMIT;
END;
The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
I am not sure what is the exact problem when we want to update multiple columns of different tables.
Can anyone help me on this ?oops my mistake.....typo mistake...it should have been as follows --
UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
Now here is the upated PL/SQL code where we are trying to update columns of different tables --
DECLARE
v_mydept1 TEST1.DEPT_CD%TYPE;
v_mydept2 TEST2.DEPT_CD%TYPE;
CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO v_mydept1,v_mydept2;
EXIT WHEN C1%NOTFOUND;
UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
END LOOP;
COMMIT;
END;
Please let us know why it is not updating by using using CURRENT OF -
How to sort multiple t:dataTable columns with Tomahawk?
Hello, I'm using Tomahawk with MyFaces and I'm trying to sort my table by couple of columns. I have year and month cols and when I sort by year and two years are equal, I want to subsort by the months. I actually tried to create a sort method taking sortColumn and ascending as params, but it didn't get invoked by the app. I also tried to put commandButton as headers which call sort(ActionEvent), but it still didn't get invoked. May anyone show me how could I write a backend for the sorting?
Thanks in advance!
Regards,
MarioYes, there is a comparator. I don't find the problem so much TOmahawk specific, I'm actually trying to solve it without it too. But I found where the problem is - in the <t:column> tag - when sortable attribute is enabled, it doesn't call any external methods, no matter if they are actions or actionListeners.
So when I removed the sortable attribute, my backend method got called. :)
Regards,
Mario
Maybe you are looking for
-
Connect Iphone to car radio system
I try to find a way to connect my Iphone to my car radio. I wan to listen my mp3 and use my phone with the car radio system. annuaire et actualité
-
Printing Muliple selection on One sheet
I have been trying to no avil to select more than photo so I can print lets say 4 3x5 on one sheet with all the photos being different. Can;t seem to do get the selections I want from the menuing sytems in iPhoto or Photoshop elements. Any help.
-
Workflow how - convert psd to jpeg...
Ok so in automator I have the "get specified finder items" and I have my 4 .psd (photoshop files) and then I have the next action be "convert image to... jpeg" now what is the next step to put these in a specified folder and place? What action would
-
Tabs y-axis offset on TabNavigator
Is there a property in the CSS that allows me to move upwards and downwards the tabs when styling a TabNavigator in Flex Builder 3? I am having a problem where the tabs of the TabNavigator do not join with the body of the TabNavigator when skinning t
-
NTFS and displaying Home Movies on TV
Can someone advise me about NTFS please? I have a new external hard drive, Seagate 1TB Backup Plus Portable, which I use to show home movies on my Sony TV KDL40W5500. As far as I'm aware it only works with the drive formatted as MSDOS FAT which come