Former Member

# first date

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.

Karthi.

10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on Nov 22, 2007 at 06:45 AM

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,

10|10000 characters needed characters exceeded
• Former Member
Posted on Nov 22, 2007 at 06:48 AM

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.

10|10000 characters needed characters exceeded
• Former Member

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.

• Former Member
Posted on Nov 22, 2007 at 06:50 AM

Hi

Regards

Arun

10|10000 characters needed characters exceeded
• Former Member
Posted on Nov 22, 2007 at 08:11 AM

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.

10|10000 characters needed characters exceeded
• Former Member
Posted on Nov 22, 2007 at 08:28 AM

Hi it is simple,

data: date type sy-datum.

date = sy-datum.

write:/ date..

date+6(2) = '01'.

write:/ date.

10|10000 characters needed characters exceeded
• Posted on Nov 22, 2007 at 08:36 AM

Hi,

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

RP_LAST_DAY_OF_MONTH

\Regards,

Prashant