Skip to Content
Former Member
Mar 19, 2009 at 09:24 AM

Date without single quotes in SQL Where clause turns to 00000000. Why?


The below program works in 4.6c but does not in ECC 6.0, the issue is the date actually turns to 00000000, debug shows the internal table as having the correct value that was inserted but st05 trace shows that the variable is holding the value 00000000, this works fine when the date is put inside single quotes but the actual program where I have this issue does not warrant adding single quotes. Has someone come across this situation. Any help is appreciated!

data v_vbeln like vbak-vbeln.

data: begin of where_tab occurs 0,

s_date(20) type c,

end of where_tab.

where_tab-s_date = 'audat = 19971106'.

append where_tab.

select vbeln into v_vbeln from vbak where (where_tab).

write:/ v_vbeln.