Urgent , abap select statement error ...
Hi all ,
here i attached my code , has anyone can tell me where is the error ???
when i active this code , it showed :
"comma without preceding colon(after select?)"
thanks a lot !
SELECT LIPSERDAT LIPSVBELN LIPSPOSNR LIPSVGPOS LIPS~LFIMG
LIPSVRKME LIKPWADAT_IST LIKPKUNAG LIKPKUNNR LIKP~VBELN
VBAPVBELN VBAPMATNR VBAPNETWR VBAPWAERK VBAPMWSBP VBAPNETPR
VBAPPOSNR VBUPKOSTA VBUPWBSTA VBUPFKSTA VBUPPOSNR VBUPVBELN
VBPAPARVW VBPAVBELN VBUKCMGST VBUKVBELN VBAKAUART VBAKVBELN
INTO (
WASTATUS-ERDAT , WASTATUS-VBELN , WASTATUS-POSNR ,
WASTATUS-VGPOS , WASTATUS-LFIMG , WASTATUS-VRKME ,
WASTATUS-WADAT_IST , WASTATUS-KUNAG ,WASTATUS-KUNNR ,
WASTATUS-LIKPVBELN , WASTATUS-VBAPVBELN , WASTATUS-MATNR ,
WASTATUS-NETWR , WASTATUS-WAERK , WASTATUS-MWSBP ,
WASTATUS-NETPR , WASTATUS-POSNR , WASTATUS-KOSTA , WASTATUS-WBSTA ,
WASTATUS-FKSTA , WASTATUS-VBUPPOSNR , WASTATUS-VBUPVBELN ,
WASTATUS-PARVW , WASTATUS-VBPAVBELN , WASTATUS-CMGST ,
WASTATUS-VBUKVBELN , WASTATUS-AUART , WASTATUS-VBAKVBELN )
FROM ( LIPS inner join LIKP
on LIKPVBELN = LIPSVBELN
inner join VBAP
on VBAPVBELN = LIPSVGBEL
and VBAPPOSNR = LIPSVGPOS
inner join VBUP
on VBUPPOSNR = LIPSPOSNR
and VBUPVBELN = LIPSVBELN
inner join VBPA
on VBPAVBELN = LIPSVBELN
inner join VBUK
on VBUKVBELN = LIPSVBELN
inner join VBAK
on VBAKVBELN = VBAPVBELN )
WHERE
LIPS~VBELN in P_SVBELN
and LIPS~ERDAT in P_ERDAT
and LIKP~KUNAG in P_KUNAG
and LIKP~KUNNR in P_KUNNR
and VBAP~VBELN in P_PVBELN
and VBUP~KOSTA in P_KOSTA
and VBUP~WBSTA in P_WBSTA
and VBUP~FKSTA in P_FKSTA
and VBPA~PARVW in P_PARVW
and VBUK~CMGST in P_CMGST .
sorry all ,
i already removed the space on my code like that :
but it still displayed the error .
SELECT LIPS~ERDAT
<b>*LIPSVBELN LIPSPOSNR LIPSVGPOS LIPSLFIMG
*LIPSVRKME LIKPWADAT_IST LIKPKUNAG LIKPKUNNR LIKP~VBELN
*VBAPVBELN VBAPMATNR VBAPNETWR VBAPWAERK VBAPMWSBP VBAPNETPR
*VBAPPOSNR VBUPKOSTA VBUPWBSTA VBUPFKSTA VBUPPOSNR VBUPVBELN
*VBPAPARVW VBPAVBELN VBUKCMGST VBUKVBELN VBAKAUART VBAKVBELN</b> FROM ( LIPS inner join LIKP
on LIKPVBELN = LIPSVBELN
inner join VBAP
on VBAPVBELN = LIPSVGBEL
and VBAPPOSNR = LIPSVGPOS
inner join VBUP
on VBUPPOSNR = LIPSPOSNR
and VBUPVBELN = LIPSVBELN
inner join VBPA
on VBPAVBELN = LIPSVBELN
inner join VBUK
on VBUKVBELN = LIPSVBELN
inner join VBAK
on VBAKVBELN = VBAPVBELN )
INTO (WASTATUS-ERDAT)
<b>*WASTATUS-VBELN, WASTATUS-POSNR, WASTATUS-VGPOS,WASTATUS-LFIMG)
*WASTATUS-VRKME,
*WASTATUS-WADAT_IST, WASTATUS-KUNAG,WASTATUS-KUNNR,
*WASTATUS-LIKPVBELN, WASTATUS-VBAPVBELN, WASTATUS-MATNR,
*WASTATUS-NETWR, WASTATUS-WAERK, WASTATUS-MWSBP,
*WASTATUS-NETPR, WASTATUS-POSNR, WASTATUS-KOSTA, WASTATUS-WBSTA,
*WASTATUS-FKSTA, WASTATUS-VBUPPOSNR, WASTATUS-VBUPVBELN,
*WASTATUS-PARVW, WASTATUS-VBPAVBELN, WASTATUS-CMGST,
*WASTATUS-VBUKVBELN, WASTATUS-AUART, WASTATUS-VBAKVBELN )</b> WHERE
LIPS~VBELN in P_SVBELN
and LIPS~ERDAT in P_ERDAT
and LIKP~KUNAG in P_KUNAG
and LIKP~KUNNR in P_KUNNR
and VBAP~VBELN in P_PVBELN
and VBUP~KOSTA in P_KOSTA
and VBUP~WBSTA in P_WBSTA
and VBUP~FKSTA in P_FKSTA
and VBPA~PARVW in P_PARVW
and VBUK~CMGST in P_CMGST .
Similar Messages
-
Urgent , abap select statement error VBPA ...
hi gurus,
please tell me what is the wrong in the following select statment:
it returns 4 dispite that the data is there in the table VBPA
like this :
VBPA
Cl. : 200
Document : 0010002449
Item :
Funct : PE
Pers.No. : 100820
SELECT SINGLE
pernr
INTO w_pernr
FROM vbpa
WHERE VBELN EQ '0010002449'
and kunnr EQ 'PE'.hi
good
wrong one ->
SELECT SINGLE
pernr
INTO w_pernr
FROM vbpa
WHERE VBELN EQ '0010002449'
and kunnr EQ 'PE'.
SELECT SINGLE
pernr
INTO w_pernr
FROM vbpa
WHERE VBELN EQ 0010002449
and kunnr EQ PE.
change like this and check the difference.
thanks
mrutyun^ -
ABAP select statements takes too long
Hi,
I have a select statement as shown below.
SELECT * FROM BSEG INTO TABLE ITAB_BSEG
WHERE BUKRS = CO_CODE
AND BELNR IN W_DOCNO
AND GJAHR = THISYEAR
AND AUGBL NE SPACE.
This select statement runs fine in all of R/3 systems except for 1. The problem that is shown with this particular system is that the query takes very long ( up to an hour for if W_DOCNO consists of 5 entries). Sometimes, before the query can complete, an ABAP runtime error is encountered as shown below:
<b>Database error text........: "ORA-01555: snapshot too old: rollback segment
number 7 with name "PRS_5" too small?"
Internal call code.........: "[RSQL/FTCH/BSEG ]"
Please check the entries in the system log (Transaction SM21). </b>
Please help me on this issue. However, do not give me suggestions about selecting from a smaller table (bsik, bsak) as my situation does not permit it.
I will reward points.dont use select * ....
instead u declare ur itab with the required fields and then in select refer to the fields in the select .
data : begin of itab,
f1
f2
f3
f4
end of itab.
select f1 f2 f3 f4 ..
into table itab
from bseg where ...
. this improves the performance .
select * is not advised .
regards,
vijay -
Select statement error.
Hi all,
I have a select statement which will join 4 tables as shown below. Something is not working right in the select statement and caused the shortdump.
I really cannot figure out where is not right.
Please help.
TYPES:
BEGIN OF t_lips,
matnr TYPE matnr,
lfimg TYPE lfimg,
meins TYPE meins,
vbeln TYPE vbeln_vl,
lfart TYPE lfart,
vstel TYPE vstel,
maktx TYPE maktx,
werks TYPE werks_d,
exnum TYPE exnum,
posnr TYPE posnr_vl,
uecha TYPE uecha,
netwr TYPE netwr,
waerk TYPE waerk,
vgbel TYPE vgbel,
END OF t_lips.
DATA: lt_lips TYPE TABLE OF t_lips.
SELECT lips~matnr lfimg lips~vrkme lips~vbeln lfart
vbap~vstel lips~arktx lips~werks exnum
vbap~netwr vbap~waerk lips~vgbel
lips~posnr lips~uecha
INTO TABLE lt_lips
FROM lips INNER JOIN vttp
ON vttp~vbeln = lips~vbeln
INNER JOIN likp
ON lips~vbeln = likp~vbeln
INNER JOIN VBAP
ON lips~vgbel = vbap~vbeln
WHERE vttp~tknum = ps_vttk-tknum
AND lfimg <> 0.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "GET_DATA" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
In a SELECT access, the read file could not be placed in the target
field provided.
Either the conversion is not supported for the type of the target field,
the target field is too small to include the value, or the data does not
have the format required for the target field.Hi,
In the below code, where are you picking up value for LFIMG and LFART. Give the alias/table name for them also.
for ex. lips~lfimg....
SELECT lips~matnr lfimg lips~vrkme lips~vbeln lfart
vbap~vstel lips~arktx lips~werks exnum
vbap~netwr vbap~waerk lips~vgbel
lips~posnr lips~uecha
INTO TABLE lt_lips
FROM lips INNER JOIN vttp
ON vttp~vbeln = lips~vbeln
INNER JOIN likp
ON lips~vbeln = likp~vbeln
INNER JOIN VBAP
ON lips~vgbel = vbap~vbeln
WHERE vttp~tknum = ps_vttk-tknum
AND lfimg 0.
Hope this is useful.
Also selection of records should be same as declared in table lt_lips otherwise use 'INTO CORRESPONDING TABLE LT_LIPS'
Regards,
Saba
Edited by: Saba Sayed on Oct 24, 2008 9:30 AM -
ABAP Select statement performance (with nested NOT IN selects)
Hi Folks,
I'm working on the ST module and am working with the document flow table VBFA. The query takes a large amount of time, and is timing out in production. I am hoping that someone would be able to give me a few tips to make this run faster. In our test environment, this query take 12+ minutes to process.
SELECT vbfa~vbeln
vbfa~vbelv
Sub~vbelv
Material~matnr
Material~zzactshpdt
Material~werks
Customer~name1
Customer~sortl
FROM vbfa JOIN vbrk AS Parent ON ( Parentvbeln = vbfavbeln )
JOIN vbfa AS Sub ON ( Subvbeln = vbfavbeln )
JOIN vbap AS Material ON ( Materialvbeln = Subvbelv )
JOIN vbak AS Header ON ( Headervbeln = Subvbelv )
JOIN vbpa AS Partner ON ( Partnervbeln = Subvbelv )
JOIN kna1 AS Customer ON ( Customerkunnr = Partnerkunnr )
INTO (WA_Transfers-vbeln,
WA_Transfers-vbelv,
WA_Transfers-order,
WA_Transfers-MATNR,
WA_Transfers-sdate,
WA_Transfers-sfwerks,
WA_Transfers-name1,
WA_Transfers-stwerks)
WHERE vbfa~vbtyp_n = 'M' "Invoice
AND vbfa~fktyp = 'L' "Delivery Related Billing Doc
AND vbfa~vbtyp_v = 'J' "Delivery Doc
AND vbfa~vbelv IN S_VBELV
AND Sub~vbtyp_n = 'M' "Invoice Document Type
AND Sub~vbtyp_v = 'C' "Order Document Type
AND Partner~parvw = 'WE' "Ship To Party(actual desc. is SH)
AND Material~zzactshpdt IN S_SDATE
AND ( Parentfkart = 'ZTRA' OR Parentfkart = 'ZTER' )
AND vbfa~vbelv NOT IN
( SELECT subvbfa~vbelv
FROM vbfa AS subvbfa
WHERE subvbfavbelv = vbfavbelv
AND subvbfa~vbtyp_n = 'V' ) "Purchase Order
AND vbfa~vbelv NOT IN
( SELECT DelList~vbeln
FROM vbfa AS DelList
WHERE DelListvbeln = vbfavbelv
AND DelList~vbtyp_v = 'C' "Order Document Type
AND DelList~vbelv IN "Delivery Doc
( SELECT OrderList~vbelv
FROM vbfa AS OrderList
WHERE OrderList~vbtyp_n = 'H' ) "Return Ord
APPEND WA_Transfers TO ITAB_Transfers.
ENDSELECT.
Cheers,
ChrisI am sending u some of the performance isuues that are to be kept in mind while coding.
1.Donot use Select *...... instead use Select <required list>......
2.Donot fetch data from CLUSTER tables.
3.Donot use Nested Select statements as. U have used nested select which reduces performance to a greater extent.
Instead use views/join .
Also keep in mind that not use join condition for more for more than three tables unless otherwise required.
So split select statements into three or four and use Select ......for all entries....
4.Extract the data from the database atonce consolidated upfront into table.
i.e. use INTO TABLE <ITAB> clause instead of using
Select----
End Select.
5.Never use order by clause in Select ..... statement. instead use SORT<itab>.
6.When ever u need to calculate max,min,avg,sum,count use AGGREGATE FUNCTIONS and GROUP BY clause insted of calculating by userself..
7.Donot use the same table once for Validation and another time for data extraction.select data only once.
8.When the intention is for validation use Select single ....../Select.......up to one rows ......statements.
9.If possible always use array operations to update the database tables.
10.Order of the fields in the where clause select statement must be in the same order in the index of table.
11.Never release the object unless throughly checked by st05/se30/slin.
12.Avoid using identical select statements. -
HELP FOR ABAP SELECT STATEMENT
I am writing below query and getting below current result which is four rows. i would like to have result mentioned below in expected result which is single row.. any idea how can i do that? It can be easily done in sql-plus using decode or union clause. but please suggest how to do it in abap.
select distinct
qmsm~qmnum
qmel~qmtxt
qmsm~mncod
qmsm~pster
qmsm~peter
ihpa~parvw
ihpa~parnr
from qmsm
inner join qmma
on qmsmqmnum = qmmaqmnum
inner join qmel
on qmmaqmnum = qmelqmnum
inner join ihpa
on qmelobjnr = ihpaobjnr
into table ztstnotifications
where
qmel~qmnum = '000100000166'
and qmma~material = wa_material
and qmsm~mncod in ('2','4')
and ihpa~parvw in ('1A','ZY')
order by qmsm~qmnum
qmel~qmtxt
qmsm~mncod
qmsm~pster
qmsm~peter.
current result
100000166 will it work 2 22.10.2009 31.10.2009 SP 1000688
100000166 will it work 2 22.10.2009 31.10.2009 ZY AE001
100000166 will it work 4 01.01.2010 15.01.2010 SP 1000688
100000166 will it work 4 01.01.2010 15.01.2010 ZY AE001
expected result
100000166 will it work 2 22.10.2009 31.10.2009 4 01.01.2010 15.01.2010 SP 1000688 ZY AE001
ThanksI doubt you'll be able to do so in a straight way. I would try to use some imaginative ways, like define an addition internal table with the key fields of your query, and a "long string" field, where I'll add the returned rows.
Or something like that. if you know the max number of rows this kind of join will return, add that number times the fields needed (parvw1, parnr1, parvw2, parnr2....) and use a LOOP to populate it. -
Global profile select statement error
Hello,
I try to set up profiles to personalize reports for users.
When I use global profile with profile value of first kind (on a profile value screen i choose "value", type, my formula "="my variable", and click add) and attatch it to the publication, it doesn't work properly. No matter what i use inside formula field, BO environment doesn't personalize report in accordance to it.
I've noticed that there is something wrong with select statement created by BO. After sending a publication, report instance received by user has "description" field like "(and (equal null "my variable")). No matter what i put inside formula box in profile "equal null" statement is always added.
When i use second type profile value (filter expression) everythig seems to be fine.
Is this some kind of bug inside global profile mechanism
I have BO XI R 3.1 without any fixpacks.
Thanks in advance for any help
best regards
WojtekHi,
In the Values option one can only use fixed values no formulas. Hence the formulas will not work.
In my case the expression option does not work. Have you tried using a formual =CurrentUser in the expression field. -
Urgent..Merge statement error
Hi,
I need help to resolve my Merge Statement problem.
This one is sample code.
l_str := ' Merge ....' ||
' where comp = :l_comp ';
execute immediate l_str using l_comp;
as soon as this statement executed..it throws me an error:
ORA-01008: not all variables bound
Could you please help me?
Thanks in advance.
RDI've few things to say. Please remove the word URGENT. Otherwise, you may have some problem here. The reason why i'm saying is that - every one has their own job. So, better - if you remove this word. Don't take it otherwise.
Coming to your problem - it is very difficult to tell from this code that you have given. Please post the full script that will help us to track down the problem. Initially, i think you should check your bind varibles. Whether you declare it properly or not.
Regards.
Satyaki De. -
Hi
i am trying to use the below statement . its giving error . pls have a look
*SELECT(%YEAR%,"[YEAR]","T_TIME",u201D[ID]=%T_TIME_SET%u201D)
*SELECT(%PYEAR%,"[YEAR]-1","T_TIME",u201D[ID]=%T_TIME_SET%u201D)
*RUNALLOCATION
*FACTOR=1
*DIM T_MOVEMENTS WHAT = CB; WHERE=OB;
*DIM T_TIME WHAT=MAR.%PYEAR%; WHERE=BAS(TOTAL.%YEAR%)
*ENDALLOCATION
*COMMIT
The resule
Validation status of executable file: Failed
- Incorrect syntax near 'u201D'. in:select [YEAR] from mbrT_TIME where u201D[ID]=%T_TIME_SET%u201D
Validation status of syntax: Failed
- Invalid syntax found; see statements in red
Bud if specify the year its running properly. pls advice me whare i was wrong
ThanksHi Narsi,
You can use the below instruction:
*SELECT(%YEAR%,"[YEAR]","T_TIME",u201DID='%T_TIME_SET%'u201D)
*SELECT(%PYEAR%,"[YEAR]-1","T_TIME",u201DID='%T_TIME_SET%'u201D)
I have just added single quote before and after %T_TIME_SET% and %T_TIME_SET%
Please try this!!
Thanks,
Rohit -
Hello,
I want to print user from my database, this is the code:
System.out.println("user:\n"); user = sc.next(); System.out.println("password:\n"); psw = sc.next(); Statement s = conn.createStatement (); s.executeQuery("SELECT usr, pass FROM log WHERE usr=''"+user+" AND pass=''"+psw); ResultSet rs = s.getResultSet (); if (s.getMoreResults()){ System.out.println("works"); } else if (!s.getMoreResults()){ System.out.println("doesn't"); System.exit(1); } while (rs.next ()) { String nameVal = rs.getString ("user"); String catVal = rs.getString ("pass"); System.out.println ( "name = " + nameVal + " pass = " + catVal); ++count; }
the connection is established, but it doesn't print anything when I enter data in it [ admin "1234" which exists in the db ], any idea what could be wrong? I have to mentioned that I'm a little bit fresh in Java databases.hey I sorted out! = )
ResultSet rs = s.getResultSet ();
if (rs.next()) {
do {
String nameVal = rs.getString ("lnum");
String catVal = rs.getString ("passwd");
System.out.println (
"name = " + nameVal
+ " password = " + catVal);
// System.out.println("Full access granted ");
JOptionPane.showMessageDialog(frame,
"Welcome in LYITstorage",
"Welcome",
JOptionPane.INFORMATION_MESSAGE);
Desktop.getDesktop().browse(new java.net.URI("www.google.com"));
} while (rs.next());
else{
JOptionPane.showMessageDialog(frame,
"Username or password are incorrect\n " +
"If You don't have an account please\n press the regestration link",
"Regestration problem",
JOptionPane.ERROR_MESSAGE);
}= ), thanks for help right now, but its not a end of my problems = ). I wanted to use it with INSERT, but it doesn' work as good as I want, as a matter of fact it's not working at all :), this is the code, any help would be nice :).
try
System.out.println("try");
Statement s = conn.createStatement ();
System.out.println("statement");
int count =0;
boolean temp;
String query = "INSERT INTO log (passwd, name,surname,lnum) VALUES ('"+pa+"', '"+n+"', '"+sn+"','"+nu+"')" ;
System.out.println("test");
count= s.executeUpdate(query);
System.out.println(query);
System.out.println(count);
ResultSet rs = s.getResultSet ();
if(rs.next()){
JOptionPane.showMessageDialog(frame,
"Welcome ",
"Welcome",
JOptionPane.INFORMATION_MESSAGE);
else {
JOptionPane.showMessageDialog(frame,
"User already exists","error",
JOptionPane.ERROR_MESSAGE);
} -
Normal select statement error!??
Hello All,
I have a table with primary key (antrag_nr, beladeflag, stempel)
Desc test88
Name Null? Type
ANTRAG_NR NOT NULL NUMBER
A_PROZESS NUMBER
STEMPEL NOT NULL DATE
BELADEFLAG NOT NULL VARCHAR2(1)
desc test99
Name Null? Type
ANTRAG_NR NOT NULL NUMBER
A_PROZESS NUMBER
STEMPEL NOT NULL DATE
BELADEFLAG NOT NULL VARCHAR2(1)
select * from test99;
ANTRAG_NR A_PROZESS STEMPEL B
1 3 04-JAN-05 m
2 4 04-JAN-05 m
1 4 05-JAN-05 m
select * from test88;
ANTRAG_NR A_PROZESS STEMPEL B
1 1 01-JAN-05 m
1 2 02-JAN-05 m
1 2 03-JAN-05 m
1 3 04-JAN-05 m
2 1 01-JAN-05 m
2 2 02-JAN-05 m
2 3 04-JAN-05 m
I am writing this query now and getting the below answer.
select a.antrag_nr, a.a_prozess, a.stempel, a.beladeflag from test88 a, test99 b where a.antrag_nr = b.antrag_nr and a.a_prozess <> b.a_prozess and a.stempel = (select max(stempel) from test88);
ANTRAG_NR A_PROZESS STEMPEL B
2 3 04-JAN-05 m
1 3 04-JAN-05 m
according to my query I have a a.a_prozess <> b.a_prozess but why do I get 1 3 04-jan-05 m
Please let me know where have I gone wrong!!
RGds
Karhtik krishnaThe way your initial query was designed, checks all a_prozess available for each antrag_nr. If I change your query around I can demonstrate.
select a.antrag_nr
, b.a_prozess
, a.stempel
, a.beladeflag
from test88 a
, test99 b
where a.antrag_nr = b.antrag_nr
and a.a_prozess <> b.a_prozess
and a.stempel = ( select max(stempel)
from test88
ANTRAG_NR A_PROZESS STEMPEL BELADEFLAG
1 4 4-JAN-2005 m
2 4 4-JAN-2005 m -
SAP ABAP Select Statement/ Queries
Hi.
select * from mver where matnr= itab-matnr
and werks = itab-bwkey
and perkz = 'P'
and gjahr = gjahr1.
there are option like 'P' and 'M' i need to select both of them like 'P/M'.
how can u do tht.
both "m" and "P" period buckets shd be populated with data and need to be added together to pull the zm001127.Hi,
Create a range and then append both the value 'P' and 'M' to the internal table and use the range in the where clause.
data: r_range type range of mver-perkz with header line.
r_range-sign = 'I'.
r_range-option = 'EQ'.
r_range-low = 'P'.
APPEND R_RANGE.
r_range-sign = 'I'.
r_range-option = 'EQ'.
r_range-low = 'M'.
APPEND R_RANGE.
select * from mver where matnr= itab-matnr
and werks = itab-bwkey
and perkz IN R_RANGE
and gjahr = gjahr1. -
ABAP select statement !!
Hi All,
I want to write a query on SOOD table like:
SELECT OBJTP OBJYR OBJNO OBJDES OWNNAM FROM SOOD INTO TABLE IT_SOOD
WHERE OBJDES LIKE 'String%' AND
( SDDAT BETWEEN LV_LASTRUN AND SY-DATUM ) AND
( SDTIM BETWEEN LV_LASTTIM AND SY-UZEIT ).
but this is not returning me data between the last run date/ last run time and current date/ time.
Can anybody suggest how to modify the above query in order to fetch correct data.
Thanks in Advance !!
Vivek>
vivek kulkarni wrote:
> Hi All,
>
> I want to write a query on SOOD table like:
>
> SELECT OBJTP OBJYR OBJNO OBJDES OWNNAM FROM SOOD INTO TABLE IT_SOOD
> WHERE OBJDES LIKE 'String%' AND
> ( SDDAT BETWEEN LV_LASTRUN AND SY-DATUM ) AND
> ( SDTIM BETWEEN LV_LASTTIM AND SY-UZEIT ).
>
> but this is not returning me data between the last run date/ last run time and current date/ time.
>
> Can anybody suggest how to modify the above query in order to fetch correct data.
>
> Thanks in Advance !!
> Vivek
If the last run date was 01.09.2009 and the last run time was 11:00, this code will pick up data for all dates from 01.09.2009 but only if the time value is > 11:00; so if there was a run at 09:00 on 03.09.2009 you won't pick up that record - and I'm assuming that you would want to pick up that record.
I think you should only be applying the time check to records where the date = LV_LASTRUN and for later records you should just be checking the date. Something like:
WHERE ( ( sddat = lv_lastrun
AND sdtim > lv_lasttim )
OR ( sddat > lv_lastrun ) -
Hi,
In an ABAP select statement, how to do operations on two columns of a dictionary transparent table(say division or multiplication on two column values) ?
Reward points will be awarded .
TIA
Regards,
Aninditahi,
see the below link
i hope it will useful for u .
http://help.sap.com/saphelp_nw04/helpdata/en/62/10a423384746e8bf5f15ccdd36e8b1/content.htm
SELECT AVG(salary) FROM employees
SELECT COUNT(*) FROM employees
SELECT COUNT(DISTINCT employee_name) FROM employees
SELECT employee_name, salary + benefit
FROM employees
WHERE salary < 0.8 *
( SELECT MAX( salary ) FROM employees )
Arithmetic Expressions. For all employees that have a salary not exceeding 80% of the salary of the maximum salary of all employees, this query returns the name of the employee and the sum of its salary and its benefit.
reward if its useful
Edited by: p541399 on Feb 28, 2008 5:49 PM -
Urgent, SELECT statement results in error
hi all, this is very urgent, could you guys have a look at my SELECT statement?
SELECT vk~kunnr "customer no
vk~vbeln "sales order no
vk~audat "date
vk~vbtyp "SD DOCUMENT CATEGORY
vk~knumv "lwk
vp~kwmeng "qty
vp~matnr "material no
vp~posnr "LINE ITEM
vd~bstkd "PURCHASE ORDER NO
* kv~kwert "lwk
FROM vbak AS vk
INNER JOIN vbap AS vp
ON vk~vbeln = vp~vbeln
INNER JOIN vbkd AS vd
ON vk~vbeln = vd~vbeln
* INNER JOIN konv AS kv
* ON kv~knumv = vk~knumv
INTO CORRESPONDING FIELDS OF TABLE it_so
WHERE vk~vkorg IN s_vkorg
AND vk~audat IN s_date
AND vk~kunnr IN s_kunnr
AND vp~matnr IN s_matnr
AND vd~bstkd IN s_bstkd
AND vk~vbeln IN s_vbeln
* AND kv~kschl = 'ZP00'
AND vk~vbtyp = 'C'.
The commented lines are the new additions that i want to add to the SELECT statement. But when i un-comment them, i get an error while activating my program. Error is as follows:
For pooled tables, cluster tables, and project views, JOIN is not allowed: "KONV".
Is there a way i can go around it?Hi,
look at this SAP note : 550043
Symptom
KEPM: dump 'MESSAGE_TYPE_X' during automatic planning method execution.
Other terms
KEPM MESSAGE_TYPE_X transform characteristic value
Reason and Prerequisites
This note is related only to cases, if dump 'MESSAGE_TYPE_X' is raising
during execution of planning method, for which is possible to define
transformation of characteristics values i.e. Copy, Forecast, Top-Down
distribution, Ratios and Customer Enhancement.
Dump is raising in case, if there was defined transformation of char.
values in parameter set definition for some characteristic. Later on,
this characteristic was removed from planning level definition but
characteristic wasn't removed from relevant customizing of transform
characteristic values before.
Solution
Please apply attached program correction.
Regards,
GSR.
Maybe you are looking for
-
Jabber for windows soft phone issue
Hi Guys Wondering if anyone has come accross this.. I have just installed J4W 10.5.2, the presence / IM works fine however the soft phone doesn't register. it comes up with error.. Connection error. Ensure the server information in the Phone Servic
-
Java Generics in Ejbs WebLogic 9.2 MP1 WindowsXP Sun JDK
Hi guys, I tried to deploy our application on Weblogic Server 9.2 MP1 (Windows, Sun JDK) and during deployment I have this error see bellow. Can somebody tell me what is the problem with generics and EJB compiler? Is necessary to add any path or chan
-
Finding "Use previous headers and footers"
Working in Word Processing, and I cannot find "Use previous headers and footers" (I need to uncheck it.)
-
URL format to call transaction using WinGUI
Hello, We would like to display SAP transactions in the portal, however they are from the SAP APO sytem and require the the WinGUI setting as they contain graphics that the ITS cannot interpret. WinGUI does not use the ITS. An iView or External Servi
-
BTS 2010: SQL Adapter Class not registered
Hi, after adding a host instance to the SQL Adapter, we receive every time a Class not registered error. The host instance is 32-bit and default for the SQL Adapter. Any ideas or is anyone facing the same issue? KR Peter