Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FM

Former Member
0 Likes
787

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
765
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.
7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
765

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

Read only

Former Member
0 Likes
765

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>

Read only

Former Member
0 Likes
765

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

Read only

Former Member
0 Likes
765

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.

Read only

amit_khare
Active Contributor
0 Likes
765

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

Read only

Former Member
0 Likes
765

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.

Read only

Former Member
0 Likes
766
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.