‎2008 Jul 23 4:59 PM
hi,
in my code i am having some select, select single and select count(*) statements. during syntax check it gives me the error saying nesting of select is not proper and that i need to include an endselect.
whats wrong !!
i just have single line select statements and no block of code to be executed, if so i wouldhave put a select and endselect.
pl advise. thks
‎2008 Jul 23 5:02 PM
copy your code here...
venkatesh appikonda:
"select single must have endselect ."
unfortunately this is wrong...
‎2008 Jul 23 5:01 PM
‎2008 Jul 23 5:01 PM
A SELECT without SINGLE or aggregate function like COUNT (*) or INTO TABLE addition usually requires an ENDSELECT.
Thomas
‎2008 Jul 23 5:02 PM
copy your code here...
venkatesh appikonda:
"select single must have endselect ."
unfortunately this is wrong...
‎2008 Jul 23 5:05 PM
Thanks Eric, here is my select related code..this is in the user exit save_document_prepare of MV45AfZZ.
SELECT LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.
SELECT COUNT(*) INTO L_LINES FROM Zcusttable WHERE ALAND = L_ALAND AND LAND1 = L_LAND1.
SELECT SINGLE TDIIX INTO L_TDIIX FROM TVLK WHERE LFART = L_LFARV.
‎2008 Jul 23 5:07 PM
SELECT SINGLE LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.
‎2008 Jul 23 5:08 PM
SELECT SINGLE LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.
pls. correct (in bold)
you select only one record (KUNNR is the only key field in KNA1)
‎2008 Jul 23 5:08 PM
‎2008 Jul 23 5:09 PM
‎2008 Jul 23 5:10 PM
please try to include single after select.
SELECT Single LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.
HOpe this solves ur issue.
Shreekant
‎2008 Jul 23 5:09 PM
Hi Friend,
Please change :
SELECT LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.
as
SELECT SINGLE LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.
Check this link. I think this might help you.
http://www.sapbrainsonline.com/sapinfo/tutorial.php?artid=414
Hope this helps you.
Regards,
Chandra Sekhar