‎2007 Nov 22 6:41 AM
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.
‎2007 Nov 22 6: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,
‎2007 Nov 22 6: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,
‎2007 Nov 22 6: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.
‎2007 Nov 22 8:02 AM
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.
‎2007 Nov 22 6:50 AM
‎2007 Nov 22 8: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.
‎2007 Nov 22 8:28 AM
Hi it is simple,
data: date type sy-datum.
date = sy-datum.
write:/ date..
date+6(2) = '01'.
write:/ date.
‎2007 Nov 22 8:36 AM
Hi,
Better to hard code 1st date n to find last day use FM
RP_LAST_DAY_OF_MONTH
\Regards,
Prashant