‎2007 Mar 29 12:13 PM
Hi gurus!
It is often necessary to know if some entry exists in the database table. There is an addition 'TRANSPORTING NO FIELDS' for read table statement. But I couldn't find something like it for the select statement. Maybe I should use another statement for my requirement?
Thanks in advance.
‎2007 Mar 29 12:16 PM
tables : mara.
select single * from mara where .....
if sy-subrc = 0.
<record exist>
else.
<no>
endif.
regards
shiba dutta
‎2007 Mar 29 12:20 PM
> tables : mara.
> select single * from mara where .....
> if sy-subrc = 0.
> <record exist>
> else.
> <no>
> endif.
Thanks, but here you declare structure mara, i.e. you use this structure as container for the selection...
‎2007 Mar 29 12:24 PM
that is correct but that is table work area where it should take the value...i think no other options are there to check that.
regards
shiba dutta
‎2007 Mar 29 12:37 PM
Ok. Most likely you are right. But it is still a little bit strange for me why didn't SAP foresee such a request to the database...
p.s. Points were awarded.
‎2007 Mar 29 12:19 PM
i dont think that there is a statement like that.
You can use a SELECT SINGLE or SELECT * UP TO 1 ROWS statement
regards,
Hans
Please reward all helpful answers !!!!!
‎2007 Mar 29 12:41 PM
Hi Pavel,
Declare the table in the report using TABLES.
example.
TABLES: MARA.
SELECT MATNR FROM MARA WHERE MATNR IN S_MATNR.
for this you do not require any into clause......
Thanks and Regards,
Kunjal Patel
‎2007 Mar 29 12:44 PM
You can use the table itself
REPORT YCHATEST1.
TABLES: MARA.
SELECT MATNR FROM MARA into mara-matnr WHERE MATNR IN S_MATNR.