Application Development 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: 

How to get the First day in a Week in a Fiscal Year

Former Member
0 Kudos
159

Hi guys,

I have a Requirement to calculate the First day in a Week in a Fiscal year .

The FM GET*FIRST_DATE and all are for Calender year.

Is there any FM to calculate the First in a Week in a Fiscal year.

For eg. They will give 200826.

In this 26 is the Week.

I need to find the First date value in that Week.

Thanks,

Gokul

1 ACCEPTED SOLUTION

Former Member
0 Kudos
69

You can use FM 'WEEK_GET_FIRST_DAY' to get the first date in that week.

Pranav

5 REPLIES 5

Former Member
0 Kudos
70

You can use FM 'WEEK_GET_FIRST_DAY' to get the first date in that week.

Pranav

suresh_datti
Active Contributor
0 Kudos
69

A simple search in SE37 would return FIRST_DAY_IN_PERIOD_GET.

~Suresh

shishupalreddy
Active Contributor
0 Kudos
69

Hello ,

U can check with HRFIRSTdATE*

oR U CAN find some FMS where it will take BUKRS as export parameter from u r program so that u can get the date with refernec to the Fiscal Year .

Regards

Former Member
0 Kudos
69

hi,

This can be achieved in the following way too...

considered the first day of gregorian calendar that is 01011900, subtract this date from the first date of the fiscal year,

The result you get take mod of it towards 7 i.e

day = res mod 7.

The above result varies from 0-6, which is mapped to sun-sat using a case statement.

I have used the similar method in one of the requirement and it worked for me.

Hope it helps you..

Thanks

Sharath

Former Member
0 Kudos
69

Hi Gokul...

Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.

Its similar to the above one but instead of writing case statement you can achive the following.

data : w_res type i,

w_data type d,

w_res = w_date mod 7.

w_date = w_date - w_res.

write w_date.

This works.

Regards,

Siddarth