04-05-2007 6:26 AM
04-05-2007 6:28 AM
Hi..,
move '01' to the day characters of the date field...
Execute this code...
<b>parameters Date type sy-datum default '20071203'.
move '01' to date+6(2).
write date.</b>
reward all helpful answers!!
sai ramesh
04-05-2007 6:29 AM
Hi,
parameters w_date like sy-datum .
w_date+6(2) = '01'.
write w_date. " first date
Message was edited by:
ananth
04-05-2007 6:29 AM
04-05-2007 6:29 AM
U can also use the function module
<b>BKK_GET_MONTH_LASTDAY</b>, pass any date of the previos month, u'll get the last of the previous month and add 1 to the date returned by the fm to get the first DAY of the current month.
Message was edited by:
Rajesh
04-05-2007 6:31 AM
Hi,
Take a look at this link
http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm
Prajith
04-05-2007 6:32 AM
if you have the date var..
data : date like sy-datum value '20070405'.
concatenate date+0(6) '01' into date.
regards
shiba dutta
04-05-2007 6:32 AM
Hi,
DATA: ultimo TYPE d.
ultimo = sy-datum.
ultimo+6(2) = '01'. " = first day of this month
Regards
Sudheer
04-05-2007 6:33 AM
hi,
data : DAYNR LIKE HRVSCHED-DAYNR,
DAYTXT LIKE HRVSCHED-DAYTXT.
data langu like sy-langu value 'EN'.
Parameters PDATE LIKE SY-DATUM.
PDATE+6(02) = '01'.
.
CALL FUNCTION 'RH_GET_DATE_DAYNAME'
EXPORTING
LANGU = LANGU
DATE = PDATE
CALID =
IMPORTING
DAYNR = DAYNR
DAYTXT = DAYTXT
DAYFREE =
EXCEPTIONS
NO_LANGU = 1
NO_DATE = 2
NO_DAYTXT_FOR_LANGU = 3
INVALID_DATE = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE 😕 PDATE, DAYNR, DAYTXT.
************************************
(OR)
Try..
DATA:DAYNR LIKE HRVSCHED-DAYNR,
DAYTXT LIKE HRVSCHED-DAYTXT,
DAYFREE LIKE HRVSCHED-NODAY.
DATA:LANGU LIKE SY-LANGU ,
DATE LIKE SY-DATUM,
CALID LIKE P1027-CALID VALUE 'US'.
date = sy-datum.
date+6(2) = 01. "----->to get the first day .
*first day of the month
write:/ 'First date of the month', date.
*Day name
CALL FUNCTION 'RH_GET_DATE_DAYNAME'
EXPORTING
langu = SY-LANGU
date = DATE
CALID = CALID
IMPORTING
DAYNR = DAYNR
DAYTXT = DAYTXT
DAYFREE = DAYFREE
EXCEPTIONS
NO_LANGU = 1
NO_DATE = 2
NO_DAYTXT_FOR_LANGU = 3
INVALID_DATE = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ DAYTXT.
Don't forget to reward if useful....
04-05-2007 6:35 AM
refer below code,
DATA: currDate TYPE d.
currDate = sy-datum.
*write : 'befor ' , currDate.
currDate+6(2) = '01'.
*write 😕 'after ' , currDate.
currDate = currDate.
WRITE: / 'first day of month' , currDate.
*
*ULINE.
*
*currDate = sy-datum.
*
*write : 'befor ' , currDate.
*
*currDate+4(2) = currDate+4(2) + 1.
*
*currDate+6(2) = '01'.
*
*write: / 'after one month ' , currDate.
reward if useful
04-05-2007 6:36 AM
Hi,
Try this.
data g_first_day type sy-datum.
g_first_day = sy-datum.
g_first_day+6(2) = '01'.
Will change to first day of present month.
Hope this will help.
Jogdand M B
04-05-2007 6:40 AM
Hi palaniappan,
Use this code.
parameters :
p_reqdat type d.
data:
w_futrdate type d,
w_chtext(8) type c.
w_chtext = p_reqdat.
w_chtext+6(2) = '01'.
w_futrdate = w_chtext.
write ' The First Day of Next Month is '(001).
write w_futrdate dd/mm/yyyy.
Rewar if helpful.
Regards,
Satish
08-18-2016 7:53 AM