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

about functional module

Former Member
0 Likes
882

Hi Experts,

I have to create a functional module which gives output as-

in first column year, next month, next days of that month like 1,2,3---

Thanks in advance, Points sure.

6 REPLIES 6
Read only

Former Member
0 Likes
851

Hi Anshu,

Is there any input to the function module (Like DATE) or is it just you want year, month and days of that month as output?

If date would be the input, in the function module define year and month as exporting parameters and for days you can define tables parameter.

To get the year from date: e_year = i_date+0(4).

To get the month from date: e_month = i_date+5(2).

To get days of the month: you can use the function module

"NUMBER_OF_DAYS_PER_MONTH_GET" by passing the year and month. This will return if it is 30 or 31 or 28. Depending on which you can update your tables parameter with numbers (by incrementing the counter according to number of days).

This would give you the required data using which you can design them as you want.

<i><b>Reward points if helpful.</b></i>

Best Regards,

Ram.

Read only

0 Likes
851

i just want year , monyh of that year, days of that month as my output. If u hav any sample code plz provide.

Thanks.

Read only

0 Likes
851

Hi Anshu,

Use the help of FM "CONVERT_DATE_TO_INTERNAL ".

Regards

Sourabh Verma

Read only

kiran_k8
Active Contributor
0 Likes
851

Anshu,

Use this Function Module.

HRCM_TIME_PERIOD_CALCULATE

K.Kiran.

Read only

Former Member
0 Likes
851

pata nahi yaaaaar kaise banega .........sala kahin humse bol de dipak ki banao bete banao .abhi chaiye .........

Read only

Former Member
0 Likes
851

Hi Anshu,

Below code will satisfy your requirement.

REPORT ZKK_YEAR.

data: v_month like T009B-BUMON,

v_year like T009B-BDATJ,

v_days like T009B-BUTAG.

move: sy-datum+4(2) to v_month,

sy-datum+0(4) to v_year.

CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'

EXPORTING

par_month = v_month

par_year = v_year

IMPORTING

PAR_DAYS = v_days.

write: /5 'Year : ',

15 v_year,

25 'Month : ',

40 v_month,

50 'Days : ',

60 v_days.