Fm to get current + next 3 fiscal months name

hi all,
In my alv report , i need to populate the stock of current fiscal month plus stock for succeeding 3 months.Using fm 'GET_CURRENT_YEAR' i am getting current month details with input sydatum and company code.
But how to get next 3 fiscal months?Is there any fm to do the same?

Hi,
try this:
DATA: PERIOD LIKE T009B-POPER,
      YEAR   LIKE T009B-BDATJ,
      DATE   LIKE SY-DATUM.
DATE = SY-DATUM.
CALL FUNCTION 'DETERMINE_PERIOD'
  EXPORTING
    DATE                = date
    VERSION             = 'K4'
  IMPORTING
    PERIOD              = PERIOD
    YEAR                = YEAR
  EXCEPTIONS
    PERIOD_IN_NOT_VALID = 1
    PERIOD_NOT_ASSIGNED = 2
    VERSION_UNDEFINED   = 3
    OTHERS              = 4.
write: / date, period, year.
  CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
    EXPORTING
      MONTHS  = 1
      OLDDATE = DATe
    IMPORTING
      NEWDATE = date.
CALL FUNCTION 'DETERMINE_PERIOD'
  EXPORTING
    DATE                = date
    VERSION             = 'K4'
  IMPORTING
    PERIOD              = PERIOD
    YEAR                = YEAR
  EXCEPTIONS
    PERIOD_IN_NOT_VALID = 1
    PERIOD_NOT_ASSIGNED = 2
    VERSION_UNDEFINED   = 3
    OTHERS              = 4.
write: / date, period, year.
  CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
    EXPORTING
      MONTHS  = 1
      OLDDATE = DATe
    IMPORTING
      NEWDATE = date.
CALL FUNCTION 'DETERMINE_PERIOD'
  EXPORTING
    DATE                = date
    VERSION             = 'K4'
  IMPORTING
    PERIOD              = PERIOD
    YEAR                = YEAR
  EXCEPTIONS
    PERIOD_IN_NOT_VALID = 1
    PERIOD_NOT_ASSIGNED = 2
    VERSION_UNDEFINED   = 3
    OTHERS              = 4.
write: / date, period, year.
  CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
    EXPORTING
      MONTHS  = 1
      OLDDATE = DATe
    IMPORTING
      NEWDATE = date.
CALL FUNCTION 'DETERMINE_PERIOD'
  EXPORTING
    DATE                = date
    VERSION             = 'K4'
  IMPORTING
    PERIOD              = PERIOD
    YEAR                = YEAR
  EXCEPTIONS
    PERIOD_IN_NOT_VALID = 1
    PERIOD_NOT_ASSIGNED = 2
    VERSION_UNDEFINED   = 3
    OTHERS              = 4.
write: / date, period, year.
Regards, Dieter

