cancel
Showing results for 
Search instead for 
Did you mean: 

Selection Variable for 1st Saturday prior to Current Calendar Day (sys-date)

john_hawk
Active Contributor
0 Kudos

Hi Gang,

I need some help. I need to create a variable on a DATS based InfoObject  in a Bex query which selects the first Saturday prior to current calendar day as defined by sys-date. Day of Week is NOT available in the Time Dimension and client is reluctant to remodel at this time.

The perfect solution would be to create a variable which could read the sys-date and determine the calendar day of the previous Saturday as an output parameter for use a a single value selection.

My ABAP skills could be generously be described as "advanced novice". Please be a specific as possible, and hyperlinks to useful materials are greatly appreciated.

Thank you in advance for your help,

John Hawk

View Entire Topic
john_hawk
Active Contributor
0 Kudos

Function Module DATE_TO_DAY is not found in my BW 7.4 system.

dhrubojyoit_saha
Explorer
0 Kudos

Hi,

You can use the below two FMs

DATE_GET_WEEK

This function module returns the week for the date passed.

WEEK_GET_FIRST_DAY

This function module returns the first day of the week passed. (This is always a Monday, regardless of whether it is a working day or a holiday.)

Then you can subtract 2 from this day to get the saturday of the week before.

Regards