‎2007 May 22 1:38 PM
Hi ,
i working in upgrade from 4.5 to ECC6 . I hav an syntax error in the below select statement.
Authorisation Cheacks for Super User
SELECT SINGLE * FROM USR02 WHERE BNAME = SY-UNAME
AND CLASS = 'RES_SUPERVIS'.
Erro message :
<b> A target area must be declared either explicitly with an INTO clause or
implicitly with a TABLES statement. </b>
I feel that we hav create a work area.. but any other solution
Any suggestion for doing this...
regards,
sanjay
‎2007 May 22 1:41 PM
in the starting of the program declare as
<b>TABLES: USR02.</b>
so, when u write the select statement as
Authorisation Cheacks for Super User
SELECT SINGLE * FROM USR02 WHERE BNAME = SY-UNAME
AND CLASS = 'RES_SUPERVIS'.
the data from USR02 will get stored in the workarea of USR02 as it is defined in the tables statement.
‎2007 May 22 1:42 PM
‎2007 May 22 1:43 PM
‎2007 May 22 1:44 PM
Hi,
Yes u need to declare a work area for populating with the single record.
If u r using Non primary key in WHERE CONDITION, then U can use
TabLES: MARA
Select * from MARA upto 1 row where ersda = p_ersda.
end select.
In this case selected record will get poulated into workarea (mara) . As we uses TabLES statement, Workarea is decalred implicity and there si no need to declare work area explicitly.
Revrt back if any issues,
Reward with points if helpful.
Regards,
Naveen
‎2007 May 22 1:44 PM
Hi,
U might not have dfined USR02 in the tables statement.
The select statement requires an default workarea to store the value,so on declaring
TABLES: USR02.
It will create a default workarea..
and u problem will be solved..
Cheers,
Simha.
Reward all the helpful answers..
‎2007 May 22 1:46 PM
Hi sanjay,
Creating a work area of line type USR02 would be the optimal solution.
Regards,
Basu.
Message was edited by:
Basavaraj P Umadi
‎2007 May 22 1:47 PM
Hi,
There are two solutions
1) Create your own work area with same structure of USR02 & add into workarea i
in select statement
2) Declare statement Table USR02 at the start so all the data will be captured in USR02.
Thanks
Sandeep
Reward if helpful
‎2007 May 22 1:51 PM
hi,
create a internal table with heaedr line as
data: itab like usr02 occurs 0 with header line.
give like this
SELECT SINGLE * FROM USR02 into table itab WHERE BNAME = SY-UNAME
AND CLASS = 'RES_SUPERVIS'.
if helpful reward some points.
with regards,
suresh babu aluri.