Similar Messages

  • How to get Current day and month value in Stk applets

    Friends please provide me the hint to get the Current Value of month and date from the Mobile equipment(ME).
    please send feedback to [email protected]

    Use "PROVIDE LOCAL INFORMATION" command as per GSM 11.14. This however queries the handset date and time, and hence depends on the handset clock (which may not always be reliable).

  • FM to get the previous fiscal month

    Hi All,
    is ther any function module to calculate the previous fiscal month from the sy-datum.
    Tnhanks in Advanc
    Moderator message: date calculation questions = FAQ, please search before posting.
    locked by: Thomas Zloch on Sep 29, 2010 2:28 PM

    Hi,
    Use the FM: RP_CALC_DATE_IN_INTERVAL
    DATA:date1 TYPE sy-datum.
    START-OF-SELECTION.
      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          date      = sy-datum
          days      = '00'
          months    = '04'
          signum    = '-'
          years     = '00'
        IMPORTING
          calc_date = date1.
      WRITE date1.

  • How to get current logged-in user name in data access driver or in universe

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

  • Month Names logic

    Hi,
    I just want to get month names in output.
    If i gives '3' as input it has to display next 3 month names(September,October,November).
    If i gives 6 as input next 6 month names from September to February.
    Thanks,
    fractal.
    REPORT ZTEST2 .
    DATA : lt_month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
      DATA : lv_date LIKE sy-datum ,
             l_month type i,
             l_month2 type i.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005 .
    Parameter: p_month(2).
    SELECTION-SCREEN END OF BLOCK b1 .
    CALL FUNCTION 'MONTH_NAMES_GET'
      TABLES
        MONTH_NAMES                 = lt_month_names
    EXCEPTIONS
       MONTH_NAMES_NOT_FOUND       = 1
       OTHERS                      = 2
      lv_date = sy-datum.
      l_month = lv_date+4(2).
       l_month2 = l_month + p_month.

    Hi fractal,
    Try this code , its just that u need..
    DATA : lt_month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
    DATA : lv_date LIKE sy-datum ,
    l_month TYPE i,
    l_month2 TYPE i.
    DATA: BEGIN OF itab OCCURS 0,
      spras TYPE spras,
      mnr LIKE t247-mnr,
      ktx LIKE t247-ktx,
      ltx LIKE t247-ltx,
      END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
    temp LIKE t247-ltx,
    END OF itab1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005 .
    PARAMETER: p_month(2).
    SELECTION-SCREEN END OF BLOCK b1 .
    SELECT * FROM t247 INTO CORRESPONDING FIELDS OF TABLE itab            " TO GET THE SHORT MONTH NAMES...I.E. MAR FOR MARCH
         WHERE spras = 'E'.
    lv_date = sy-datum.
    l_month = lv_date+4(2).
    DO p_month TIMES.
      READ TABLE itab WITH KEY mnr = l_month.
      IF sy-subrc = 0.
        itab1-temp = itab-ltx.
        APPEND itab1.
      ENDIF.
      l_month = l_month + 1.
      IF l_month > 12.
        l_month = 1 .
      ENDIF.
    ENDDO.
    LOOP AT itab1.
      WRITE : / itab1-temp.
    ENDLOOP.
    Regards,
    Bijal

  • How does BR get current date, user, and associate member with Attribute Dim

    I need use Business rules or Calc script to implement following functions:
    1. Get current date and the name of user who is running the BR and save the information to cube.
    I don't find any functions to get current date and users.
    Also, since text and date is store in relational database and essbase cube only stores the index, it looks that the value can't be changed or stored by using "==" directly, is there any function to change value of members with Text or Date types in BR/Calc script?
    2. End users select attribute value (via smart list) of products or projects(Sparse dimensions) in data form, run BR to update the association of these members with attribute dimension.
    I don't find any functions to change the attribute association in BR/Calc, is there any CDF (Custom Defined Function) that can do it?
    Thanks!

    Hi,
    For the date functionality, check out the post below.
    Re: Days behaviour between two dates
    As for the username, there is a little tricky way that requires an unused or a new dimension along with a smart list of user names. It's also possible to capture the user name from the cookies and pass it on to the form. The latter is possible through validatedata.js however requires hefty coding here and there.
    As for the attributes, it's not possible to update metadata through business rule. So no luck in there.
    Cheers,
    Alp

  • How to get current fiscal year/quarter/month/week

    Post Author: [email protected]
    CA Forum: Semantic Layer and Data Connectivity
    Hi friends,
    I have to calculate
    1. current year/quarter/month/week.
    2.Previous year/quarter/month/week.
    please tell the process to achieve the above scenerio's.
    the structure of the fiscal_cal is as  follows.
    Name                                      Null?    Type
    TODAY                                     NOT NULL DATE
    FISCAL_DAY                                         NUMBER(8)
    FISCAL_WEEK                                        NUMBER(6)
    FISCAL_MONTH                                       NUMBER(6)
    FISCAL_QTR                                         CHAR(18)
    FISCAL_YEAR                                        NUMBER(4)
    FISCAL_MONTH_WORK_DAYS                             NUMBER(2)
    sample week data is as follows
    FISCAL_WEEK
         200752
         200753
         209901
    Thanks.

    based on ur target database DBMS you can find a built-in functions be used in the universe designer to get the requirment you talked about, like in oracle
    to_char(mydate,'yyyy') it will return the year in the yyyy format.
    and the same way for the other things you want
    to_char(mydate,'q') return the quarter.
    w return the week of the month
    ww return the week of the year
    mm return the month
    ,, to get the last year
    you can use also a builtin functions
    like add_months(mydate,-12) that return the same date for the last year, and you can do the same operations as before.
    its all related to the DBMS.
    good luck

  • How to get a Monthly Depreciation Simulation for next fiscal year?

    I need a report that give me the depreciation simulation for next fiscal year, but I need it monthly wise. I run report S_ALR_87012936 with report date 31.12.2011 and evaluation period = month.
    The report gives the error message AA669 Fiscal year 2011 is already closed in Financial Accounting
    I read that this report doesn't work monthly wise for future years. Is there a workarround?
    Best regards!

    Hi,
    I'm sorry there is only RASIMU02. Note 396974 describes, this is a missing functionality and there  is no workaround.
    Reports on derived depreciation areas that do not post any values to the
    general ledger are allowed with the evaluation period year. An
    evaluation using month, quarter or half-year is not supported.
    In general, the depreciation forecasted by monthly in report RASIMU02 are only for depreciation area which posts depreciation to GL. For non-GL posting area, we recommend you simulate the depreciation 
    in 'fiscal year' mode. if you simulate the depreciation 
    Basically RASIMU02 is NOT designed to provide period simulation for these non posting areas. This because RASIMU02 uses for periods which have been posted already the created ANLP. But ANLP´s  are not created for non-posting areas. So in these periods where   a depreciation run had been executed already, RASIMU02 will not show
    values.                                                                               
    For AA 669 please see:
    Best Regards Bernhard
    Edited by: Bernhard Kirchner on Nov 25, 2010 9:20 AM

  • How to get the last day of the current open fiscal period?

    hi folks,
         I  have to display the last date of the current open fiscal period in the selection screen. Its just a display only.
          if there is any function module vailable for getting that period, kindly suggest me?
    thanks in advance,
    cheers,
    Adi.

    hi,
    CALL FUNCTION '/BEV3/CHPERIOD_DETERMINE'
    EXPORTING
    date = sy-datum
    version = c_version
    IMPORTING
    period = l_period
    year = l_fiscal_year
    EXCEPTIONS
    period_in_not_valid = 1
    period_not_assigned = 2
    version_undefined = 3
    OTHERS = 4.
    If not use GM_GET_FISCAL_YEAR
    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
    Rgds
    Anver

  • How to create a formula to get the month name based on userresponse

    Hi,
    I have created a report using E-Fashion - Actually i need  a report like  -  For ex i need 4 months data from 12 months
    My report should display the 4 months data along with starting & end month data in the next 2 columns
    I have used the prompt to fetch the data & i have created a formula in the cloumn like below:
    For the column haader i have given = Tonumber(userresponse("Enter start:")) - I am getting the Month number in the header But i need the month name in the header.Please guide me
    Regards
    Karthika

    Hi Ram,
      Thanks for your Help.I tried in an another way like I created 2 Variable -
    Start Date  =UserResponse("Enter Month(Start):"
    End Date = =UserResponse("Enter Month(End):"
    I have created the column header for
    start date:
    =If([start Date] = "1";"January";If( [start Date] = "2"; "February";If([start Date] = "3";"March";If([start Date] = "4";"April";If([start Date] = "5";"May";If([start Date] = "6";"June";If([start Date] = "7";"July";If([start Date] = "8";"August";If([start Date] = "9";"September";If([start Date] = "10";"October";If([start Date] = "11";"November";If([start Date] = "12";"December"))))))))))))
    End Date:
    =If([End Date] = "1";"January";If( [End Date] = "2"; "February";If([End Date] = "3";"March";If([End Date] = "4";"April";If([End Date] = "5";"May";If([End Date] = "6";"June";If([End Date] = "7";"July";If([End Date] = "8";"August";If([End Date] = "9";"September";If([End Date] = "10";"October";If([End Date] = "11";"November";If([End Date] = "12";"December"))))))))))))
    For the Datas in the column:
    Start Date:
    =[Sales revenue] Where([Month]=ToNumber(UserResponse("Enter Month(Start):")))
    End Date:
    =[Sales revenue] Where([Month]=ToNumber(UserResponse("Enter Month(End):")))
    I got the Report format as i required
    Thanks
    Karthika

  • Function module to get the next new 12 months of a year

    Hi All,
    I have a requirement to get the next new 12 months of a year from the current month , i.e. if my current month is June 2009 , I need to get June 2009, July 2009,...................., May 2010 .
    Does anybody know if there is any function module for this or is there any logic to implement this .
    Please could someone help me out with this.
    Regards,
    Sushanth H.S.

    Dear Srinivas,
    Have a look at the below code. It works fine. Change according to your req.
    REPORT ztest_notepad.
    DATA:
          month_index TYPE i,
          wa_t015m    TYPE t015m,
          it_t015m    TYPE t015m OCCURS 0 WITH HEADER LINE.
    DATA:
          BEGIN OF it_next12 OCCURS 0,
            months_12 TYPE string,
          END OF it_next12.
    PARAMETERS:
          p_month TYPE num2,
          p_year  TYPE num4.
    START-OF-SELECTION.
      SELECT * FROM t015m INTO TABLE it_t015m WHERE spras = sy-langu.
      READ TABLE it_t015m INTO wa_t015m WITH KEY monum = p_month.
      IF sy-subrc = 0.
        month_index = sy-tabix.
        LOOP AT it_t015m INTO wa_t015m FROM month_index TO 12.
          CONCATENATE wa_t015m-monam p_year INTO it_next12-months_12 SEPARATED BY '-'.
          APPEND it_next12.
          CLEAR  it_next12.
        ENDLOOP.
        p_year = p_year + 1.
        LOOP AT it_t015m INTO wa_t015m FROM 1 TO month_index.
          CONCATENATE wa_t015m-monam p_year INTO it_next12-months_12 SEPARATED BY '-'.
          APPEND it_next12.
          CLEAR  it_next12.
        ENDLOOP.
      ENDIF.
      LOOP AT it_next12.
        WRITE:/ it_next12-months_12.
      ENDLOOP.
    Thanks
    Venkat

  • FM to get previous fiscal month/year and calendar month/year for a date.

    Hi All,
    I am having a requirement to extract some data based on either the previous fiscal month/year or the previous calendar month/year. There is no company code input to find the fiscal/calendar month/year.
    At selection screen, user can select either fiscal or calendar selection.
    Based on the selection, the data will be extracted.
    For the system date, we need to calculate previous fiscal month/year or previous calendar month/year and populate the calculated data back to the selection-screen.
    Can you one of you please suggest an FM to find previous fiscal month/year and previous calendar month/year.
    Thanks in Advance,
    Regards
    Gowthami

    Hi Gowthami,
    You can use following function module to calculate previous / next day or month or year.
       call function '/SAPHT/DRM_CALC_DATE'
          exporting
            date      = sy-datum
            days      =
            months    =
            sign      = '-'
            years     =
          importing
            calc_date = .
    Here, you can give '-' to sign, if you want previous day / month / year.
    Here, you can give '+' to sign, if you want next day / month / year.
    And depending upon your requirement, you can pass suitable value to days / month / year.
    e.g. To calcualte last month,
       call function '/SAPHT/DRM_CALC_DATE'
          exporting
            date      = sy-datum
            days      =
            months    = 1
            sign      = '-'
            years     =
          importing
            calc_date = wv_prev_month.
    so it will give '23-01-2008' . Then convert it in the required format as per your requirement using string function concatenate.
    Hope this help you.
    Regards,
    Anil

  • How to get Current Quarter and Fiscal Quarter for a Date - Fiscal Year starts from 1st April

    Hi, 
    I need to calculate current quarter and fiscal quarter in my Sql query.
    I have a column for DateTime Datatype. 
    I need to find out Current Quarter Name like Q12012, Q22012, Q32012, Q42012 and Fiscal Quarter Name as well.
    Now Fiacal Year starts from 1st April, and Current Quarter starts from 1st Jan.
    For Current Quarter of 2012
    Jan-Mar = Q12012
    Apr-Jun = Q22012
    Jul-Sep = Q32012
    Oct-Dec = Q42012
    For Fiscal Quarter of 2012 ( starts from 1st Apr, 2011 )
    Apr2011-Jun2011 = Q12012
    Jul2011-Sep2011 = Q22012
    Oct2011-Dec2011 = Q32012
    Jan2011-Mar2012 = Q42012
    means if its 1st April, 2012,
    its a new Fiacal Year 2013 so Fiacal Quarter Name should be Q12013
    and its Current Quarter Name should be Q22012
    Can you help me to calculate this in a select query for given dates?
    Thanks in advance, 
    Nirav

    This should do it..
    Select
    FORMAT(datepart(quarter,getdate()),'Q#')+FORMAT(getdate(),'yyyy')

  • How to get current tab name or tab id or related info?

    Hi ,
    I would like to hide/show tabs according to users' page privileges list. So I need get current tab ID or tab Name in runtime environment to know if show/hide it for current user. :APP_USER
    Could you please provide any info about this requirement? Or do you have alternative method to control tabs' hide/show?
    thanks
    Ruiping

    最爱用中文 wrote:
    Hi Jari,
    Thanks for your info. Even if set authorize schema to tabs, I still need to get the relationship between "current tab" and "privilege&users". So I think evrm's hard-code method above is avaliable.I agree with Jari: APEX provides Authorization schemes specifically for this purpose. You need to reverse your thinking on how to implement this.
    For more information consult the documentation on APEX security, specifically using authorization schemes to restrict access to pages and control rendering of components.
    Tutorial: Adding Security to your Database Application (APEX 4.0)
    Use Authorization Schemes to control access/rendering for security ("only managers see/access this page and it's associated tab"); and Conditions to control rendering for functional reasons ("region only displayed if account is in arrears").
    Authorization Schemes have the benefits of being reusable, performing better, and allowing central maintenance of security-related code. This makes it easier to change the implementation—say moving from role information held in database tables to groups defined in LDAP.
    I worked for a number of years with an application where authorization schemes are not properly used (decisions made before my involvement) and all security and business logic relating to rendering and processing is wrapped up in spaghetti code in conditions. It's impossible to maintain.
    It is of course advisable to make both authorization scheme and business logic condition code more reusable and maintainable by locating it in API packages.

  • How do I get pictures of my contacts to show next to their name in my messages.

    How do I get pictures of my contacts to show next to their name in my messages app?

    Are your photos burst shots?  And the missing photos part of a burst? Only one of a burst will be uploaded to the photo stream.
    See: http://support.apple.com/kb/HT4486
    Are all of the photos taken with burst mode or image stabilization on my iPhone 5s saved to My Photo Stream?
    No. Only the final photos that you select when using burst mode, and only the final composite image shot with image stabilization are added to My Photo Stream. Learn more about burst mode and image stabilization.

Maybe you are looking for

  • Financial Reporting and substitution variable

    Hello, i have a problem with FR and substitution variable. I create the substitution variable in Essbase for example antYear but i dont'see in dimension layout in FR studio and workspace. Thanks.

  • Special Character Handling (&) in the payload content in PI 7.1

    Hello All, My Scenario is Idoc to File. I need to handle some special characters like "&" in  XML payload content in PI 7.1. I am receiving & character in the text field. eg: <RECORD>    <BEGDA>20100901</BEGDA>    <STAT1>A</STAT1>    <NAME1>Grandview

  • IPad 3G vs iPhone 3G

    Does anyone know why my iPhone will work and my iPad, which is right next to my phone won't?

  • XFCE:Browser won't display Hebrew Fonts

    Hi, I'm on a fully updated Arch-64/XFCE configured for dual EN/HEB keyboard layouts and an English menus/user interface. When typing Hebrew, it will show the Hebrew characters in XCFE terminal. However, using Chromium to browse Hebrew newspapers, it

  • Why does my Macbook memory show full in other

    why does my Macbook memory show full in other