‎2006 Oct 09 3:22 PM
Hi friends,
I want to use this function module three time in my program can you please tell me how to put in form and call it.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '0'
MONTHS = '-6'
START_DATE = so_budat-low
IMPORTING
RESULT_DATE = sdate.
Thanx in advance,
Venu
‎2006 Oct 09 3:34 PM
then do like this
first time
v_months = -1.
perform calculate_date using v_months.
v_months = -6.
perform calculate_date using v_months.
v_months = -12.
perform calculate_date using v_months.
form calculate_date using p_months.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* DAYS = '0'
MONTHS = p_months
START_DATE = so_budat-low
IMPORTING
RESULT_DATE = sdate.
endform.
‎2006 Oct 09 3:24 PM
SOmething like this.
perform calc using s_budat-low sdate.
*---------------------------------------------------------------------*
* FORM calc *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> DATUM1 *
* --> DATUM2 *
*---------------------------------------------------------------------*
form calc using datum1 datum2.
call function 'CALCULATE_DATE'
exporting
* DAYS = '0'
months = '-6'
start_date = datum1
importing
result_date = datum2.
endform.
REgards,
Rich Heilman
‎2006 Oct 09 3:25 PM
declare <b>sdate</b> as global variable
do 3 times.
perform calculate_date.
enddo.
form calculate_date.
clear sdate.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* DAYS = '0'
MONTHS = '-6'
START_DATE = so_budat-low
IMPORTING
RESULT_DATE = sdate.
endform.<b>As both are global variables no need to paas them in perform statement</b>
‎2006 Oct 09 3:25 PM
hi Venu do this way ..
perform val_date using so_budat
changing sdate.
form val_date using so_budat
changing sdate.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* DAYS = '0'
MONTHS = '-6'
START_DATE = so_budat-low
IMPORTING
RESULT_DATE = sdate.
endform.
Regards,
santosh
‎2006 Oct 09 3:26 PM
perform calculate_date using so_budat-low changing sdate.
.
form calculate_date using s_date changing p_date.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '0'
MONTHS = '-6'
START_DATE = s_date
IMPORTING
RESULT_DATE = p_date.
endform.
If u want, you can also other parameters like '-6' in the using.
Regards,
Prakash.
‎2006 Oct 09 3:26 PM
Hi,
Perform calc_date using so_budat changing sdate.
Form calc_date using so_budat type dats
changing sdate type dats.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '0'
MONTHS = '-6'
START_DATE = so_budat-low
IMPORTING
RESULT_DATE = sdate.
endform.
Regards,
Amit
‎2006 Oct 09 3:29 PM
Hi there,
Actually my requirement is I want to get past
one month
six month
one year data from the present date.
Thanx in advance.
Venu.
‎2006 Oct 09 3:34 PM
then do like this
first time
v_months = -1.
perform calculate_date using v_months.
v_months = -6.
perform calculate_date using v_months.
v_months = -12.
perform calculate_date using v_months.
form calculate_date using p_months.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* DAYS = '0'
MONTHS = p_months
START_DATE = so_budat-low
IMPORTING
RESULT_DATE = sdate.
endform.