Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Week Day Basis comparison

Former Member
0 Likes
663

Hi, Experts...I am having a very strange requirement. In a report i need to give current sales of current date as well as but date comparison is based on week and day not date. Like if current date is 1st Jan 2011sature day 1st week of 2011 and i am executing the reports, it will also display the sales of 1st week sature day of 2010 wich is actually 2nd jan. So i am calculating th e week number and accordingly finding the date of the current year day. Its giving the accurate result. But i run for 31.12.2009 wich is 53rd week its gives me blank as year 2008 has only 52 weeks. Pls suggest me a FM for comparing the days as AS400 is able to give the sales.

Hi, Experts...I am having a very strange requirement. In a report i need to give current sales of current date as well as but date comparison is based on week and day not date. Like if current date is 1st Jan 2011sature day 1st week of 2011 and i am executing the reports, it will also display the sales of 1st week sature day of 2010 wich is actually 2nd jan. So i am calculating th e week number and accordingly finding the date of the current year day. Its giving the accurate result. But i run for 31.12.2009 wich is 53rd week its gives me blank as year 2008 has only 52 weeks. Pls suggest me a FM for comparing the days as AS400 is able to give the sales.

4 REPLIES 4
Read only

Former Member
0 Likes
619

Hi,

I think we can put the condition like it the curr week is last week of the year then get the last week of the prvs year.

like if curr date is 30.12.2010 then the week is 53, we can use fm 'BKK_GET_LASTWEEK_OF_YEAR' to check wether it is last week of the month, then use the same fm to get the last week of the prvs year.

Then we can get the day of that week ...

Regards,

Anmol.

Read only

0 Likes
619

Hi, I am able to claculate the corresponding day of the week. But my problem is if the current yr having 53 weeks and prev year is having 52 weeks..and the user runs in any date wich falls in 53rd week the FM is unble calculate the day for that as the prev does not contain any 53rd week. That why i need some standard FM wich works on posing period or some thing and gives me relevant dat of last year like AS400.

Read only

0 Likes
619

My idea is,

just first check wether the current week is last week using the given FM if so then get the last week of the prvs year.

even if the current year have 53 weeks and prvs has 52 or any thing...this will work.

Read only

Former Member
0 Likes
619

Solved. Used HR FM module