09-11-2007 10:59 AM
Hi All,
Please help me in this issue.
In the selection screen the lower limit of the select option should be last three months and on high it should be the sy-datum for ex
30.06.2007 30.09.2007
thanks in advance
thanks & regards
Kreddy
09-11-2007 11:05 AM
Hi,
you got the date
now subtract 3 from the month
and use this fm this will give the last day of the particular month
for eg
current month required
3 12 and -1 for year
4 1
5 2
like this
for
2 11 -1 for year
1 10 and -1 for year
then use it
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = R_FDATE-HIGH
IMPORTING
LAST_DAY_OF_MONTH = G_LTDT
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards,
Venkatesh
09-11-2007 11:05 AM
Use the Function module 'CCM_GO_BACK_MONTHS' ...
when u execute this function module give the Date (which date u need) and the number of months you need to go back as input parameter.... it will give u that previous date..
09-11-2007 11:05 AM
09-11-2007 11:10 AM
hi reddy,
1. use the FM
HR_JP_ADD_MONTH_TO_DATE
2. Pass -3
in the parameter IV_MONTHCOUNT
regards,
amit m.
09-11-2007 11:11 AM
Hi
Subtract 3 in month and validate if it is less than 1 then move it to 12 like this
Regards
Shiva
09-11-2007 11:12 AM
Hi Reddy,
The below code should guide you to get your work done
____________________________________________________________________
gv_to_date = sy-datum.
gv_from_date = sy-datum - 90.
SELECT-OPTIONS s_date FOR sy-datum DEFAULT gv_from_date TO gv_to_date.
____________________________________________________________________
Pl. rewards points for useful answer.
Regards.
09-11-2007 11:13 AM
Hi,
take the help from this code :
data : date type sy-datum, out_date type sy-datum.
date = sy-datum.
CALL FUNCTION 'J_1H_CAL_DATE_IN_INTERVAL'
EXPORTING
date = date
days = '00'
months = '03'
SIGNUM = '-'
years = '00'
IMPORTING
CALC_DATE = out_date.
write 😕 out_date.
I hope, it can help you,
Reward Points, if Helpful,
Sandeep Kaushik
09-11-2007 11:15 AM
Hi,
Check this FM:
HR_ECM_ADD_PERIOD_TO_DATE
Import parameters - Value
ORIG_DATE - 11.09.2007
NUM_DAYS - 00
NUM_MONTHS - 03
NUM_YEARS - 00
SIGNUM - -
Export parameters Value
RESULT_DATE - 11.06.2007
IS_OK - X
best regards,
Thangesh
09-11-2007 11:16 AM
HI,
In INITIALIZATION
set sy-datum to high.
use function module <b>RE_ADD_MONTH_TO_DATE</b>
passing date as sy-datum and months as -3
and put the result of this FM to low.
Enjoy SAP.
Pankaj Singh.
09-11-2007 11:17 AM
hi,
Use the Function module <b>'CCM_GO_BACK_MONTHS'</b> ...
With Rgds,
S.Barani
09-11-2007 11:22 AM
Hi Reddy
If you wish to use Function module which satisfy your criteria,then go for
<b>'CCM_GO_BACK_MONTHS'</b>
which ask you the current date i.e.,Sy-datum and go_back_months:000 i.e.,003
it gives you the three months prior to current date or sy-datum.
REWARD IF USEFUL...!
09-11-2007 11:33 AM
Hi Reddy..
Call The FM
MONTH_PLUS_DETERMINE
Pass the Months as -3. and OLDDATE as the Date field.
Then it will return the Date before 3 months.
reward if Helpful.
09-11-2007 11:41 AM
Hi Reddy,
Use the below code.
SELECT-OPTIONS: s_date FOR sy-datum.
INITIALIZATION.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-high = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = sy-datum
days = 0
months = '03'
signum = '-'
years = 0
IMPORTING
calc_date = s_date-low.
APPEND s_date.
Message was edited by:
Velangini Showry Maria Kumar Bandanadham
09-11-2007 11:49 AM
Hi,
You can use ' MONTH_PLUS_DETERMINE' Function module with importing Months = '3' and OLDDATE = '30.06.2007' and output u get NEWDATE as '30.09.2007' as you need.
<b>Please reward points to the helpful answers.</b>
Thanks,
Phani.