How to fetch rows from a table like search engines do?
Is it possible to fetch rows from a table like Google does? I want to fetch row number 20-40 after the select has ordered the rows.
Pseudo code: select * from log where rownum > 20 and rownum < 40 order by date;
Rownum doesn't work with ordering so I tried:
select * from log where (select * from log order by date) and rownum <20;
But that still doesn't do what I want. I get the "top 20" rows but I can't get rows 20-40.
My real table has 70000 rows and I want to select 69000-70000 so I really need a SQL do fetch only the rows I need.
Any help would be very appreciated!
Best regards,
Christer Nordvik
SELECT alias_for_rownum, column_names
FROM (SELECT ROWNUM AS alias_for_rownum, column_names
FROM (SELECT column_names
FROM table_name
ORDER BY columns_to_order_by)
WHERE ROWNUM <= last_row_you_want)
WHERE alias_for_rownum >= first_row_you_want
Example:
-- (This example uses the Oracle dept demo table.
SET AUTOTRACE ON EXPLAIN
SELECT rn, deptno, dname, loc
FROM (SELECT ROWNUM AS rn, deptno, dname, loc
FROM (SELECT deptno, dname, loc
FROM dept
ORDER BY deptno)
WHERE ROWNUM <= 3)
WHERE rn >= 2
RN DEPTNO DNAME LOC
2 20 RESEARCH DALLAS
3 30 SALES CHICAGO
Similar Messages
-
How to fetch rows from multiple tables
I have a page with items from 3 tables. I need to populate these items with values from the database. The page does not allow me to use multiple automated fetches. So instead I decided to use a pl/sql page process that runs a cursor to get my field values and the uses apex_util.set_session_state to set the field item values. IS there any isues with doing this? Is there a better way?
These tables are not really related so I gues I will stick with the pl/sql to populate and then page process to insert/update/delete. Here is the code I'm using.
Chris
DECLARE
CURSOR get_info IS
select A.FK_STU_BASE, A.FK_CONTACT, A.FK_RELATION, A.PRIORITY, A.CAN_PICK_UP_STUDENT,
A.GETS_STX, A.GETS_STG, A.GETS_STA, A.GETS_DIS, A.GETS_THX, A.GETS_MED,
A.GETS_MAIL, A.NOTES as STUDENT_NOTES, A.USER_FLD1, A.USER_FLD2, A.USER_FLD3,
A.USER_FLD4, A.USER_FLD5, A.LAST_UPDATE_DATE, A.LAST_UPDATE_USER,
B.PK_ID as CONTACT_PK_ID, B.FIRST_NAME, B.LAST_NAME, B.MIDDLE_INIT, B.PREFIX,
B.SUFFIX, B.FK_LANGUAGE, B.PHONE, B.PHONE_UNLISTED, B.PHONE_EXTENSION,
B.PHONE_DESCRIPTION, B.EMERGENCY_PHONE, B.EMERGENCY_UNLISTED, B.EMERGENCY_EXTENSION,
B.EMERGENCY_DESCRIPTION, B.CELL_PHONE, B.CELL_UNLISTED, B.CELL_EXTENSION,
B.CELL_DESCRIPTION, B.CELL2_PHONE, B.CELL2_UNLISTED, B.CELL2_EXTENSION,
B.CELL2_DESCRIPTION, B.WORK1_PHONE, B.WORK1_UNLISTED, B.WORK1_EXTENSION,
B.WORK1_DESCRIPTION, B.WORK2_PHONE, B.WORK2_UNLISTED, B.WORK2_EXTENSION,
B.WORK2_DESCRIPTION, B.FAX_PHONE, B.FAX_DESCRIPTION, B.EMAIL1, B.EMAIL2,
B.NOTES as CONTACT_NOTES, B.FK_LODGING, B.FK_EDUCATION_LEVEL,
C.PK_ID as LODGING_PK_ID, C.FK_ZIP, C.FK_DISTRICT, C.HOUSE_NO, C.LETTER,
C.DIRECTION, C.STREET, C.STREET2, C.PLUS4, C.APT, C.FK_GRIDCODE,
C.FK_MUNICIPALITY, C.OPTIONAL_INFO1, C.OPTIONAL_INFO2, C.OPTIONAL_INFO3,
C.FK_DWELLING, C.OPTIONAL_ZIPCODE
from contact_link A,
contact B,
lodging C
where A.PK_ID = :P470_CONTACT_LINK_PK_ID and
B.PK_ID (+) = A.FK_CONTACT and
C.PK_ID (+) = B.FK_LODGING;
BEGIN
FOR x in get_info LOOP
-- Set Contact Link Items
APEX_UTIL.SET_SESSION_STATE('P470_FK_STU_BASE',X.FK_STU_BASE);
APEX_UTIL.SET_SESSION_STATE('P470_FK_CONTACT',X.FK_CONTACT);
APEX_UTIL.SET_SESSION_STATE('P470_FK_RELATION',X.FK_RELATION);
APEX_UTIL.SET_SESSION_STATE('P470_PRIORITY',X.PRIORITY);
APEX_UTIL.SET_SESSION_STATE('P470_CAN_PICK_UP_STUDENT',X.CAN_PICK_UP_STUDENT);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_STX',X.GETS_STX);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_STG',X.GETS_STG);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_STA',X.GETS_STA);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_DIS',X.GETS_DIS);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_THX',X.GETS_THX);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_MED',X.GETS_MED);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_MAIL',X.GETS_MAIL);
APEX_UTIL.SET_SESSION_STATE('P470_STUDENT_NOTES',X.STUDENT_NOTES);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD1',X.USER_FLD1);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD2',X.USER_FLD2);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD3',X.USER_FLD3);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD4',X.USER_FLD4);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD5',X.USER_FLD5);
APEX_UTIL.SET_SESSION_STATE('P470_LAST_UPDATE_DATE',X.LAST_UPDATE_DATE);
APEX_UTIL.SET_SESSION_STATE('P470_LAST_UPDATE_USER',X.LAST_UPDATE_USER);
--Set Contact Items
APEX_UTIL.SET_SESSION_STATE('P470_CONTACT_PK_ID',X.CONTACT_PK_iD);
APEX_UTIL.SET_SESSION_STATE('P470_FIRST_NAME',X.FIRST_NAME);
APEX_UTIL.SET_SESSION_STATE('P470_LAST_NAME',X.LAST_NAME);
APEX_UTIL.SET_SESSION_STATE('P470_MIDDLE_INIT',X.MIDDLE_INIT);
APEX_UTIL.SET_SESSION_STATE('P470_PREFIX',X.PREFIX);
APEX_UTIL.SET_SESSION_STATE('P470_SUFFIX',X.SUFFIX);
APEX_UTIL.SET_SESSION_STATE('P470_FK_LANGUAGE',X.FK_LANGUAGE);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE',X.PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE_UNLISTED',X.PHONE_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE_EXTENSION',X.PHONE_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE_DESCRIPTION',X.PHONE_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_PHONE',X.EMERGENCY_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_UNLISTED',X.EMERGENCY_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_EXTENSION',X.EMERGENCY_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_DESCRIPTION',X.EMERGENCY_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_PHONE',X.CELL_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_UNLISTED',X.CELL_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_EXTENSION',X.CELL_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_DESCRIPTION',X.CELL_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_PHONE',X.CELL2_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_UNLISTED',X.CELL2_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_EXTENSION',X.CELL2_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_DESCRIPTION',X.CELL2_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_PHONE',X.WORK1_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_UNLISTED',X.WORK1_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_EXTENSION',X.WORK1_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_DESCRIPTION',X.WORK1_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_PHONE',X.WORK2_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_UNLISTED',X.WORK2_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_EXTENSION',X.WORK2_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_DESCRIPTION',X.WORK2_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_FAX_PHONE',X.FAX_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_FAX_DESCRIPTION',X.FAX_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_EMAIL1',X.EMAIL1);
APEX_UTIL.SET_SESSION_STATE('P470_EMAIL2',X.EMAIL2);
APEX_UTIL.SET_SESSION_STATE('P470_CONTACT_NOTES',X.CONTACT_NOTES);
APEX_UTIL.SET_SESSION_STATE('P470_FK_LODGING',X.FK_LODGING);
APEX_UTIL.SET_SESSION_STATE('P470_FK_EDUCATION_LEVEL',X.FK_EDUCATION_LEVEL);
--Set Lodging Items
APEX_UTIL.SET_SESSION_STATE('P470_LODGING_PK_ID',X.LODGING_PK_ID);
APEX_UTIL.SET_SESSION_STATE('P470_FK_ZIP',X.FK_ZIP);
APEX_UTIL.SET_SESSION_STATE('P470_FK_DISTRICT',X.FK_DISTRICT);
APEX_UTIL.SET_SESSION_STATE('P470_HOUSE_NO',X.HOUSE_NO);
APEX_UTIL.SET_SESSION_STATE('P470_LETTER',X.LETTER);
APEX_UTIL.SET_SESSION_STATE('P470_DIRECTION',X.DIRECTION);
APEX_UTIL.SET_SESSION_STATE('P470_STREET',X.STREET);
APEX_UTIL.SET_SESSION_STATE('P470_STREET2',X.STREET2);
APEX_UTIL.SET_SESSION_STATE('P470_PLUS4',X.PLUS4);
APEX_UTIL.SET_SESSION_STATE('P470_APT',X.APT);
APEX_UTIL.SET_SESSION_STATE('P470_FK_GRIDCODE',X.FK_GRIDCODE);
APEX_UTIL.SET_SESSION_STATE('P470_FK_MUNICIPALITY',X.FK_MUNICIPALITY);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO1',X.OPTIONAL_INFO1);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO2',X.OPTIONAL_INFO2);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO3',X.OPTIONAL_INFO3);
APEX_UTIL.SET_SESSION_STATE('P470_FK_DWELLING',X.FK_DWELLING);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_ZIPCODE',X.OPTIONAL_ZIPCODE);
END LOOP;
END; -
How to fetch data from PTREQ tables
I need to display data in the customised webdynpro application from PTREQ tables.
Can anyone help me out how to fetch data from these tables.use the standard modules like
PT_ARQ_REQUEST_CHECK
PT_ARQ_REQUEST_EXECUTE
PT_ARQ_REQUEST_PREPARE -
How to fetch data from cluster tables
hi
i need to know how to fetch data from cluster tables please update me if any
i know that we cannot use joins in cluster table we use view etc
but i need detailed inforation on methods for fetching data from cluster tables
regards
NishantHi,
Check the following links
http://fuller.mit.edu/hr/cluster_tables.html
The specified item was not found.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33 -
How to fetch rows from PL/SQL table(Collections)
Hi,
I retrived rows from the table and stored in to table type.
Now I want fetch these rows and display on the screen. Pls guide me.
following code is my code:
DECLARE
type t1 is table of emp%rowtype index by binary_integer;
var1 t1;
v_counter number:=0;
BEGIN
select * bulk collect into var1 from emp;
for vr in var1.first..var1.last
loop
dbms_output.put_line(var1(1)); --Got an Error Here. Acually I don't Know how to fetch.
update dept set deptno=var1.deptno --Here also Error occured.
end loop;
END;Fetching rows to display them is a task for the client tool. You need to define a ref cursor therefore.
If you just want to play around, here we go
SQL> DECLARE
2 type t1 is table of emp%rowtype index by binary_integer;
3 var1 t1;
4 v_counter number:=0;
5 BEGIN
6 select * bulk collect into var1 from emp;
7 for vr in 1..var1.count loop
8 dbms_output.put_line(var1(vr).ename);
9 update dept set deptno=var1.deptno Here also Error occured.
10 end loop;
11 END;
12 /
SCOTT
ADAMS
PL/SQL procedure successfully completed.
SQL> -
Hey guys how to fetch data from db table using subroutine
hi guys,
I am fetching data from db table "mcha". now in the follwing code i get it in "HSDAT1_DATE."
now when i read out_tab with key "HSDAT1". it wont come in out_tab-value.plz tell me what is wrong whether some key condition in out_tab or any thing else.
and what should i write in changing && in script.
thanks in advance
FORM DATE_MGF TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
tables :MCHA ,QALS.
DATA : WERKS1 LIKE QALS-WERK.
DATA : HSDAT1 LIKE MCHA-HSDAT.
DATA : DATE(2),
MONTH(2),
YEAR(4).
DATA : HSDAT1_DATE(10).
READ TABLE IN_TAB WITH KEY 'QALS-WERK'.
LOOP AT IN_TAB.
IF SY-TABIX EQ 1.
WERKS1 = IN_TAB-VALUE.
IF WERKS1 NE SPACE.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
SELECT SINGLE HSDAT INTO HSDAT1
FROM MCHA
WHERE WERKS = WERKS1.
DATE = HSDAT1+6(2).
MONTH = HSDAT1+4(2).
YEAR = HSDAT1+0(4).
CONCATENATE DATE '.' MONTH '.' YEAR INTO HSDAT1_DATE.
READ TABLE OUT_TAB WITH KEY 'HSDAT1' .
IF SY-SUBRC = 0.
OUT_TAB-VALUE = HSDAT1.
MODIFY OUT_TAB INDEX SY-TABIX.
ENDIF.Hi,
Let me understanf clearly what you want.
initally mine out_tab is blank
According to you, your table out_tab is blank. And you need to add out_tab-value = HSDAT1_date.
READ TABLE OUT_TAB WITH KEY 'HSDAT1' .
IF SY-SUBRC = 0.
OUT_TAB-VALUE = HSDAT1.
MODIFY OUT_TAB INDEX SY-TABIX.
ENDIF.
So, if your table is blank, then read statement will fail.
Please let me know if your table out_tab in blank when you are reading the table and if this table contains any field called HSDAT.
Basically i would like to know your internal table out_tab declaration.
Thanks,
Archana -
How to populate rows from another table in new blank rows of other table
I have to convert an oracle form 6i to Jdeveloper application. In forms 6i we use create a cursor for other table and then populate the current table data block row using create record and assigning its values from cursor and then issuing next record until all cursor records are written in data block. After some manual editing we save the whole form and then all block records are saved as new rows in table.
Now how to create this functionality in jdeveloper application.
Kindly help.two steps-
1. get row from first VO.iterate them - like below -
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("ViewObj1Iterator");
HSSFRow excelrow = null;
// Get all the rows of a iterator
oracle.jbo.Row[] rows = dcIteratorBindings.getAllRowsInRange();
int i = 0;
for (oracle.jbo.Row row : rows) {
row.getAttribute(colName).toString()); // by this you can get row attribute value..
2. inside iteration create row for VO 2 for example-
ViewObject employee= findViewObject("EmployeeVO");
// Create a row and fill in the columns.
Row row = employee.createRow();
row.setAttribute("Name", "Vinay");
row.setAttribute("EmpId", 1);
//Insert row in to the default row set
employee.insertRow(row);
Read more: http://www.techartifact.com/blogs/2012/12/creating-new-row-of-view-object-in-adf-techartifact.html#ixzz2iL978UOD
http://www.techartifact.com/blogs/2012/12/creating-new-row-of-view-object-in-adf-techartifact.html -
How to return rows from tmp table created inside function??
Hi,
I'm trying to return rows from a cursor or table (created within
the function). How do I specify the return type?Hi,
Here is the code that examples to create a function that can
return data from table.This is achieved using REFCURSOR concept.
Hope this helps you.I'm giving all stuff in single PL/SQL
block.You can break it and create a package and declare
refcursor type and function in that as well.
DECLARE
-- Declare generic cursor type
TYPE gencur_type IS REF CURSOR ;
-- Declare generic cursor varaible
gencur gencur_type;
-- Declare record type
TYPE rec_type IS RECORD(descr emp.ename%type) ;
-- Declare record type variable
rec rec_type;
--This how you declare a local function that returns gencrtype
data set
--This function is called in main block
FUNCTION call_refcur return gencur_type
AS
rr gencur_type;
BEGIN
OPEN rr FOR SELECT descr FROM emp;
RETURN rr;
END;-- end of local function
-- Main block begins here
BEGIN
-- Call the local function so that gencur will have
-- the data set returned by select statement
gencur:= call_refcur;
-- Open a loop to test the stuff
LOOP
FETCH gencur INTO rec;
EXIT WHEN gencur%NOTFOUND;
null;
dbms_output.put_line(rec.ename);
END LOOP;
END;
Regards,
Sridhar -
How to fetch data from 2 tables
Hi Experts,
I am using 2 Ztables.Let us assume that there are 2 fields in Table1 as a and b and 2nd Table contain c as field.I want to retrive data from these tables by combining the fields of Table1 with that of 2.
Eg: I want to compare a+b with c and fetch records.
Is there any logic to combine 2 fields and compare with 3rd field using a single select statement?
Regds,
Sam.Hi Sam,
if the tables have one or more common key fields, you can use a JOIN condition for the tables, i.e.
data:
begin of ls_target,
a like ztable1-a,
b like ztable1-b,
c like ztable2-c,
end of ls_target,
lt_target like table of ls_target.
select ztable1~a ztable1~b ztable2~c
into corresponding fields of table lt_target
from ztable1
join ztable2 ON ztable2~key = ztable1~key
where <your condition>.
Note ahead:
1) some people say select into corresponding fields is not good for performance. I think it is good to avoid errors and nobody ever gave a perfomance proof.
2) Most developers always use an alias such as ztable1AS a, ztable2 AS b. This is due to the fact that after table joins were introduced with release 3.1, the ABAP sample programs an documentation always used the ALIAS clause although it is not necessary nor does it establish transparency.
Kind regards
Clemens -
How to delete rows from multiple tables when pressing button
Hi, I'm wondering how do I delete a row from two different tables at the same time when I press the Delete button. Both tables have GROUP_ID as their primary key.
Nevermind! I realized that I had "reset" before my process to delete from the 2nd table.
-
How to fetch data from different tables
I have a view created based on Emp table. while querying the employee details i want to display the dept_ description from dept table. how can i do that ??
Regards Abinyou mean when you click on a emp table row you want to display dept. description?
Use the following query in the view so you have all the required information. In the table selectionlistener get the dept. description and display it.
SELECT distinct E.empno, E.ename, E.sal, D.dname
FROM dept D, emp E
WHERE E.deptno = D.deptno
ORDER BY E.empno; -
How to Fetch Data From Standard Table MARA and Display using BOPF ?
Hello All,
In BOPF creation of Quey to a node fetches data from the Data Base Table attached to that Node,
But in my requirement I have to fetch data Present in a Standard table and Display it in the FPM List Using FBI.
** Can we Fetch the data From Standard Table and fill the Node in BOPF, Is this possible as the standard Table do not contain KEY field which BOPF uses for Data Fetching ?
Kindly share your Idea's .
Thanks in Adv.Hi Dhivya,
Thanks For your Response.
In my Requirement I want to make ROOT Node as Transient Node.
When I create a Sub Node to a Root Node, I am able to get this option to make this sub node as a Transient Node .
By selecting 'Standard<-->Extended' option in the Menu item 'GoTo' I am able to get this Transient Node check box field for the Sub Nodes.
I want to make a ROOT Node as a Transient Node.
(Which Version you are using, and which transaction you are using to create BO . we are using BOBX Transaction, Version Ehp 6 )
Kindly Guide me .
Thanks,
Kranthi Kumar. -
How to fetch data from a table?
I am newbie and I have no idea how to do this. I have a table
(Excel File) about 1000 rows and 3 columns.
I want to load this table to the Flash and then be able to
fetch data by referring to the first column.
I am grateful for a tip to how to this simply. Thanx.Flash does not read Excel tables on local dirve. Flash can
read an XML or LoadVars file from local drive.
So if you can get the data exported into a text file using
either XML or LoadVars data structures, Flash has built-in classes
in its library to consume the data.
You can on a more advanced level use DCOM on a Windows IIS
server plus something like OLEDB to open an Excel table or any app
but it is not real practical for a production app involving more
than one user at a time. -
How to fetch data from CDHDR Table based on Order Number
Hi,
I need to fetch the data from CDHDR just based on the Order number .I found there is a field called 'OBJECTID' in table 'CDHDR'. But the last part of OBJECTID contains order number.suppose my order number is 90506210 the objectid field contains '51030000090506210'.510 is login client,don't know what 30 is and last part is order number i.e 000090506210.i have to concatenate all and fetch data .i can do it for one order number but here order number is declared as select-options.how do i ?
HERE IS THE CODE FOR ONE ORDER NUMBER.HOW CAN DO FOR RANGE OF ORDER NUMBERS.
PARAMETER : S_OBJECT FOR /BEV1/RBVBAK-AUFNR OBLIGATORY.
DATA : IT_CDHDR TYPE STANDARD TABLE OF CDHDR WITH HEADER LINE,
WA_CDHDR LIKE LINE OF IT_CDHDR,
S_OBJECT1 LIKE CDHDR-OBJECTID.
CONCATENATE sy-mandt '30' S_OBJECT INTO S_OBJECT1.
SELECT * FROM CDHDR INTO TABLE IT_CDHDR WHERE OBJECTID = S_OBJECT1.P838355 wrote:>
> Hi,
> I need to fetch the data from CDHDR just based on the Order number .I found there is a field called 'OBJECTID' in table 'CDHDR'. But the last part of OBJECTID contains order number.suppose my order number is 90506210 the objectid field contains '51030000090506210'.510 is login client,don't know what 30 is and last part is order number i.e 000090506210.i have to concatenate all and fetch data .i can do it for one order number but here order number is declared as select-options.how do i ?
>
> HERE IS THE CODE FOR ONE ORDER NUMBER.HOW CAN DO FOR RANGE OF ORDER NUMBERS.
>
>
> PARAMETER : S_OBJECT FOR /BEV1/RBVBAK-AUFNR OBLIGATORY.
>
> DATA : IT_CDHDR TYPE STANDARD TABLE OF CDHDR WITH HEADER LINE,
> WA_CDHDR LIKE LINE OF IT_CDHDR,
> S_OBJECT1 LIKE CDHDR-OBJECTID.
>
> CONCATENATE sy-mandt '30' S_OBJECT INTO S_OBJECT1.
>
> SELECT * FROM CDHDR INTO TABLE IT_CDHDR WHERE OBJECTID = S_OBJECT1.
You need to loop through the select option and concatenate with required data then select using 'in' instead of equal or select one by one.
or
select sales order numbers from VBAK for the selection into internal table then loop through the internal table and concatenate then select from CDHDR.
for better performance use objectclass in where clause. the value for sales order for objectclass is VERKBELEG.
in my system the object id is just an order number there is no other additions to it but in CDPOS the tabkey contains the order number with client and other information also.
the 30 may be your item number... check it
go ahead and change sales order and see what you can find in CDHDR
Good luck
Edited by: Sampath Kumar on Oct 21, 2009 9:02 AM -
How to Transfer Rows from one table to another in a different Page
Hi Friends,
My problem is; I need to call a custom page as a popup using Java-Script. ( This is because our business users want the multi-select LOV to look and function differently ).
I have a table in the popped-up page from where; upon a button action I need to close the pop-up and transfer the selected rows , back to the base-page's table.
( Both the Base Page and the Pop-Up are Custom Pages.)
Please find below the AM code that I call before closing the window using Java Script.
But the Base-Page table remains un-disturbed. Can you please show me how to do the transfer of records if possible ?
OAViewObjectImpl main_vo = getBasePageTableVO1();
OAViewObjectImpl sel_vo = getPopupPageTableVO1();
int fetchedRowCount = sel_vo.getFetchedRowCount();
RowSetIterator iterator = sel_vo.createRowSetIterator("SelectedRows_Iterator");
if (fetchedRowCount > 0)
iterator.setRangeStart(0);
iterator.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
PopupPageTableVORowImpl row = (PopupPageTable)iterator.getRowAtRangeIndex(i);
BasePageTableVORowImpl main_row = (BasePageTableVORowImpl)main_vo.createRow();
if (main_vo.getFetchedRowCount() == 0)
main_vo.setMaxFetchSize(0);
main_vo.setWhereClause(" 1 = 0 ");
main_vo.executeQuery();
main_vo.setCurrentRow(main_vo.last());
main_vo.next();
main_vo.insertRow(main_row);
main_row.setNewRowState(main_row.STATUS_INITIALIZED);
main_vo.setCurrentRow(main_row);
try
main_row.setField1(row.getField1());
main_row.setField2(row.getField2());
main_row.setField3(row.getField3());
catch(JboException _ex)
iterator.closeRowSetIterator();Thanks Ramkumar. I am able to catch the action after I used formSubmit .
The below lines in processRequest declares the function cszRefreshBase and later; on attaching the function name in the open window java script call, I get my desired functionality.
StringBuffer stringbuffer = new StringBuffer();
stringbuffer.append("function cszRrefreshBase(lovwin, event) ");
stringbuffer.append("{ ");
stringbuffer.append(" if (!lovwin.PopupSL) ");
stringbuffer.append(" return false; ");
stringbuffer.append(" submitForm('DefaultFormName', 0, {'cmePopupEvent':'popupUpdate'}); ");
stringbuffer.append("}");
oapagecontext.putJavaScriptFunction("cszRefreshBaseJS", stringbuffer.toString());
Maybe you are looking for
-
This is a log-in page, which points to our email registration software's server (Tikit's Emerge Reaction Server). If you open in it in the last version of FF, it looks as expected. The page renders fine in IE6 and IE8, and all our other website pages
-
Adding iMac Bondi Rev B to AirPort network
Ok, I have an AirPort network set up at my house that uses an AirPort Extreme (g) Base Station (AEBS) to connect to the internet. I can use that connection by using wifi connections from my iMac G4 (10.3.9), iMac G5 (10.4.10), PowerBook (10.4.10), an
-
Error code -51? Burn to DVD? how?
I don't understand how to burn my project to dvd now that I'm done with it, i tried to export it and it said error code -51?? and then I trie dto publish it to itunes and it said the same thing. any help?
-
Hi, We just installed SBO 8.8 and are still in the testing proces. I want to run a dunning, and in step 4 of the wizard enter a future due date, but I keep getting the error "Future posting date is not allowed (Dunning Wizard - Creation Date) (Messag
-
Can we create a custom in console alert ? For example, we have an default alert for backup failure, can we create an alert backup success too ?. Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin