‎2008 Jun 30 10:53 AM
Hi All,
I calculated opening stock,closing stock based on the date,now I need to calculate based on month also,
Is any functionmodule is there to convert date into month.
Thanks@regds,
Sree.
‎2008 Jun 30 12:09 PM
Hi
You can use FM "HR_SGPBS_YRS_MTHS_DAYS". to get the interval between two dates.
Using this FM you not only get the diff. in months but also in year.
CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
EXPORTING
beg_da = s_budat-low <----
From date
end_da = s_budat-high <----
To date
IMPORTING
no_day = l_day
no_month = l_month
EXCEPTIONS
dateint_error = 1
OTHERS = 2.
‎2008 Jun 30 10:55 AM
‎2008 Jun 30 11:01 AM
use FM RP_CALC_DATE_IN_INTERVAL
call function <b>'RP_CALC_DATE_IN_INTERVAL'</b>
exporting
date = '06/15/2006'
days = 14
months = 0
signum = '+'
years = 0
importing
calc_date = wa_date.
to add days month use + or use - to go back
‎2008 Jun 30 11:24 AM
Use FM VELO03_DATE_TO_WEEK_OR_MONTH to convert ur date into month.
Please give reward point if above solution is applicable.
‎2008 Jun 30 12:09 PM
Hi
You can use FM "HR_SGPBS_YRS_MTHS_DAYS". to get the interval between two dates.
Using this FM you not only get the diff. in months but also in year.
CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
EXPORTING
beg_da = s_budat-low <----
From date
end_da = s_budat-high <----
To date
IMPORTING
no_day = l_day
no_month = l_month
EXCEPTIONS
dateint_error = 1
OTHERS = 2.
‎2008 Jun 30 12:15 PM
‎2008 Jun 30 1:16 PM
Use the Function Module HR_AUPBS_MONTH_DAY and try
or else from the Transaction SE37 in the description type date or month and search.
U wil get number of function modules.
‎2008 Jul 02 6:10 AM
Hi All,
In my selection screen if the user gives the date from 11.01.2008 to 11.07.2008,
by using the start date I am finding start date of the month and end date of the month by using FM HR_JP_MONTH_BEGIN_END_DATE,these two dates helps me to calculate Opening stock and closing stock of this month,in the same way I need to calculate remaing months Opening stock and closing stock in the selected Period,how to calculate remaining months.
Thanks®ds,
Sree.
‎2008 Jul 02 6:42 AM
Hi ,
Find the start date of month for 11.01.2008 and end date of month for 11.07.2008 .Now Using these two dates calculate Opening stock and closing stock during that period.
Regards,
Sachin M M
‎2008 Jul 02 7:36 AM
Hi Sachin,
I need to calculate stock for each and every month,user only gives the date period,now I able to calculate starting month Opening stock ,closing stock,like way I need to find all the months selected in Selection screen date range.
Thanks®ds,
Sree.
‎2008 Jul 02 6:28 AM
hi
list of FM try
A
CALCULATE_DATE : Calculates the future date based on the input .
v DATE_TO_DAY : Returns the Day for the entered date.
v DATE_COMPUTE_DAY : Returns weekday for a date
v DATE_GET_WEEK : Returns week for a date
v RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
v DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
v MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
v END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
v HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
v FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
v MONTH_NAMES_GET : Get the names of the month
hope this willl solv ut problem
Amit
‎2008 Jul 02 7:37 AM
‎2008 Jul 02 6:51 AM
data:L_date type datum,
l_month type char2,
wa_T247 type T247.
l_date = sy-datum.
*internal valye in format YYYYMMDD
l_month = l_date+4(2).
select single * from t247
into wa_t247 where SPRAS = sy-langu and
MNR = l_month.
if sy-subrc = 0.
write: /1 wa_t247-mnr,10 wa_t247-LTX.
endif.
‎2008 Jul 02 7:53 AM
Hi,
Maybe you need function "DATE_TO_PERIOD_CONVERT"
Regards,
Pole
‎2008 Jul 02 7:59 AM