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: 

Beginning of the month, urgent

Former Member
0 Kudos

Hi all,

I want to get the beginning of the month for a given date.

For example today is 26102007 but I need to get 01102007, any function?

Thanks.Deniz.

7 REPLIES 7

Former Member
0 Kudos

Hi!

Because a beginning of a month is always at 01, you can use this:

CONCATENATE '01' datum+2(6) INTO month_begin.

If you are using sy-datum, it is in format YYYYMMDD

CONCATENATE sy-datum(6) '01' INTO month_begin.

Regards

Tamá

Former Member
0 Kudos

hi Deniz,

u can use it:

data: date type sy-datum.

date = sy-datum.

date+6(2) = 01.

write: date.

Regards

Allan Cristian

Former Member
0 Kudos
Hi Deniz,

 try this

REPORT YCHATEST2.

DATA : V_DATE LIKE SY-DATUM,
       V_START LIKE SY-DATUM,
       V_END LIKE SY-DATUM.

V_DATE = SY-DATUM.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
  EXPORTING
    IV_DATE             = V_DATE
  IMPORTING
    EV_MONTH_BEGIN_DATE = V_START
    EV_MONTH_END_DATE   = V_END.

WRITE : / 'Start Date :' , V_START,
        / 'End Date : ' , V_END.

Former Member
0 Kudos

Hi,

Beginning of a month would always be starting with '01'

concatenate '01'

date+2(4)

into firstday.

regards,

sheron

Former Member
0 Kudos

Hi Deniz,

You can concatenate '01' like this.

As the begining of a month is always at 01:

CONCATENATE '01' date+2(6) INTO ws_startdate.

If you are using this format YYYYMMDD

CONCATENATE date(6) '01' INTO ws_startdate.

Reward If Useful ,

Regards,

Chitra

Former Member
0 Kudos

Hi Deniz

You can use the FM <b>RS_VARI_V_1_ACTUAL_MONTH</b>.

However this FM will give you the First Day on the current month on execution

Thanks

Vijay

<b>PLZ Reward points if helpful</b>

Former Member
0 Kudos

Hi,

You may use FM FIRST_DAY_IN_PERIOD_GET.

Regards

Raju Chitale