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

first date

Former Member
0 Likes
931

Hi all,

Is there any function module to find the first date of the month by taking the input date...

I.e. if i give 15/10/2007 as input date it should convert the date as 1/10/2007.

Thanks in advance,

Karthi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
896

Hi

Use the FM HR_JP_MONTH_BEGIN_END_DATE.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = f_date

EV_MONTH_END_DATE = l_date.

regards

karthik,

7 REPLIES 7
Read only

Former Member
0 Likes
897

Hi

Use the FM HR_JP_MONTH_BEGIN_END_DATE.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = f_date

EV_MONTH_END_DATE = l_date.

regards

karthik,

Read only

Former Member
0 Likes
896

Hi,

parameters:

p_date like sy-datum.

w_date = p_date+4(2).

w_date = p_date - w_date.

this is the logic for the first date of the given month.

i guess u can create the function module on ur own.

reward points if it helps.

Read only

0 Likes
896

Thanks for your reply,

If i'm giving input date as parameter for eg... 8/10/2007, can u tell me the coding to calculate the first date...

Just give in coding...

Regards,

karthi.

Read only

Former Member
0 Likes
896

Hi

Please also check CK_F_GET_FIRST_DAY_OF_DATE

Regards

Arun

Read only

Former Member
0 Likes
896

Hi,

try with isb_get_first_day.

test this module with date in format dd.mm.yyyy.

nperanz = 1.

periv = 22.

if u want to calculate it urself then do this.

data dd(2) type n,

mm(2) type n,

year(4) type n.

data final_date(11) type c.

suppose date = 12/3/2007.

then do this.

split date at '/' into dd mm year.

concatenate '01' mm year into final_date separated by '/'.

hope this helps.

reward if useful.

Read only

Former Member
0 Likes
896

Hi it is simple,

data: date type sy-datum.

date = sy-datum.

write:/ date..

date+6(2) = '01'.

write:/ date.

Read only

former_member386202
Active Contributor
0 Likes
896

Hi,

Better to hard code 1st date n to find last day use FM

RP_LAST_DAY_OF_MONTH

\Regards,

Prashant