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: 

Function module for deriving CALMONTH from CALWEEK

Former Member
0 Kudos

hi experts !

i want to calculate calmonth from calweek. can anyone plese tell me the function module for the same.

thanx in advance,

akanksha

5 REPLIES 5

Former Member
0 Kudos

Hi Akansha,

Can you please clarify your requirement, as I'm unable to understand "calmonth from calweek"??

Thanks,

Abhishek

0 Kudos

okey now suppose if we have the value 200805 ( 2008 being the year and 05 being the week i.e. the 5th week of year 2008) i want a FM which gives me output in the form 200802 ( 2008 being year and 02 being month, since 5th week of the year falls in 2nd month i.e. february).

any hints now?

Former Member
0 Kudos

Hi,

As I know there is a FM for getting the number of a day in a week.

for e.g. Thursday is the 4 day in week.

For this req. u can use FM: DAY_IN_WEEK.

And if newaz, u want to calculate any month, you can directly use the incoming date to yoour program by

putting offset value & compare that month with your desired requirements.

Please reward points, if u find it successful.

Thanks,

Abhishek

Former Member
0 Kudos

>

> hi experts !

>

> i want to calculate calmonth from calweek. can anyone plese tell me the function module for the same.

>

> thanx in advance,

>

> akanksha

Hi,

The function modules are.

UMC_CALDAY_TO_FISCPER

DATE_TO_PERIOD_CONVERT

If you give date as input this funciton modules convert that date into weeks.the date in the sense if you give 01.01.2007

then the output of the function module comes as 200648.

means here the fiscal year and the week of that fiscal year is present.now you have to split that year and week.

take that value into one variable.

suppose take into x.

x= 200648.

then pass this value with out year

y = x+4(2).

now you have week .

so that you can calculate period ,quarter and half year based on the week.

Regards,

swami.

Former Member
0 Kudos

as per your requirement nothing to do with the year right and you need to get the month from the week specified.

Total_days = 5*7

while total_days > 0 .

using afunction module 'NUMBER_OF_DAYS_PER_MONTH_GET' get the number of days in first payroll period say period_days

total_days = total_days - period_days.

total_months = total_months + 1

endwhile.