Skip to Content
author's profile photo Former Member
Former Member

need a function module

Hi Experts,

can you pls help me out in saying

the function module which is used to find the

fiscal year when the date is given.

Thanx in advance

Regards

Rachel

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on Jun 19, 2008 at 05:05 AM

    Hi Rachel,

    Try out with the FM " GM_GET_FISCAL_YEAR"

    &********Reward point if helpful**********&

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:05 AM

    Hi,

    data : a(20).
    
    CALL FUNCTION 'GM_GET_FISCAL_YEAR'
    EXPORTING
    I_DATE = SY-DATUM
    i_fyv = 'V3'
    IMPORTING
    E_FY = a.
    
        * EXCEPTIONS
        * FISCAL_YEAR_DOES_NOT_EXIST = 1
        * NOT_DEFINED_FOR_DATE = 2
        * OTHERS = 3
    
    .
    IF sy-subrc 0.
    
        * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    
    ENDIF.

    Write: a.

    Thanks

    Viktranth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:06 AM

    hi,

    Try,

    GM_GET_FISCAL_YEAR.

    Regards,

    Subramanian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:24 AM

    Hi,

    Try to search any function module in SE37 like in your case

    fiscalyear*

    you can yourself find the required function module.

    In you case you need to use GM_GET_FISCAL_YEAR function module, where in we need to pass date and variable e.g 19.06.2008 and V3.

    This will help you.

    Plz reward if useful.

    Thanks,

    Dhanashri.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:07 AM

    GET_CURRENT_YEAR

    Get the current fiscal year.

    Example:
    
    CALL FUNCTION 'GET_CURRENT_YEAR'
    
      EXPORTING
    
        BUKRS         = '1000'     " Company Code
    
        DATE          = SY-DATUM   " Date to find fiscal year for
    
      IMPORTING
    
        CURRM         = w_currm    " Current Fiscal Month
    
        CURRY         = w_curry    " Current Fiscal Year
    
        PREVM         = w_prevm    " Previous Fiscal Month
    
        PREVY         = w_prevy.   " Previous Fiscal Year
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:08 AM

    Hi,

    check out the FM,

    FKK_FM_GET_FISCAL_YEAR

    GET_CURRENT_YEAR will give u the fiscal year

    Hey also try this FM also

    DATA: I_FYV1 LIKE T009-PERIV.
    
    CALL FUNCTION 'CCODE_GET_FISCAL_YEAR_VARIANT'
    EXPORTING
    
        *
              o COMPANY_CODE = i_billno-bukrs
    
    COMPANY_CODE = S_BUKRS-LOW
    *
    IMPORTING
    FISCAL_YEAR_VARIANT = I_FYV1
    
        * EXCEPTIONS
        * COMPANY_CODE_NOT_FOUND = 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.
    
    
    CALL FUNCTION 'ME_DETERMINE_GJAHR'
    EXPORTING
    
        *
              o I_BSTYP =
    
    I_BEDAT = P_DATE
    I_PERIV = I_FYV1
    IMPORTING
    
        *
              o E_H_MONAT =
    
    E_H_GJAHR = GJAHR1
    
        *
              o E_H_DATUM =

    Thanks

    Vikranth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:09 AM

    Hi,

    To get a date from a given date +/- period. Input : Date & Period (No. of Days) Output : Calculated Date

    Please go through the Function Module "RELATIVE_DATE_CALCULATE". Remember to enter the date in 'yyyymmdd' format in the start date field.

    2.if the days variable is integer and other 2 like sy-datum, the math below yields the number of days to yo..

    start date = '23.07.2003'

    End date = '23.09.2003'

    Days = enddate - Start date.

    3. Please go through the Functions Module , it gives date as well as time difference, though U may have to enter time as well.

    SD_DATETIME_DIFFERENCE

    4. with this FM you can get dates between two dates : Function Module

    RP_CALC_DATE_IN_INTERVAL

    5. go into SE37 and search on 'difference between dates', one of these 3 keywords or a combination between the 3 will give you a function module.

    6. Date Upper & Lower limit: the lower is obviously the 1st of the month. To get the upper use function module END_OF_MONTH_DETERMINE.

    7. to get the logon user setting date dynamically : Using offsets move it into a date field,obviously in the format yyyymmdd. then move it into a char(10) field. U get the data in char(10) using the current user's setting.

    ex:: w_date type d value '20030822',

    w_char(10).

    say logon user setting is mm/dd/yyyy.

    write w_date to w_char. w_char will have the value 08/22/2003.

    You can use the result of the move stmt in bdc table.

    8. Check this FM

    "/SAPDMC/LSM_DATE_CONVERT "

    9.statements:

    1. CONVERT DATE f1 INTO INVERTED-DATE f2.

    2. CONVERT INVERTED-DATE f1 INTO DATE f2.

    Calculates the nine's complement of the internal date format (YYYYMMDD - for more information about internal display, meaning and initial values of types and places it in the field f2.

    For example, 19950511 ==> 80049488 or 80049488 ==> 19950511.

    In the inverse date format, the most recent date has the numerically smallest value. You can make use of this effect when sorting dates.

    10. GET TIME STAMP : returns the timestamp in short or long form. The short form contains the current date and time :

    DATA:

    s_tst TYPE timestamp,

    l_tst TYPE timstampl,

    tzone TYPE timezone.

    GET TIME STAMP FIELD s_tst. "Short form

    GET TIME STAMP FIELD l_tst. "Long form

    tzone = 'UTC '. "Time zone

    WRITE: / s_tst TIME ZONE tzone,

    / l_tst TIME ZONE tzone.

    Then, The short form might then contain the value 19980204163520, while the long form has the value 19980204163520,1234560.

    The time stamp can be converted by using CONVERT TIME STAMP and CONVERT DATE

    Thanks

    Vikranth

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.