Sorting table - display two "sorting triangles"
When I implement sorting on JTable I need to press the table header in order to see the "sorting triangle".... when I press again I see it inverted because the sorting order changes....
Is this possible to display both triangles (and only highlight one of them if the sorting is applied for specified column)?
Thanks
When I implement sorting on JTable I need to press the table header in order to see the "sorting triangle"add this line and the triangle will be showing, above the already-sorted column
table.getRowSorter().toggleSortOrder( [columnNumber] );
Similar Messages
-
I have a string,converted to a number, and two other numbers built into an array. The string that is converted to a number is actually a hex number read from a serial device. I am using the express VI, Build Table, to display the data on the from panel. The problem is that I want to display the one result as hex and the other two as a fractional with two digits of precision. Is there a way to do that or is it better to do it from scratch and not use the express VI in this case? Any help would be appreciated.
Thanks,
TroyExpress VIs are great for doing some things but they lack some of the versatility of the regular functions. Because of your mix of data types that you wanted to represent, the Express VI was unsuited to the task and the modification I made to your program is actually simpler (just look at how much code is inside the build table Express VI some time.
As to your second question, you will need to have a shift register maintain the contents of the table so that each repetition of the loop will append new data to the table. In the smiple example that I had attached in an earlier post, there is a shift register doing exactly that. I initialize the shift register at the start of the program with an empty 2D array. Each time the Add button is pressed, it takes the new row and appends it to the existing 2D array that is connected to the table. At some point, you might also want to consider redoing your program to eliminate all of those sequence structures. They make programs harder to read and debug. I would add some error in/error out connections to your serial VI. This would help you enforce dataflow without using sequences. It would also help track down problems shen an error does occur. -
Oracle rownum usage for splitting a Table into two equal parts.
Hi All,
I have a table which has like 1.2 billion records and i would have to split the table in two parts for my Archiving needs.Unfortunately that table does not have any unique key or primary key or data stamp which i can rely for.
I would have to use the rownum concept to divide the table.
I am using the below
SELECT * FROM (SELECT ENAME, SAL FROM EMP ORDER BY SAL DESC) WHERE ROWNUM < 5000000;
But the problem is that the table is taking forever to retrieve as it has to do a order by and then retrieve the data as per the where clause.
The question i have is that instead of using a orderby clause to get the same rownum for the row every time, can i directly rely on the fact that the database is read only and the Rownum would remain same even without oder by clause....
Thanks....WARNING! There is a bug in the code, see EDIT: at bottom of post for details
Justin,
It makes sense that Oracle could order over rowid without sorting, but I see a sort in the explain plan:
SQL> create table t as select 1 as data
2 from all_objects
3 where rownum <= 100000;
Table created.
SQL> explain plan for select *
2 from (select t.*, row_number() over (order by rowid) rn from t)
3 where rn < 50000;
Explained.
SQL> select * from table(DBMS_XPLAN.DISPLAY);
PLAN_TABLE_OUTPUT
Plan hash value: 327232321
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 99651 | 2530K| | 489 (3)| 00:00:07 |
|* 1 | VIEW | | 99651 | 2530K| | 489 (3)| 00:00:07 |
|* 2 | WINDOW SORT PUSHED RANK| | 99651 | 2432K| 7056K| 489 (3)| 00:00:07 |
| 3 | TABLE ACCESS FULL | T | 99651 | 2432K| | 31 (7)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter("RN"<50000)
2 - filter(ROW_NUMBER() OVER ( ORDER BY ROWID)<50000)875820,
What are you doing with the results of the select to archive the table in two pieces? If the archive is in the DB in two seperate tables, multi table insert would be an option:
SQL> create table archive_1 (data number);
Table created.
SQL> create table archive_2 (data number);
Table created.
SQL> explain plan for insert when mod(rn, 2) = 0 then into archive_2 (data) values (data)
2 else into archive_1 (data) values(data)
3 select rownum as rn, data
4 from t;
Explained.
SQL> select * from table(DBMS_XPLAN.DISPLAY);
PLAN_TABLE_OUTPUT
Plan hash value: 828723766
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 99651 | 2530K| 31 (7)| 00:00:01 |
| 1 | MULTI-TABLE INSERT | | | | | |
| 2 | INTO | ARCHIVE_2 | | | | |
| 3 | INTO | ARCHIVE_1 | | | | |
| 4 | VIEW | | 99651 | 2530K| 31 (7)| 00:00:01 |
| 5 | COUNT | | | | | |
| 6 | TABLE ACCESS FULL| T | 99651 | 1265K| 31 (7)| 00:00:01 |
SQL> insert when mod(rn, 2) = 0 then into archive_2 (data) values (data)
2 else into archive_1 (data) values(data)
3 select rownum as rn, data
4 from t;
100000 rows created.Another option would be to use the last digit of rowid to split the table into two groups, but they will not be equal sized.
SQL> explain plan for select *
2 from t
3 where substr(rowid, length(rowid), 1) = upper(substr(rowid, length(rowid), 1))
4 or substr(rowid, length(rowid), 1) in ('0', '1', '2', '3', '4');
Explained.
SQL> select * from table(DBMS_XPLAN.DISPLAY);
PLAN_TABLE_OUTPUT
Plan hash value: 2153619298
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 59025 | 1441K| 98 (71)| 00:00:02 |
|* 1 | TABLE ACCESS FULL| T | 59025 | 1441K| 98 (71)| 00:00:02 |
Predicate Information (identified by operation id):
1 - filter(SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='0
' OR SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='1' OR
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='2' OR
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='3' OR
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='4' OR
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)=UPPER(SUBSTR(ROW
IDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)))
Note
- dynamic sampling used for this statement
23 rows selected.
SQL> explain plan for select *
2 from t
3 where substr(rowid, length(rowid), 1) <> upper(substr(rowid, length(rowid), 1))
4 and substr(rowid, length(rowid), 1) not in ('0', '1', '2', '3', '4');
Explained.
SQL> select * from table(DBMS_XPLAN.DISPLAY);
PLAN_TABLE_OUTPUT
Plan hash value: 2153619298
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 40627 | 991K| 41 (30)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T | 40627 | 991K| 41 (30)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'
0' AND SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'1' AND
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'2' AND
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'3' AND
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'4' AND
SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>UPPER(SUBSTR(RO
WIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)))
Note
- dynamic sampling used for this statement
23 rows selected.
SQL> select count(*)
2 from t
3 where substr(rowid, length(rowid), 1) = upper(substr(rowid, length(rowid), 1))
4 or substr(rowid, length(rowid), 1) in ('0', '1', '2', '3', '4');
COUNT(*)
59242
SQL> select count(*)
2 from t
3 where substr(rowid, length(rowid), 1) <> upper(substr(rowid, length(rowid), 1))
4 and substr(rowid, length(rowid), 1) not in ('0', '1', '2', '3', '4');
COUNT(*)
40758
EDIT:
I realized that I screwed up above. In hind sight I don't know what I was thinking. I was attempting to use X = upper(X) to find the upper case characters A-Z. So the two queries to split rows based on the last character of rowid are not right. I don't have time to fix now, but wanted to leave a note of warning.
Edited by: Shannon Severance on Jul 29, 2011 1:34 AM -
Dynamic Table display Horizontally??
Is there any relatively easy way to make a DW CS3 Dynamic
Table display horizontally? So far the best I can figure out is to
do multiple <cfoutput query= lines per:
<table border="1">
<tr> <cfoutput query="rsOfficeStyles"
startRow="#StartRow_rsOfficeStyles#"
maxRows="#MaxRows_rsOfficeStyles#">
<td>#rsOfficeStyles.image#</td> </cfoutput>
</tr>
<tr> <cfoutput query="rsOfficeStyles"
startRow="#StartRow_rsOfficeStyles#"
maxRows="#MaxRows_rsOfficeStyles#">
<td>#rsOfficeStyles.name#</td> </cfoutput>
</tr>
</table>You need to pass the following to the quantity fields..
ls_fieldcat-do_sum = 'X'.
When you build the sort table, do this...
FORM sort_build USING lt_sort TYPE slis_t_sortinfo_alv.
DATA: ls_sort TYPE slis_sortinfo_alv.
CLEAR ls_sort.
ls_sort-spos = 1.
ls_sort-tabname = gt_tabname_item.
ls_sort-fieldname = 'DESCBIEN'.
ls_sort-subtot = 'X'.
ls_sort-up = 'X'.
ls_sort-group = 'UL'.
APPEND ls_sort TO lt_sort.
ENDFORM. " sort_build
Has you any way of knowing which fields are quantity?
Greetings,
Blag. -
Displaying Two groups of data side by side
We are using XML Publisher 5.6.2. We have a requirement where we need to display two independent groups side by side.
What we tried was, we had a single table, on which on the same row, we defined the first group ( for-each:group1)<?Col1?><end-each>, in a single cell as part of three different form fields and then in the second column, we started the next group.
But when we ran the report, the second group does not get dsiplayed. The workaround we have to use is that define the second group in a seperate row than the first group. This displayed the data for both the groups.
The issue is that, if Group1 has 10 rows, then my second group will be pushed down.
Has anybody had this issue and if there is a resolution, please let us know.
Thanks,
- Vasu K -hi this is mohan,
I would Like to display the data in single table. i have 10 groups when i m trying the columns becoming null. when i m taking it in diff tables its working fine but my client is not satisfied with that is there any solution for this making it in one table.
Regards&Thanks
Mohan.katepalli
Path Infotech Limited -
How to display two pages at a time in smartform
Hi folks,
I have requirement that i need to display two pages for each record of the output table . the page 1 is not simillar to page 2 . page1 contains few templates and page2 contains other templates not simillar to first one.
my case, it displays only the first page eventhough i tried using command line.
Is there any exact step to followed to over come this problem.
Please suggest the solution.
Thanks ,
Hemum.hi,
can u please tell me how and where u are looping throuhg the internal table
check that.
regards,
Ravi Valluri -
hi Expert,
how to display two report in one please help me .
Regards,
HamadHi,
Refer the sample code:
CLEAR w_event.
w_event-name = slis_ev_top_of_page.
w_event-form = 'TOP_OF_PAGE'.
APPEND w_event TO i_events1.
CLEAR w_event.
w_event-name = slis_ev_top_of_page.
w_event-form = 'XTOP_OF_PAGE'.
APPEND w_event TO i_events2.
DATA: lv_repid LIKE sy-repid.
lv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = lv_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PF_STATUS'.
*-- Vendor Schedule List
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
it_fieldcat = i_field_cat1
is_layout = w_lay_out1
i_tabname = '<I_TABLE>'
it_events = i_events1
TABLES
t_outtab =<b> <i_table>.</b> Data for Report 1
*-- Error Lsit display
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
it_fieldcat = i_field_cat2
is_layout = w_lay_out2
i_tabname ='I_ERROR'
it_events = i_events2
TABLES
t_outtab = <b>i_error[].</b> - Data for report 2
w_print-reserve_lines = 2.
w_print-no_print_listinfos = c_x.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = w_print.
ENDFORM. " f0504_create_list
*-- Top of Page
FORM top_of_page.
WRITE: sy-title.
ENDFORM.
FORM xtop_of_page *
FORM xtop_of_page.
WRITE: 'Error Records'.
ENDFORM.
Reward points if this Helps.
Manish -
Table display in Selection Screen
In upper part of selection screen, there would be 2 parameters.
In lower part of selection screen, there would be 2 table display side by side. Data of these two tables can be changed from here.
Parameters are not related with tables data.
After executing the program, all the data from those Database table will be shown into selection-screen's individual table area.
After changing data, while click to 'save' button, changes would reflect into database.
Can any one please help on this matter?HI,
You can do in the following way.
You have to create a different screen for holding the table control.. When the checkbox is ticked just call the screen using CALL SCREEN or LEAVE SCREEn in your program which will display your table control.
or else
Go with module pool program.
Design the screen as your requirement.
Under PBO write the bleow code.
Create a module like MODULE_DEACTIVATE_TC.
write the below code to invisible TC initially.
IF CHECKBOX IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'TC'.
SCREEN-INPUT = '0'.
SCREEN_INVISIBLE = '1'.
MODIFY SCREEN.
ENDIF.
ENDIF.
Create module inder PAI,to acivate TC
MODULE ACTIVE_TC.
inside module write bleow code.
IF CHECKBOX EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'TC'.
SCREEN-INPUT = '1'.
SCREEN_INVISIBLE = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
Regards,
Pavan. -
How to display two "columns" in combobox?
Hi,
I need to display two strings for each row of a combobox. Say string array str1 = {"abc", "aw", "axz12"}, str2 = {"12.1", "33.123", "5.06612"}. Now I want to display them in a combo box as a "table with 2 columns", i.e. when the drop down menu is clicked, it will show something like a table (with or w/o borders)
abc 12.1
aw 33.123
axz12 5.06612
if the first one is selected, it will show "abc 12.1". I could use jcomboboxA.addItem(str1[i] + " " + str2), but it does not show nicely -- not as a table. Is there any way to do it?
Thanks!
HarveyThanks for the answer to the first question. Though if I include the list.setFont() method in the getListCellRendererComponent or in the custom UI i've created, I still get monospaced data.
As for the second one about getting long data to display correctly
I already changed the tabstop location from right to left and all data appears fine for most of the elements in the list, but if the text is very long for the second column, the long text values in the 2nd column smash up against the values in the first column. (I wish I could provide a screen print here... a thousand words and all that). Here's what the data looks like in the list:
aa's really really really really really long description
x x's description
y y's description
zz's really really really really long description
I've already resized the popup list so there's plenty of room to show the long text. I'll paste the code here so you can see exactly what I've got. I give the combobox 2 string arrays, one for codes & one for descriptions. combo.getText() needs to give JUST the code. The popup window stuff is mostly cut & paste (probably from camikr's other posting), so I'm not sure if the difficulty is there... I cannot profess to understand each line.
Thanks all, for any input...
public class CustomComboBox extends JComboBox {
public int _maxdatawidth = 0;
private int size;
public CustomComboBox(Object[] codes, Object[] names) {
size = codes.length;
int textlength = 0;
String data [][] = new String[size][2];
for (int i = 0; i < size; i++) {
data[0] = (String) codes[i];
data[i][1] = (String) names[i];
if (data[i][1].length() > textlength)
textlength = data[i][1].length();
// create a customized model for getting selected item.
DefaultComboBoxModel model = new DefaultComboBoxModel(data);
this.setModel(model);
setRenderer(new TabListRenderer());
// set the maxwidth for popup size
FontMetrics fm = this.getFontMetrics(this.getFont());
// give 20% buffer to make sure the popup is big enough
_maxdatawidth = Math.round((textlength) * fm.charWidth('W') * 1.20F);
// select the first item by default
// must select the item before setting the UI to show the default.
// ttcp 7/1 trying to select item. >>> NOT working.
this.getModel().setSelectedItem(data[1]);
this.getModel().setSelectedItem(data[0]);
// this.setSelectedItem(data[0]);
// set the UI
setUI(new CustomComboBoxUI(this));
// select the first item by default
// this.setSelectedItem(data[0]);
// this.setSelectedIndex(0);
// this.setSelectedIndex(0);
public Object getSelectedData() {
Object loReturn = null;
loReturn = super.getSelectedItem();
if (loReturn instanceof Object[]) {
Object[] selecteddata = (Object[]) loReturn;
if (selecteddata.length > 0)
loReturn = selecteddata[0];
else {
loReturn = null;
return loReturn;
class TabListRenderer extends JTextPane implements ListCellRenderer {
private static final int TAB_COLUMN = 12;
private Color background = UIManager.getColor("ComboBox.selectionBackground");
private Color foreground = UIManager.getColor("ComboBox.selectionForeground");
// private Font font = UIManager.getFont("List.font");
TabListRenderer() {
setMargin(new Insets(0, 0, 0, 0));
// can't seem to get the font NOT monospaced.
setFont(new Font("Dialog", Font.PLAIN, 11));
FontMetrics fm = getFontMetrics(getFont());
int tabWidth = fm.charWidth('w') * TAB_COLUMN;
TabStop tab = new TabStop(tabWidth, TabStop.ALIGN_RIGHT, TabStop.LEAD_NONE);
TabStop[] tabs = new TabStop[1];
tabs[0] = tab;
TabSet tabSet = new TabSet(tabs);
SimpleAttributeSet attributes = new SimpleAttributeSet();
StyleConstants.setTabSet(attributes, tabSet);
getStyledDocument().setParagraphAttributes(0, 0, attributes, true);
setPreferredSize(new Dimension(tabWidth, fm.getHeight()));
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
String leftData = ((String[]) value)[0];
String rightData = ((String[]) value)[1];
setText(leftData + "\t" + rightData);
setBackground(isSelected ? background : null);
setForeground(isSelected ? foreground : null);
return this;
class CustomComboBoxUI extends MetalComboBoxUI {
final CustomComboBox _box;
public CustomComboBoxUI(final CustomComboBox pobox) {
super();
_box = pobox;
protected ComboPopup createPopup() {
BasicComboPopup popup = new BasicComboPopup(comboBox) {
public void show() {
Dimension popupSize = _box.getSize();
popupSize.setSize(_box._maxdatawidth, getPopupHeightForRowCount(_box.getMaximumRowCount()));
Rectangle popupBounds = computePopupBounds(_box.getX(), comboBox.getBounds().height, popupSize.width, popupSize.height);
scroller.setMaximumSize(popupBounds.getSize());
scroller.setPreferredSize(popupBounds.getSize());
scroller.setMinimumSize(popupBounds.getSize());
list.invalidate();
int selectedIndex = comboBox.getSelectedIndex();
if (selectedIndex == -1) {
list.clearSelection();
} else {
list.setSelectedIndex(selectedIndex);
list.ensureIndexIsVisible(list.getSelectedIndex());
setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled());
show(comboBox, popupBounds.x, popupBounds.y);
popup.getAccessibleContext().setAccessibleParent(comboBox);
return popup; -
Obiee 11.1.1.6.6 - analysis displays two dates instead of one prompted
Hi all,
my analysis somehow displays two dates instead of one prompted.
How can it be?
Tell me please what additional information should I include for you to help me.
obiee 11.1.1.6.6
Upd: prompt screenshots
http://marchello.ccx-grads.org/img/BI_prompt_001.png
http://marchello.ccx-grads.org/img/BI_prompt_002.pngThis is from "Administration" -> "Manage Sessions" section of obiee
1) everything seems fine, WHERE clause shows correct date
SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/shared/VB/8.RB-213.BI.1';SELECT
0 s_0,
"VB"."VBIREP8"."AASYSDATE" s_1,
"VB"."VBIREP8"."ADAY" s_2,
"VB"."VBIREP8"."AMONTH" s_3,
"VB"."VBIREP8"."ARCDATE" s_4,
"VB"."VBIREP8"."AYEAR" s_5,
"VB"."VBIREP8"."CONTRAGENTID" s_6,
"VB"."VBIREP8"."CONTRAGENTNAME" s_7,
"VB"."VBIREP8"."CREDITS" s_8,
"VB"."VBIREP8"."DEPOSITARY" s_9,
"VB"."VBIREP8"."DEPOSITS" s_10,
"VB"."VBIREP8"."IDENTIFYCODE" s_11,
"VB"."VBIREP8"."OVERDAY30" s_12,
"VB"."VBIREP8"."RESTRUCTURED" s_13,
"VB"."VBIREP8"."SEGMENT" s_14,
"VB"."VBIREP8"."STATUS" s_15,
"VB"."VBIREP8"."TOBO" s_16
FROM "VB"
WHERE
(CAST("VBIREP8"."ARCDATE" AS DATE) = date '2013-08-15')
ORDER BY 1, 3 ASC NULLS LAST, 4 ASC NULLS LAST, 6 ASC NULLS LAST, 5 ASC NULLS LAST, 7 ASC NULLS LAST, 8 ASC NULLS LAST, 12 ASC NULLS LAST, 15 ASC NULLS LAST, 16 ASC NULLS LAST, 9 ASC NULLS LAST, 14 ASC NULLS LAST, 13 ASC NULLS LAST, 11 ASC NULLS LAST, 10 ASC NULLS LAST, 17 ASC NULLS LAST, 2 ASC NULLS LAST
FETCH FIRST 100000001 ROWS ONLY
2) and now attention, I press "next rows" arrow, my WHERE clause is simply ABSENT!
SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/shared/VB/8.RB-213.BI.1';SELECT
0 s_0,
"VB"."VBIREP8"."AASYSDATE" s_1,
"VB"."VBIREP8"."ADAY" s_2,
"VB"."VBIREP8"."AMONTH" s_3,
"VB"."VBIREP8"."ARCDATE" s_4,
"VB"."VBIREP8"."AYEAR" s_5,
"VB"."VBIREP8"."CONTRAGENTID" s_6,
"VB"."VBIREP8"."CONTRAGENTNAME" s_7,
"VB"."VBIREP8"."CREDITS" s_8,
"VB"."VBIREP8"."DEPOSITARY" s_9,
"VB"."VBIREP8"."DEPOSITS" s_10,
"VB"."VBIREP8"."IDENTIFYCODE" s_11,
"VB"."VBIREP8"."OVERDAY30" s_12,
"VB"."VBIREP8"."RESTRUCTURED" s_13,
"VB"."VBIREP8"."SEGMENT" s_14,
"VB"."VBIREP8"."STATUS" s_15,
"VB"."VBIREP8"."TOBO" s_16
FROM "VB"
ORDER BY 1, 3 ASC NULLS LAST, 4 ASC NULLS LAST, 6 ASC NULLS LAST, 5 ASC NULLS LAST, 7 ASC NULLS LAST, 8 ASC NULLS LAST, 12 ASC NULLS LAST, 15 ASC NULLS LAST, 16 ASC NULLS LAST, 9 ASC NULLS LAST, 14 ASC NULLS LAST, 13 ASC NULLS LAST, 11 ASC NULLS LAST, 10 ASC NULLS LAST, 17 ASC NULLS LAST, 2 ASC NULLS LAST
FETCH FIRST 100000001 ROWS ONLY
Sure, I receive another date (01.02.2013). Just one thing is strange here - why do I receive only one extra date (I should receive ALL dates in Oracle table when I perform query without any WHERE clause). -
JComboBox display two different lists
I have a JComboBox in a JTable column. The requirement is that the JComboBox displays two different lists based upon which mouse button is clicked on the JComboBox. i.e When user clicks on mouse Button1 the JComboBox should popup with a list of products(user default products). But, when the user clicks on mouse Button2 the JComboBox should popup with a different list of products(all the products).
Any help will be appreciated,
Thanks in advance!UNDEBUGGED, UNTESTED, OFF THE CUFF CODE
public class myEditor extends AbstractCellEditor implements TableCellEditor {
private int sel = 0;
private String[][] str = {{"Option 1", "Option 2", "Option 3"},
{"Select 1", "Select 2", "Select 3"}};
private JComboBox[] fieldCombos = new JComboBox[str.length];
private DefaultCellEditor[] fieldEditors = new DefaultCellEditor[str.length];
public myEditor() {
for (int i=0; i<fieldEditors.length; i++) {
fieldCombos[i] = new JComboBox();
for (int j=0; j<str[0].length; j++) {
fieldCombos.addItem(str[0][j]);
fieldEditors[i] = new DefaultCellEditor(fieldCombos[i]);
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
fieldCombos[sel].setSelectedItem(value);
return fieldEditors[sel];
public void setSelector(int Selector) {
if (Selector>=0 && Selector<str.length) sel=Selector; -
Display two lines under one column in ALV
Hello Friends,
I have a situation... i need to display two or three lines under single column in ALV report.
example:
col1 col2 col3 col4
AAA 10 456.78 TEST PURPOSE HBDFJEHBEJBE EBDF B EFH
EDEHFKHEKFHEKJCFEKJFHKEJHFKEHFEFJK
DJFHGCGD
AAA 20 121.78 TEST PURPOSE HBDFJEHBEJBE EBDF B EFH
BBB 10 11.78 TEST PURPOSE HBDFJEHBEJBE EBDF B EFH EJ
EFKBEJF KEFHEKJFHEJ KFEHKE HFKEH
MEFBHEJFB EFBEJ EFGJEGF JEGFEGEKJE KEFHK
EFKEFEKLKL
Anyone has idea?
Thanks in advance
Regards
RaghuHi,
You can do this by doing some additional coding..
Ex..
** Let's assume you are using the internal table t_output for displaying the ALV...
** and t_final contains the data..t_text which contains the multiple lines texts...for the
** column col4...
DATA: s_output LIKE LINE OF t_output.
DATA: v_flag TYPE xfeld.
LOOP AT t_final INTO s_final.
* Clear the work areas.
CLEAR: v_flag,
s_output.
* Move all the data.
MOVE ls_final TO s_output.
LOOP AT t_text WHERE col1 = s_final-col1.
* First time move all the columns to the output internal table...for the rest of the records
* just populate the col4..
IF v_flag IS INITIAL. " For the first time.
s_output-col4 = t_text-text. " Move the text.
APPEND s_output TO t_output.
v_flag = 'X'.
ELSE.
clear s_output.
s_output-col4 = t_text-text. " Move the text.
APPEND s_output TO t_output.
ENDIF.
ENDLOOP.
* IF there is no text found just append the output internal table with blank col4.
IF sy-subrc <> 0.
APPEND s_output TO t_output.
ENDIF.
ENDLOOP.
Hope the example is clear...
Thanks
Naren -
How to display two lables in alv report
Is there any chance to display two lables in alv report
for example..
AMOUNT
Rs | Ps
|
like that this for an example.
thanks,
JBHai Babu
Go through the following Code
using Classes & Methods
try with the following Code( Just copy the code & try with in SE38 Tcode & Execute it that all)
REPORT ZALV_SALES_HEADER_DETAIL MESSAGE-ID Z50650(MSG) .
TABLES
TABLES: VBAK . "SALES DOCUMENT HEADER
DATA OBJECTS DECLARATION
DATA: IT_VBAK TYPE STANDARD TABLE OF ZVBAK_STRUC,
IT_VBAP TYPE STANDARD TABLE OF ZVBAP_STRUC,
GS_LAYOUT TYPE LVC_S_LAYO,
GS1_LAYOUT TYPE LVC_S_LAYO,
GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
VBAK_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
VBAP_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
WA_VBAK LIKE LINE OF IT_VBAK,
WA_VBAP LIKE LINE OF IT_VBAP,
SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
TOP_OF_PAGE_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
GRID_VBAP TYPE REF TO CL_GUI_ALV_GRID,
TOP_PAGE TYPE REF TO CL_DD_DOCUMENT,
FLAG(1).
*"EVENT RECIEVER CLASS DEFINITION
CLASS LCL_EVENT_RECIEVER DEFINITION DEFERRED.
DATA: OBJ_EVENT TYPE REF TO LCL_EVENT_RECIEVER.
SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK B1.
CLASS DEFINITION AND DECLARATIONS
CLASS LCL_EVENT_RECIEVER DEFINITION.
PUBLIC SECTION.
EVENTS:DOUBLE_CLICK,
TOP_OF_PAGE.
METHODS:HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW .
METHODS: HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID.
ENDCLASS. "LCL_EVENT_RECIEVER DEFINITION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION.
METHOD: HANDLE_DOUBLE_CLICK.
READ TABLE IT_VBAK INDEX E_ROW-INDEX INTO WA_VBAK.
PERFORM FETCH_ITEM_DETAILS USING WA_VBAK.
PERFORM ALV_GRID.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
METHOD: HANDLE_TOP_OF_PAGE.
CALL METHOD TOP_PAGE->ADD_TEXT
EXPORTING
TEXT = 'SALES HEADER & ITEM DETAILS'.
CALL METHOD TOP_PAGE->DISPLAY_DOCUMENT
EXPORTING
PARENT = TOP_OF_PAGE_CONTAINER.
ENDMETHOD. "HANDLER_TOP_OF_PAGE
ENDCLASS. "LCL_EVENT_RECIEVER IMPLEMENTATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
IF S_VBELN IS NOT INITIAL.
SELECT COUNT(*)
FROM VBAK
WHERE VBELN IN S_VBELN.
IF SY-DBCNT = 0.
MESSAGE E000 WITH 'NO TABLE ENTRIES FOUND FOR LOW KEY SPECIFIED'.
ENDIF.
ENDIF.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM FETCH_SALES_HEADER_RECORD.
PERFORM CREATE_CALL. "CREATION OF OBJECTS & CALLING METHODS
END-OF-SELECTION.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form FETCH_SALES_HEADER_RECORD
text
--> p1 text
<-- p2 text
FORM FETCH_SALES_HEADER_RECORD .
SELECT
VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE IT_VBAK
WHERE VBELN IN S_VBELN
AND VBTYP = P_VBTYP.
ENDFORM. " FETCH_SALES_HEADER_RECORD
*& Form CREATE_CALL
text
--> p1 text
<-- p2 text
FORM CREATE_CALL .
IF CUSTOM_CONTAINER IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM_CONTAINER'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT SPLITTER
EXPORTING
TOP = 5
PARENT = CUSTOM_CONTAINER
ROWS = 3
COLUMNS = 1
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = TOP_OF_PAGE_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = VBAK_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 3
COLUMN = 1
RECEIVING
CONTAINER = VBAP_CONTAINER.
CREATE OBJECT GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAK_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
GS_LAYOUT-GRID_TITLE = 'SALES HEADER DETAILS.'(100).
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAK_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAK
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT OBJ_EVENT .
SET HANDLER OBJ_EVENT->HANDLE_DOUBLE_CLICK FOR GRID.
SET HANDLER OBJ_EVENT->HANDLE_TOP_OF_PAGE FOR GRID.
CREATE OBJECT TOP_PAGE
EXPORTING
STYLE = 'ALV_GRID'
CALL METHOD TOP_PAGE->INITIALIZE_DOCUMENT.
CALL METHOD GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = TOP_PAGE.
CALL SCREEN 100.
ENDFORM. " CREATE_CALL
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form FETCH_ITEM_DETAILS
text
--> p1 text
<-- p2 text
FORM FETCH_ITEM_DETAILS USING WA_VBAK TYPE ZVBAK_STRUC .
SELECT
VBELN
POSNR
MATNR
MATWA
PMATN
CHARG
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN = WA_VBAK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO RECORDS FOUND FOR SPECIFIED KEY'.
ENDIF.
ENDFORM. " FETCH_ITEM_DETAILS
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
MODULE USER_COMMAND_0200 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form alv_grid
text
--> p1 text
<-- p2 text
FORM ALV_GRID .
IF FLAG = ''.
FLAG = 'X'.
CREATE OBJECT GRID_VBAP
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAP_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
GS1_LAYOUT-GRID_TITLE = 'SALES ITEM DETAILS.'(100).
CALL METHOD GRID_VBAP->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAP_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS1_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAP
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alv_grid
Thansk & regards
Sreenivasulu P -
How to display two grids in same screen using SALV Method
Hi Freinds,
Please let me know how to display two grids in same screen using SALV Method.
Thank you
Regards,
SDVUsing the same concept as described in How to dispaly Three Internal Table Data (One below another) in ALV OOPS .
All you need to add is passing your new containers as r_container parementer of factory method.
"1st one
cl_salv_table=>factory(
EXPORTING
R_CONTAINER = g_top_container
"2nd one
cl_salv_table=>factory(
EXPORTING
R_CONTAINER = g_bottom_container
Regards
Marcin -
Master advance table with two detail advanced tables
Hi All,
I have this in mind..please let me know if that is possible.
I want to have two detail advanced tables within a master advance table.
The two detail advance tables will be wrapped in a subtab layout.
My questions are:
Can a master table have two details tables?
Can a advance table have two inner advance tables?
Your help or ideas would be valuable to me.
Thank you,
ArunHi OAF Gurus
I just want to know whether this is possible or not.
I have created two view links and three view objects
Table in Table in Table
Table1--> Table2 --> Table3
One problem i am facing when i click on Show link of Table1,it displays details of Table2 and when i click Show link of Table2,it displays details of Table3.
but when i click on Hide of Table1, it says
oracle.jbo.NoDefException: JBO-25002: Definition <Table3 View Object> of type Attribute not found
Could you please anybody throw some pointers on this?
Thanks
Hitesh
Maybe you are looking for
-
How will be outbound data structure in sap xi after executing the stored pr
Hi All can any one please tell me how will be outbound data structure in sap xi after executing the stored procedure by sender JDBC adapter? Thanks in advance regards Rams
-
Error: Could not initialize ORB monitoring
Hi All, I use Java application client to access SunONE 7 (final release, not beta) and got an error below. 1. The error was printed on screen, not thrown to program (any error should thrown to the program, so we know that). 2. It seems no harm. My pr
-
Quick Time 7.0d0 - itunes install failed
I know this topic has been probably been beaten to death, but it seems like I'm the only one who can't figure it out. I've read almost all the posts, but am still stuck. So.... Calling members like "B Noir" - Help! After "successfully" installing and
-
Launchd crashing Yosemite system OFTEN
Getting a crash on my MacPro many times a day. Totally restarts with 'kernel panic' type screen. Is anyone else getting this. Any ideas for solving? Crash log below... Anonymous UUID: E7C2C2F5-918D-0078-4AC9-3B8561D45C01 Mon Oct 20 11:22:31 201
-
cfdocument ... conditional printing
<cfif entry.name EQ session.realUserName> <cfdocument format="pdf" margintop = ".5" marginbottom = "1" marginleft = ".5" marginright = ".5"> <!--- printing OK ---> <cfelse> <cfdocument format="pdf" margintop = ".5" marginbottom = "1" marginleft = ".5