How to set number of Rows of a table to be displayed based on user action?
Hi Experts,
I am getting data into the table. But only 5 records are displayed default. I want it to be a user selection.
If user wishes to see 10 records, then first 10 records should get displayed. If user selects 'n' records then 'n' records should get displayed..
How to achieve this?
Regards,
Yugesh A.
hi Yugesh ,
1 create a input field UI
2 bind its value property to a attribute
3 suppose ca_check attribute ( type string ) under node cn_check is binded
read this in ur doinit of the view
DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
DATA ls_cn_check TYPE wd_this->element_cn_check.
DATA lv_ca_check LIKE ls_cn_check-ca_check.
* navigate from <CONTEXT> to <CN_CHECK> via lead selection
lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
* get element via lead selection
lo_el_cn_check = lo_nd_cn_check->get_element( ).
* get single attribute
lo_el_cn_check->get_attribute(
EXPORTING
name = `CA_CHECK`
IMPORTING
value = lv_ca_check ).
4 nw for ur table , make a another context attribute of type either string or I , say attr1
bind its visiblerowcount property of table to attr1
5 make a attribute in ATTRIBUTES tab of type string , say attribute
set its value to lv_ca_check in doinit itself
wd_this->attribute = lv_ca_Check
6 nw in the method , where u need to validate how m,any rows user enter or doinit itself , set attr1 to the value of that attribute created under ATTRIBUTES tab ( named attribute)
DATA : lv_count type string .
lv_count = wd_this->attribute
7 nw its very simple , set attr1 to lv_count , as it contains the count of the number which has entered in the input field
DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
DATA ls_cn_check TYPE wd_this->element_cn_check.
DATA attr1 LIKE ls_cn_check-ca_check.
* navigate from <CONTEXT> to <CN_CHECK> via lead selection
lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
* get element via lead selection
lo_el_cn_check = lo_nd_cn_check->get_element( ).
* set single attribute
lo_el_cn_check->set_attribute(
EXPORTING
name = `attr1`
value = lv_count ).
I hope it shud help
proceed like these , u wud be able to achieve the desired functionality
regards,
amit
Edited by: amit saini on Oct 20, 2009 1:12 PM
Similar Messages
-
How to find number of rows in a table
i have one table ,it contains millions of record,how can i know number of rows in that table without using count(*),
i tried in user_table ,for the column NUM_ROWS,but it is not showing number of rows,pls send me a solution for this.
regards,
singhOk, that only was to show simply that max option
might not an option to reduce execution time.Yes, but I/O variances have a tendency to really skew the observed elapsed execution time - making execution time alone a poor choice to determine what SQL will perform better than another.
Both MAX(ROWNUM) and COUNT(*) results in the same amount of I/O - as both uses the exact same execution plan, I/O wise. In this example, a FTS.
SQL> create table testtab nologging as select * from all_objects where rownum < 10001;
Table created.
-- warmed up the buffer cache with a couple of SELECTs against TESTAB in order
-- to discard PIOs from the results
SQL> set autotrace on
SQL> select count(*) from testtab;
COUNT(*)
10000
Execution Plan
Plan hash value: 2656308840
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 (9)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL| TESTTAB | 9262 | 35 (9)| 00:00:01 |
Note
- dynamic sampling used for this statement
Statistics
0 recursive calls
0 db block gets
131 consistent gets
0 physical reads
0 redo size
223 bytes sent via SQL*Net to client
238 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> select max(rownum) from testtab;
MAX(ROWNUM)
10000
Execution Plan
Plan hash value: 2387991791
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 (9)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | COUNT | | | | |
| 3 | TABLE ACCESS FULL| TESTTAB | 9262 | 35 (9)| 00:00:01 |
Note
- dynamic sampling used for this statement
Statistics
0 recursive calls
0 db block gets
131 consistent gets
0 physical reads
0 redo size
225 bytes sent via SQL*Net to client
238 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
So seeing that we have the exact same baseline for both queries, and that PIO does not influence the results, we time a 1000 executions of both.
SQL> declare
2 cnt number;
3 begin
4 for i in 1..1000
5 loop
6 select count(*) into cnt from testtab;
7 end loop;
8 end;
9 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.19
SQL>
SQL> declare
2 cnt number;
3 begin
4 for i in 1..1000
5 loop
6 select max(rownum) into cnt from testtab;
7 end loop;
8 end;
9 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:15.87
SQL>
This shows that what makes the MAX() more expensive is just that - determining the MAX(). For each row, Oracle has to call its internal MAX() function with two values - the current max result and the new value. This function then returns the new max value. This overhead per row adds up to a significant overhead in execution time - making the MAX() approach 5x slower than the COUNT() approach. -
How to retrieve number of rows of a table by jdbc?
can anyone show me a simple snippet of a java code about how to retrieve the number of ROWS in a table?
or even only showing the jdbc command that does this job would be enough.
thanks in advance :)
cheers1. query for the count, then execute the query
"select count(*) from test" then
"select * from test"
2. create a scrollable ResultSet then
rs.last();
int count = rs.getRow();
rs.beforeFirst();
Jamie
p.s. this topic has been discussed MANY times. Do a search on this forum and you will get lots of other discussions on this topic. -
How to set number of rows in filters?
Hi, we need to set another number of rows which is displayed in filters on bex or web template?
Thanks for adviceHi Pavel,
can you please specify your question more clearly. If you are on NW 7.0 you can determine a number of colums for your filter item with following command:
COLUMNS
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/85/08e241aa8e9d39e10000000a155106/content.htm
If you meant the amount of rows within the analysis item you can use following command within your analysis item:
BLOCK_ROWS_SIZE (numbers of rows displayed at once)
BLOCK_ROWS_STEP_SIZE (numbers of rows to be scrolled for one step)
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/76/489d39d342de00e10000000a11402f/content.htm
Brgds,
Marcel
Edited by: Marcel Landsfried on Feb 10, 2009 7:45 PM
Edited due to wrong url -
How to set number of rows in "Rows Per Page Selector" in Interactive Report
Hi Guys,
Is there any way to set the number of rows in "Rows Per Page Selector" in Interactive Report. By default it is set to 15.
I know one way is to change the number of rows when you are running the report and then set that as 'Default Report Setting'.
If anybody is aware of any other way, please let me know.
Cheers,
Ashish Agarwal
http://www.dbcon.com.sgHi Pavel,
can you please specify your question more clearly. If you are on NW 7.0 you can determine a number of colums for your filter item with following command:
COLUMNS
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/85/08e241aa8e9d39e10000000a155106/content.htm
If you meant the amount of rows within the analysis item you can use following command within your analysis item:
BLOCK_ROWS_SIZE (numbers of rows displayed at once)
BLOCK_ROWS_STEP_SIZE (numbers of rows to be scrolled for one step)
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/76/489d39d342de00e10000000a11402f/content.htm
Brgds,
Marcel
Edited by: Marcel Landsfried on Feb 10, 2009 7:45 PM
Edited due to wrong url -
How to generate an incrementing batch-number per set number of rows
Hi,
How could you generate an incrementing batch-number per set number of rows for a table in SQL?
The returned result set of the SQL query should show a preceding batch number per row set and incremented by 1 for the next row set.
Eg, you want to start the batch_number by 1 for the first three returned rows of the table and than increment by 1 for the next three rows.
The result set would look like:
BATCH_NO, TAB_COL1, TAB_COL2, TAB_COL3, TAB_COL4, ..
1, ...
1, ...
1, ...
2, ...
2, ...
2, ...
3, ...
3, ...
3, ...
etc.
Cheers.Many thanks guys, I would have never thought about these options.. Yes the reason for adding the preceding batch number has to do with migrating data from a source table where we only can grab small sets of rows at the time to bring across to a target table.
Cheers. -
How to get number of rows return in SELECT query
i'm very new in java, i have a question:
- How to get number of rows return in SELECT query?
(i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
Thanks.make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
String sql = "select * from testing";
PreparedStatement ps =
con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs = ps.executeQuery();
rs.last();
System.out.println("Row count = " + rs.getRow());
rs.beforeFirst();~Tim
NOTE: Ugly, but does the trick. -
How to control number of rows displayed in a report by user?
Hi All!
I have provided a select list called 'Number of rows' in my report page.User can choose any number in the list, and accordingly he should be able to see so many number of rows in that report page.
For example: if user selects 50 from the list, he will be able to see 50 records at a time out of say 2000 records retrieved. I want to control number of rows displayed per page dynamically. And if he selects 25 in the select list, he should be able to see 25 records at a time out of 2000.
How to do it? Please give me ideas.
Thanking in advance.
Regards,
Deepika.Hi Deepika,
If you have a Select List with Submit called, say "P1_ROWS", you just enter P1_ROWS into the Report Attribute's "Number of Rows (Item)" setting.
Regards
Andy -
How to increase number of rows display in ESS
Hi All,
how to increase number of rows display in ESS applications especially in Time approval inbox from standard display of 5 rows to say like 20 rows? is there a quick way to do it?
Thanks all
MurtyKalpesh,
it is actually in web dynpro view, I have seen this setting and it doesnt give option for increasing default number of rows in web dynpro application. Table is dynamically constructed in web dynpro implementation and I have the hard time finding out., Any help is appreciated in these lines,
Thanks
Murty -
How to restrict number of rows display using ig:gridView
Hi
All
How to restrict number of rows display using <ig:gridView datasource="{mybean.mylist}">
i am getting 10 rows using data_row . i wanna show only first 5 rows .
pageSize ="5" will be ok . but it displays remaining rows in next page. but i want to display only first 5 rows . is there any attribute to restrict number of rows.
thanks
rambhapuriI have no idea which component you're talking about. If want to discuss here about a non-Sun JSF component, then please mention about the name, version and build in detail. You can also consider posting this question at the website/forum/mailinglist of the component manfacturer rather than here. At least I can tell you that the Sun JSF h:dataTable has the 'rows' attribute for that. I can also suggest you to just take a look in the TLD documentation of the component in question. There should be all possible attributes listed with a detailed explanation about the behaviour.
-
How to calculate number of rows for perticular characterstic in SAP BI Bex
Hi experts,
Please let me know how to calculate ' number of rows ' for perticular characterstic in Bex query.
Thanks & Regards,
Babu..Hello,
You can try this
Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select 'always display'.
Thanks.
With regards,
Anand Kumar -
How to count number of rows in table
can I get number of row in table except Count(*) in pl/sql
is there any other wayAlso posted and answered here
how to count number of rows in table
count(*) will be the fastest way. It is only slow if the table has a vast number of rows, in which case why do you need to know the tables has 73552436467721 rows and not 73552436467737 rows. It doesn't seem to be much use. Either that or you are counting them a lot, which again seems rather pointless. -
How to restrict number of row/lines in a table in RTF
Hi,
Im working on PO report. It has header information in the header part of RTF. But coming to the lines , I put that under a different group in the table in the body part of the RTF. I did a FOR loop for printing PO Lines because it does have multiple line information. But now i have to restrict the number of rows in that table per page irrespective of number of PO Lines. After printing 20 rows in the table, it should go to the next page. Im going through the other threads for the solution.
Thanks,
venkatThere are so many thread regarding this ,
pls go thru them patiently...
logic is something like....
use if condition and position() and say page-break..
use for-each@section instead of for-each..so that the headed info is maintained with regards to PO lines
happy searching...
if you cant get still, last option send me mail with details -
Displayin message and fixing the number of rows in a table
Hi Experts,
I have a requirement like this
there is a table, where i need to diplay a message when there are no records and no rows should be visible on that table.
Also, when the records are populated from the context, i need to fix the number of rows in that table and display the records.
Please let me know hw this can be achieved.
Also in the table I have Link to URL, please let me know how to handle this reference, when i set the reference Property, its giving me an error stating that the file doesn't exist when the table gets loaded.
Thanks in Advance
Regards,
PalaniHi
Oh!! You should to explain it at first thread itself that you want to display a JPG imange or other WDWebResourceTypetaken form the backend.
1. So this is not at all a URL
2. You have to convert binary data to WDWebResource then display it in either Image UI element or other (like PDF , txt etc)
3
try
// Read the datasource of the FileUpload
IWDResource res = wdContext.currentContextElement().getResource();
InputStream in = res.read(false);
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
int length;
byte[] part = new byte[10 * 1024];
while ((length = in.read(part)) != -1)
bOut.write(part, 0, length);
in.close();
bOut.close();
IPrivateUploadCompView.IImageTableElement ele = wdContext.nodeImageTable().createImageTableElement();
ele.setImage(wdContext.currentContextElement().getResource().getUrl(0));
ele.setText(res.getResourceName());
wdContext.nodeImageTable().addElement(ele);
catch (Exception e)
wdComponentAPI.getMessageManager().reportWarning(e.toString());
Here I assume that you convert that data to IWDResource type or
4.
WDWebResource.getWebResource(wdContext.currentContextElement().getresource(), type);
// getResource of type binary which u read from BAPI and set it in local context , type is MIMETYPE or hardcode it as "JPG"
5. Further help
[Help1|To Displayan Image in Webdynpro Java from Standard Function Module;
[Help2|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumentstobeusedinWeb+Dynpro]
[Help3|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumenttobeusedinWeb+DynPro]
It might code look strange at first , please do some reserch in SDN ,I did my best at this level.
Best Regards
Satish Kumar -
How to delete a particular row in ALV table
Hi,
How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
Thanks
Bala DuvvuriHello Bala,
Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
data : lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_config TYPE REF TO cl_salv_wd_config_table.
lr_table_settings ?= lr_config.
** Setting the ALV selection to multiple selection with no lead selection
lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
Next delete the selected rows in the action triggered by the button:
METHOD onactiondelete_rows .
DATA: wd_node TYPE REF TO if_wd_context_node,
lt_node1 TYPE ig_componentcontroller=>elements_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set,
row_number TYPE i VALUE 0.
wd_node = wd_context->get_child_node( name = 'NODE' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
CALL METHOD wd_node->get_static_attributes_table
EXPORTING
from = 1
to = 2147483647
IMPORTING
table = lt_node1.
wd_node->bind_table( new_items = lt_node1 ).
ENDMETHOD.
If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
Regards,
Uday
Maybe you are looking for
-
I Just updated my iPhone 4 to 7.1 oS. I am unable to connet to any network. I keep getting the "searching" No Service" messages on the top let corner of the screen. I also get a notice that says " "Unable to load network list. I need help... How can
-
After just over a year my lovely 24inch Intel iMac has decided to kill the DVD/CD drive. Nothing will go in. It is dead I fear. So if I order a new drive, is the fitting easy? I do not want the trouble of sending the machine back.
-
Using a Buffalo Linkstation NAS drive on the Airport Extreme 802.11n
I used the Buffalo Linkstation NAS drive on the previous Airport Extreme. I just upgraded to the new Airport Extreme and cannot get it to work. Buffalo support, after a two hour wait and and a 40 minute conversation, decided that it wouldn't work. If
-
How does one resize a photo to the dimensions required by a contest?
How does one resize a photo in aperture to the dimensions required by contest?
-
Sound problems after rendering
Hi, Being that I have Premiere Pro 7.0, I am not too sure how much help I will get, but i was hoping that someone here could still help if all possible. Here is my problem. I thought I start practicing developing video lessons for 3d software. The