Application Development 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: 

I have a requirement to pass a variable in function module

0 Kudos
162

in function module , i need to pass months

CALL FUNCTION 'FIMA_DATE_CREATE'

       EXPORTING

         i_date                  = sy-datum

*       I_FLG_END_OF_MONTH      = ' '

*       I_YEARS                 = 0

     I_MONTHS                =  (  6 months )

*       I_DAYS                  = 0

*       I_CALENDAR_DAYS         = 0

*       I_SET_LAST_DAY_OF_MONTH = ' '

       IMPORTING

         e_date                  = lv_date

*       E_FLG_END_OF_MONTH      =

*       E_DAYS_OF_I_DATE        =


In I_months i need to export 6 months , how can i do that .


i tried lv_month = sy-datum - 6 , its not working .


can any one help me to do .

please


Thanks in advance

5 REPLIES 5

Former Member
0 Kudos
113

Hi,

If i understood correctly , you need to know what will be date after exactly 6 month .

In the FM . I_MONTHS defined as like VTBBEWE-ATAGE which inturn INT4 datatype (Double click)

Either you directly pass value as 6 directly as below  or declare variable like data : w_month type INT4 value '6' .Pass that w_month to  FM.

CALL FUNCTION 'FIMA_DATE_CREATE'

     EXPORTING

       i_date                  = sy-datum

      i_months                = 6 " w_month

    IMPORTING

      e_date                  = lv_date.


Apology   If i misunderstood the question.


thanks,

aRun

Abhijit74
Active Contributor
0 Kudos
113

Hello,

You just pass 6 then it will add 6 months and if you give 6- it will less 6 months.

Just run your function module in SE37 and check with month.

Thanks & Regards,

Abhijit

thanga_prakash
Active Contributor
0 Kudos
113

Hello Sridevi,

Make use of an offset like below.

TYPE-POOLS:TRFF.

DATA: date LIKE VTBBEWE-DVALUT,

       month1 TYPE TRFF_FLG,

       date1 TYPE TRFF_TYPE_N_2,

       months LIKE VTBBEWE-ATAGE.

months = SY-DATUM+4(2).

CALL FUNCTION 'FIMA_DATE_CREATE'

   EXPORTING

     i_date                        = sy-datum

*   I_FLG_END_OF_MONTH            = ' '

*   I_YEARS                       = 0

    I_MONTHS                      = months

*   I_DAYS                        = 0

*   I_CALENDAR_DAYS               = 0

*   I_SET_LAST_DAY_OF_MONTH       = ' '

  IMPORTING

    E_DATE                        = date

    E_FLG_END_OF_MONTH            = month1

    E_DAYS_OF_I_DATE              = date1.


Regards,

Thanga

thanga_prakash
Active Contributor
0 Kudos
113

Hello Sridevi,

If you are looking for the requirement where you want to go back 6 months from the date entered.

Refer to the below link. I guess we have already discussed this in below forum.

Regards,

Thanga

0 Kudos
113

Thank u all