‎2007 Apr 27 6:50 AM
Hello Friends,
Is this query is correct? actually I am getting error.
Is there any other way to write this query?... pls reply me.
SELECT VBELN POSNN FROM VBFA
INTO (PT_PONO-EBELN, L_POSNR)
WHERE VBELV = PT_VBAP-VBELN
AND POSNV = PT_VBAP-POSNR
AND VBTYP_N = GC_DOC_PO.
Regards,
Shreekant
‎2007 Apr 27 6:54 AM
In your query:
SELECT VBELN POSNN FROM VBFA
INTO (PT_PONO-EBELN, L_POSNR)
WHERE VBELV = PT_VBAP-VBELN
AND POSNV = PT_VBAP-POSNR
AND VBTYP_N = GC_DOC_PO.
What is the type of the variable PT_PONO-EBELN?
Hope it should be the same type as that of VBFA-VBELN.
‎2007 Apr 27 6:55 AM
hi shreekant
try to change this PT_VBAP-VBELN,PT_VBAP-POSNR......
try to give the correct where condition.
thanks and regards\
shyam,
‎2007 Apr 27 6:55 AM
‎2007 Apr 27 6:57 AM
Hi Shree ,
write your select query in this format
SELECT matnr mtart meins INTO (it_matrec-matnr , it_matrec-mtart ,
it_matrec-meins )
FROM mara
WHERE matnr IN s_matnr.
Check for proper where condition .
Reward points if helpful .....
Regards,
Amber Soni
Message was edited by:
amber soni
‎2007 Apr 27 7:02 AM
Hi shree,
try this
SELECT VBELN POSNN FROM VBFA
INTO (PT_PONO-EBELN L_POSNR)
WHERE VBELV = PT_VBAP-VBELN AND
POSNV = PT_VBAP-POSNR AND
VBTYP_N = GC_DOC_PO.If it hasnt worked plz specify me which type of error u got
Reward if helpfull
Regards
Pavan
‎2007 Apr 27 7:03 AM
Hi,
For the query that not use all key, you should use the format:
select XXX XXX
into ( XXX XXX)
up to 1 rows
where XXX.
endselect.
‎2007 Apr 27 7:04 AM
hi
good
you have not mentioned what kind of error you r getting in this query,check with following things
1- check the condition that you have given in the into statement
2- check with the where and and conditions
thanks
mrutyun^
‎2007 Apr 27 7:13 AM
Hi Shree,
Just check the data types of the variable in where condition.
Regards,
Suresh
‎2007 Apr 27 7:13 AM
Hi Shreekant,
<b>
Reason for getting error in your SELECT query is:</b>
Yes it definetely throw error because there may be a choice of multiple records satisfying the WHERE condition, but you used Work area instead if you TABLE.
Suppose if you want only single record which satisfy the condition use either
1. SELECT SINGLE or
2. SELECT ... FROM .... UPTO 1 rows.
Also check also type mismatch i.e., whether your are pushing value into the correct dataobject or table.
<b>
Reward all helpful answers</b>
Regards,
V.Raghavender.
‎2007 Apr 27 7:28 AM
try this select query.
declare internal table
data : begin of it_final,
vbeln like vbfa-vbeln,
posnn like vbfa-posnn,
ebeln like vbfa-ebeln,
vbelv like <tablename>-<fieldname>,
posnv like <tablename>-fieldname>,
vbtyp_n like <tablename>-fieldname>,
end of it_final.
include all the fields in final table which are used in the program.
then we can use select statement as
select vbeln posnn from vbfa into corresponding fields of table it_final
WHERE VBELV = PT_VBAP-VBELN
AND POSNV = PT_VBAP-POSNR
AND VBTYP_N = GC_DOC_PO.
in write satement we can give whichever fields we like to see in o/p
write 😕 it_final-vbeln,
it_final-posnn.
if u find this as helpful please reward with points
‎2007 Apr 27 7:42 AM
Hello Friends,
Thank you very much to all!... The issue is resolved.
Actuually the select statement is correct, only the thing is I did't declared "VBAP-POSNR"...
Also I have awarded some points...
Regards,
Shreekant
‎2007 Apr 27 7:43 AM