Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How do I refer the current date in this sql ?

Hi

Look at my my sql snippet below at SY-DATUM. How do I refer the current date in this sql ? ( I would like to check if the current date falls between those two dates, currently I am getting error )

"

...

FROM ( /sapsll/prcon

INNER JOIN /sapsll/prcts

ON /sapsll/prctsguid_pr = /sapsll/prconguid_pr

INNER JOIN /sapsll/tlegsv

ON /sapsll/tlegsvlgreg = /sapsll/prconlgreg

INNER JOIN /sapsll/ctsnum

ON /sapsll/ctsnumguid_ctsnum = /sapsll/prctsguid_ctsnum

AND /sapsll/ctsnumstcts = /sapsll/tlegsvctsex

INNER JOIN /sapsll/prgen

ON /sapsll/prgenguid_pr = /sapsll/prctsguid_pr

INNER JOIN /sapsll/ctsnum as a

ON aguid_ctsnum = /sapsll/prctsguid_ctsnum

AND SY-DATUM BETWEEN aDATAB AND aDATBI

)

INTO CORRESPONDING FIELDS OF TABLE lt_product_class_temp

FOR ALL ENTRIES IN lt_product_class

WHERE /sapsll/prcon~congr IN sp$00017"

...

"

thanks

siva

Edited by: Sivanantham kandan on Sep 13, 2008 3:26 AM

Edited by: Sivanantham kandan on Sep 13, 2008 3:27 AM

Tags:
Former Member
replied

SY-DATUM is not part of the table , so it is not possible to do that. but you can do that in reverse.

INNER JOIN /sapsll/ctsnum as a
ON a~guid_ctsnum = /sapsll/prcts~guid_ctsnum
AND a~DATAB  le sy-datum   you can do this....
AND a~DATBI   ge sy-datum
)
INTO CORRESPONDING FIELDS OF TABLE lt_product_class_temp
FOR ALL ENTRIES IN lt_product_class
WHERE /sapsll/prcon~congr IN sp$00017"

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question