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

FM

Former Member
0 Likes
893

Hi Guru,

I want one function module which can convert period to date.

means if I am giving 06-2008. Then I should get as out put as

01-06-2008 and 30-06-2008. I shouls get the first and last date for that period.

I should give only the period.

Max pts will be rewarded.

Thanks,

6 REPLIES 6
Read only

Former Member
0 Likes
857

Use FM FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET

Read only

Former Member
0 Likes
857

Hi,

In this case u can concatenate 01 and 30 to the date that u are passing and collect in two variables representing the start date and end date respectively.

Cheers,

Sai

Read only

Former Member
0 Likes
857

If v_period is your period ...

replace all occurrences of '-' in v_period with ''.

condense v_period.

concatenate v_period2(4) v_period0(2) '01'

into v_firstdate.

Use FM BKK_GET_MONTH_LASTDAY and pass

v_firstdate .. get v_lastdate ...

write v_firstdate to v_fdate.

write v_lastdate to v_ldate.

Read only

Former Member
0 Likes
857

hi use this ..fm

OIL_MONTH_GET_FIRST_LAST..

data: fday type sy-datum,

lday type sy-datum.

CALL FUNCTION 'OIL_MONTH_GET_FIRST_LAST'

EXPORTING

I_MONTH = sy-datum+4(2)

I_YEAR = sy-datum+0(4)

IMPORTING

E_FIRST_DAY = fday

E_LAST_DAY = lday.

write:/ lday,fday .

Read only

Former Member
0 Likes
857

Hi Sandeep,

I tried with ur input to get the requirement and i am able to solve half of the part with FM JVA_LAST_DATE_OF_MONTH

u try with this code....

PARAMETERS: P_DATE TYPE JVA_PROD_MONTH.

DATA: DATE1 TYPE SY-DATUM.

CALL FUNCTION 'JVA_LAST_DATE_OF_MONTH'

EXPORTING

YEAR_MONTH = P_DATE

IMPORTING

LAST_DATE_OF_MONTH = DATE1.

WRITE: DATE1.

If u can find the FM for First date in the month with enterring period then the probelm is solved.

-Regards.

Read only

JanStallkamp
Advisor
Advisor
0 Likes
857

Hi.

You can increase the number of people reading your question by using a better subject. Describe your issue and more people get interested in reading your posting. Please have a look into our rules of engagement which will explain some other things you should know as a member of SDN. Postings not following the rules will be locked or deleted.

Best regards,

Jan Stallkamp