Skip to Content

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

How to put sql statements so that I can use it in a Calculation view?

Hi,

I have few DML STATEMENTS THAT I WOULD LIKE TO RUN VIA A PROCEDURE SO THAT I CAN USE IT AS AN INPUT INA CALVIEW, HOW WOULD I IMPLEMENT IT.

mY SQL STATEMENT IS

UPDATE "AVG_DIM" SET "MONTH" = MONTH(TO_DATE("ZDATE",'YYYYMMDD'));

UPDATE "AVG_DIM" SET

"YTD" = case when month(current_date) >= "MONTH"

       then 'Y' else 'N' end,

       "LASTTHREEMONTH" = case when month(current_date)-3 >= "MONTH"

       then 'N' else 'Y' end,

       "LASTMONTH" = case when month(current_date)-1 = "MONTH"

then 'Y' else 'N' end,

"LASTSIXMONTH" = case when month(current_date)-6 >= "MONTH"

then 'N' else 'Y' end;

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question