‎2008 May 07 10:40 AM
Hi all,
Does anyone know the SQL-statement to determine if a record in a table exists? I don't want to read any data into the working-storage, I just need the returncode. I think it's something like, "transfer no data...." but I can't find the
exact syntax.
And yes....points for good/helpful answers guaranteed!
Thanks in advance.
Ivo
‎2008 May 07 11:34 AM
select single * from zark_alv_test where grade = 'G'.
if sy-subrc = 0 .
write : / 'Exists'.
else.
write : / 'Does not Exists'.
endif.
in this SELECT query u are jst checking and not fetching data into workarea this is one of the way and also performance wise advisable to use....
check the SY_SUBRC And then u will know whether the record exists in DB table .....
award points if useful thanks
‎2008 May 07 11:21 AM
u cant use transporting no fields addition with db tables.its used with internal tables to chack whether a record exits or not.
u've to use simple select statment like..
Select single......from ..into ... where...
if sy-subrc = 0.
"record exists.
elseif sy-subrc eq 4.
"record doesnt exit.
endif.
‎2008 May 07 11:34 AM
select single * from zark_alv_test where grade = 'G'.
if sy-subrc = 0 .
write : / 'Exists'.
else.
write : / 'Does not Exists'.
endif.
in this SELECT query u are jst checking and not fetching data into workarea this is one of the way and also performance wise advisable to use....
check the SY_SUBRC And then u will know whether the record exists in DB table .....
award points if useful thanks
‎2008 May 07 11:59 AM