Using variable in from close of select statement for LOV
Hi all,
I had a select list based on a query with a variable in it for the database schema. Something like this:
"select name, id from &SCHEMA..countries order by name". This warked in version 1.4.4..., I don't remember the rest. Now we upgraded to version 1.6.0.00.87 and I am trying to change the condition for this select item but I recieve this error:
1 error has occurred
LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
Whatever I'm trying to change for this item, it always gives me this error when I click on "Apply Changes" button. Everything works fine when I remove &SCHEMA. from the query and instead write directly the database schema name.
Can you help me?
Sabiha,
This is a case where the builder cannot parse the query at design time because there is no state for &SCHEMA. in the session. You can try this trick, change the lov query to: if htmldb_application.get_current_flow_sgid(:APP_ID) = htmldb_application.get_sgid then
return 'select name d, id r from &SCHEMA..countries order by name';
end if;Notice also the addition of aliases for the column names.
Scott
Similar Messages
-
How to use Oracle Table Type values in Select Statement.
Hi,
I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
For example, try something like the following:
TYPE t_record IS RECORD (
ID TABLEA.ID%type,
NO TABLEA.NO%type,
v_record t_record;
TYPE t_table IS TABLE OF v_record%TYPE;
v_table t_table;
-- Code to populate the values in v_table here.
SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
WHERE ID IN v_table(i).ID;
I want to know how to use the values from Oracle Table Type in the Select Statement.Something like this:
create or replace type t_record as object (
id number,
no number
CREATE or replace type t_table AS TABLE OF t_record;
set serveroutput on
declare
v_table t_table := t_table();
v_t1 t_table := t_table();
begin
v_table.extend(1);
v_table(1).ID := 1;
v_table(1).No := 10;
v_table.extend(1);
v_table(2).ID := 2;
v_table(2).ID := 20;
SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
from TableA
FROM TABLEA
WHERE ID IN (select t.ID from table(v_Table) t);
for i in 1..v_t1.count loop
dbms_output.put_line(v_t1(i).ID);
dbms_output.put_line(v_t1(i).No);
end loop;
end;
/Untested!
P;
Edited by: bluefrog on Mar 5, 2010 5:08 PM -
Use two secondary indexes in a select statement
hi, i want to use two secondary indexes in a select statement.
how can i do it?Hello,
To do it use the WHERE stm in the same order as the secondary stm is on SE11....To check if the index is used go to tcode ST05.
example
select * from ztable
WHERE BUKRS EQ 'BUK1' AND
ZFIELD EQ 'BOY'.
on se11 on the ZTABLE indexes setion must have a secondary index with
BUKRS and
ZFIELD.
BYE!!
Hope this helps!!
Gabriel -
Tree Table Error : Missing from in a select statement
Created a view link
Created a view criteria on source vo which has attribute of destination vo
Dragged the source view criteria to form a tree table.
But upon invoke of jspx page even if tree table is appearing Error : Missing from in a select statement is shown. Log shows no specific file/line number. Search is also throwing same error
If i remove attribute of destination vo from view criteria error is not appearing. Any pointers?Hi,
Well, If the user always enter a list as selection (no range, exclusion, ...), I can understand the need.. otherwise this is indeed a bit strange... In case they only need to use single element list in SO, you could restrict all other SO features with the FM SELECT_OPTIONS_RESTRICT and then loop on values and select each single vendor...
E.g under your INITIALIZATION event:
* Only option 'EQ' and sign 'I' are allowed
lt_opt_list-name = 'ONLY_EQ'.
lt_opt_list-options-eq = 'X'.
APPEND lt_opt_list TO ls_restriction-opt_list_tab.
lt_***-kind = 'S'. "select-option
lt_***-name = 'S_LIFNR'. "name of select-option
lt_***-sg_main = 'I'. "only inclusive
lt_***-sg_addy = space.
lt_***-op_main = 'ONLY_EQ'.
lt_***-op_addy = space.
APPEND lt_*** TO ls_restriction-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = ls_restriction
EXCEPTIONS
too_late = 1
repeated = 2
selopt_without_options = 3
selopt_without_signs = 4
invalid_sign = 5
empty_option_list = 6
invalid_kind = 7
repeated_kind_a = 8
OTHERS = 9.
Then just loop on SO table, select single and check subrc...
Kr,
Manu. -
Select statement for summing values in column?
How to write a select statement for sap standard table which contains data as given below
col1 col2
A 10
A 20
A 30
B 50
B 60
C 70
Need the output of select in internal table as given below
A 60
B 110
C 70
Regards,
RachelThanks for all the valuable input.
Below I have used sum in select statement(check case 2"),but i am not getting required o/p.
Kindly guide me.
case1 :
select aebeln aebelp bpackno bmenge
into corresponding fields of table itab
from ( eslh as a inner join esll as b
on bpackno = apackno )
where a~ebeln = 6000000100
and a~ebelp = 00010
and a~packno = '0000001025'
order by aebeln aebelp b~packno .
O/p for the above .
ebeln ebelp packno menge
6000000100 00010 0000001025 6.000
6000000100 00010 0000001025 5.000
6000000100 00010 0000001025 2.000
6000000100 00010 0000001025 1.000
6000000100 00010 0000001025 2.000
case2:
select aebeln aebelp bpackno sum( bmenge )
into corresponding fields of table itab
from ( eslh as a inner join esll as b
on bpackno = apackno )
where a~ebeln = 6000000100
and a~ebelp = 00010
and a~packno = '0000001025'
group by aebeln aebelp b~packno
order by aebeln aebelp b~packno .
6000000100 00010 0000001025 0.000
Edited by: Rachel on Nov 25, 2008 11:45 AM
Edited by: Rachel on Nov 25, 2008 11:46 AM -
DISTINCT in SELECT statements for Entities / Views - Oracle JDeveloper 11G
Hi Steve,
i have a question about using DISTINCT in SELECT statements for
Entities / Views. On Oracle JDeveloper 11G ADF / BC4J
--- This is unique---
SELECT
distinct(GC."course_title"),
GC.SEC_GRP_PARENT_ID,
from "grp_courses" GC
--- This is NOT unique, but ROWID seems to be mandatory as PrimaryKey---
SELECT
distinct(GC."course_title"),
GC.SEC_GRP_PARENT_ID,
rowid
from "grp_courses" GC
How to use this query;
SELECT
distinct(GC."course_title"),
GC.SEC_GRP_PARENT_ID,
from "grp_courses" GC
and yet still be able to use it in View / Entity without a Primary Key or some equivalent solution.
Thanks & Regards,Hi, OK - I got it to work...
Some notes:
1) The View wizard cannot be initiated from the Entity Object.
2) During the View wizard process - do not associate with Entity
3) Selected columns must be mapped as expressions
4) Using non-distinct columns will override the distinct function -
Equivalent select statement for complex selection
HI,
What is the equivalent select statement for below mentioned condition.
SELECT-OPTIONS : SALEDOCU FOR VBAK-VBELN OBLIGATORY,
DATE FOR VBAK-ERDAT OBLIGATORY,
CHANEEL FOR VBAK-VTWEG,
SALETYPE FOR VBAK-AUART OBLIGATORY DEFAULT 'QT'
NO INTERVALS NO-EXTENSION.
Regards,
John.hi,
you can use following code.
tables vbak.
data : begin of t_vbak occurs 0.
include structure vbak.
data : end of t_vbak.
select * from vbak into table t_vbak where
vbeln in saledocu and
erdat in date and
vtweg in chaneel and
auart in saletype.
Hope this helps.
Regards,
Shashank -
How to write Select statement for this codition
I need to check whether SGTXT contains BELNR value.
SGTXT is a text field and It should be matched with BELNR
How to write select statement for this.
Select AUGBL AUGDT into t_BSAD
from BSAD
where SGTXT should have the given BELNR Value.
Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.Hi,
data temp(12).
concatenate '%' belnr '%' into temp.
Select AUGBL AUGDT into t_BSAD
from BSAD
where SGTXT like temp.
If belnr is having multiple values,just create a internal table as follows.
types : begin of ty,
belnr....
temp(12),
end of ty.
data itab_ type standard table of ty.
data wa type ty.
loop at itab into wa.
concatenate '%' wa-belnr '%' into wa-temp.
modify itab from wa index sy-tabix transporting temp.
endloop.
Change your select statement accordingly.
Kindly reward poits if it helps. -
Regarding select statement for this requirement
Hi................
good evening
here is a requirement.
i want to retrieve data from the following table.but how to join these table is my dought.
tables fields
t001w--werks " plant id
t001w--name1 " pl;ant name
t001w--regio " plant address
ekko--ebeln " purchase order
ekko-erdat : creation date
ekko-ernam "name of the person
ekpo-ebelp " item
ekpo-bstyp "purchase order type
eket-erdat " delivery date
mara-matnr " material number
these are the tables and fields.now we want to retrive data from these tables
how we have to code select statement.
selection-screen is
plant id
order type
delivery date
please provide select statement for this requirement.
thanks and regards.
k.swaminath reddy.Is this what you are looking for?
SQL> CREATE OR REPLACE FUNCTION f_team
2 RETURN VARCHAR2
3 IS
4 s_return VARCHAR2(500);
5 BEGIN
6 FOR i IN ( select team from t_team order by 1) LOOP
7 s_return := s_return || i.team || ', ';
8 END LOOP;
9
10 RETURN substr(s_return, 1, length(s_return) - 2);
11 END;
12 /
Function created.
SQL> SELECT f_team FROM dual;
F_TEAM
Australia, Bangladesh, England, India, Kenya, Pakistan, South Africa, UAE, USA, West Indies, Zimbabwe
SQL> -
How can I use a pic from iPhoto as a background for a page, How can I use a pic as a background for a page
cd,
Insert the picture and position it as you desire
Make sure the picture is set to Floating in the Wrap Inspector
Arrange > Send Objects to Background
Regards, -
HT4427 how do I use a song from iTunes as the ringtone for my iPhone 5?
how do I use a song from iTunes as the ringtone for my iPhone 5?
Google will find several free ways to create ringtones for iphone.
-
Need Select statement for fetch the details
Hi
i want to fetch particular customer wise sales orderds and that sales order No and date of sales order was created.. and that sales order related PO No and Materials ..
for this.. how can i write an executable programm.. is it needed to define seperate internal tables or single internal table is enough ?
what is the select statement for fetching all these details..
any help will be appriciated
Thanks
Bbaucustmer master table is KNA1 knb1 knbk
sales data tables r VBAK VBAP VBEP
Material data MARA, MARAC, MARD
PO RELATED ekko ekpo eket
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:04 PM -
Select statement for retrieving infotype 1005 values w,r,t payscale
Hi All,
could you pls help me for the below requirement
"select statement for retrieving infotype 1005 values with respect to the pay scale level.
because pay scale level is having range of values in the infotype"
Thanks in advance
Prasad
Please try it yourself first.
Edited by: Suresh Datti on Aug 9, 2009 4:52 PMHi,
Code which you have written is correct when the R_DATE is having LOW and HIGH values, if the R_DATE is having only LOW value then this will be wrong, becuse if the R_DATE is having only LOW then OPTION value is not BT is should be EQ
Regards
Sudheer -
How to use a table name in the select statement using a variable?
Hi Everybody,
I got a internal table which has a field or a variable that gets me some tables names. Now I need to retrieve the data from all these tables in that field dynamically at runtime. So could you suggest me a way out to use the select query which uses this variable as a table ?
Regards,
Mallik.Hi all,
Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
for ex : select * from (tab_name) where....?
Can we do inner join on such select statements? If so how?
Thanks & Regards,
Mallik. -
Bind Variables are not allowed in select statement
I created a lov to one parameter field in a report using select statement.
select distinct mtrl_group||' - '||grup_desc
from mtrl_mast a , grup_mast b
where financial_year||financial_month = :P_cutofff_period)
and a.mtrl_group = b.grup_code
this is my select statement & i got the above error.
how can i fix bind variables in this.
Pls help me......Hi,
have a look at Metalink-Note 185951.1
SAMPLE - How to create a parameter LOV based on another parameter value?
Regards
Rainer
Maybe you are looking for
-
3rd party signature handler set in Adobe Acrobat 9 Professional Extended gets reset
Hi All, I have got a 3rd party digital signature creating plug-in i.e. MySign . I have set it inside 'Preference > Security > Advanced Preferences > Creation > Default Method to Use when Signing and Encrypting Documents' > MySign. If I restart Adobe
-
I bought a refurbished MacBook Pro (early 2009 model) and it came preinstalled with OS X 6.2. Last month, the hard disk failed and I had to replace it. I reinstalled the OS from the discs that came in the box, but they're only 10.5.6. I want to upgra
-
Where can I find the Hyperion System 9 Downloads?
I'm specifically looking for System 9 Essbase and Financial Reporting components. Thanks! Randy Schmitz
-
Depreciation run from the posting date
Hi Team My client want deprecition to be posted from the Posting date instead of start date of the document period he is trying to post assets through F -90 it calculates depreciation from the start date of the doc. period Eg., Asset no 8000000049 D
-
Registration key required for database 10g software
receive a password and message "Thank you for registering", but never get the key necessary to install software on disk that came with textbook--very frustrating