Calculate "remaining period" from key date and end-of-term

Hello BEx fans
We are reporting on InfoCube 0CFM_C10, Positions for Position Value Date.
http://help.sap.com/saphelp_bw32/helpdata/en/0b/eaf69b46f2304291b9533a15e5fead/frameset.htm
As filter variable we have 0CALDAY which is a key date, showing the positions for position value at the given (key) date.
End-of-term, 0FS_TRME_D, is a navigational attribut of 0CFM_SEC_ID (ID Number of Securities & Futures).
We have the following characteristics for reporting:
0CFM_SEC_ID and 0COMP_CODE
We have some position key figures also for reporting.
Now we would like to calculate the "remaining period" in years which is calculated as ((" 0FS_TRME_D" minus "key date") DIV 360).
The key date is given by the business user when executing the query.
How would you calculate this "remaining period"?
Thanks
BEOplanet

Hi,
As you know that Key date works with Time dependent Master data for that particular data enters by User. This key date is applicable for the entire Query.
If you want to apply some logic like Key Date-1 could be implemented by creating an User Exit variable which takes input as Key date and this will return the required result.
A helpful document for you:----
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
Regards,
Suman

Similar Messages

  • FM to calculate fiscalyear period from current date

    Experts,
    Is there any FM which outputs fiscal year period in the format mmm/yyyy when current date is given as input. I need this coz i want to automatically calculate current fiscalyear period for a query variable..
    Thanks,
    DV

    Hi Edwin,
    When i expand the Fiscalyear Period infoobject in the query design in globval view, i donty see 0F_FPER. Does that mean it has to activated from Business Content? Or can i create a variable like that one??
    DV

  • Function Module for calculating NEXT MONTH's start date and End date

    Hi Friends,
    I want a function module which could calculate the next months start date and end date...
    Say my input will be like 01.01.2006(start date) it should return
    01.02.2006 and 28.02.2006...
    IS there any FM for this ... or how to go about this scenario ???
    thanks in advance
    Cheers,
    R.Kripa

    Hi kripa,
    1. There is no DIRECT Way.
    2. We have to do in 2 steps.
    3. See this code (just copy paste in new program)
       U can use its FORM anywhere in your program,
       for getting the desired dates.
    4.
    REPORT abc.
    DATA : sdate TYPE sy-datum,
           edate TYPE sy-datum.
    PARAMETERS : dt TYPE sy-datum DEFAULT sy-datum.
    PERFORM getdt USING dt sdate edate.
    WRITE :/ sdate , edate.
    INDEPENDENT FORM
    FORM getdt USING orgdate stdate enddate.
      DATA : mydate TYPE sy-datum.
      CALL FUNCTION 'HR_PSD_DATES_ADD_MONTHS'
        EXPORTING
          v_date             = orgdate
          V_MONTHS           = 1
       IMPORTING
         E_DATE             = mydate
       EXCEPTIONS
         NOT_POSITIVE       = 1
         OTHERS             = 2
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = mydate
        IMPORTING
          ev_month_begin_date = stdate
          ev_month_end_date   = enddate.
    ENDFORM.                    "getdt
    regards,
    amit m.

  • How to get starting date and ending date of the given Fiscal Period

    Hi Friends,
    In my Selection screen parameter, I've Fiscal year and Period , I want to get the starting date and ending date with the Fiscal period.
    How to get and throught which FM.
    Pls advise.
    thanks&regards
    Sankar.

    Hello Sankar,
    Check the FM PERIOD_DAY_DETERMINE.
      DATA :
             l_periv     TYPE periv,
             l_blart     TYPE blart,
             l_fday     TYPE bkpf-budat,      "First day in period
             l_lday     TYPE bkpf-budat.      "Last day in period
    * Fetch the fiscal year variant from T001
      SELECT  SINGLE periv  INTO TABLE l_periv
      FROM t001
      WHERE bukrs EQ p_bukrs.
    * Get first day/last day
          CALL FUNCTION 'PERIOD_DAY_DETERMINE'
            EXPORTING
              i_gjahr              = p_gjahr
              i_monat              = p_monat
              i_periv              = l_periv
            IMPORTING
              e_fday               = l_fday
              e_lday               = l_lday
            EXCEPTIONS
              error_period         = 1
              error_period_version = 2
              firstday_not_defined = 3
              period_not_defined   = 4
              year_invalid         = 5
              OTHERS               = 6.
    Hope this helps.
    BR,
    Suhas
    Edited by: Suhas Saha on Jan 9, 2009 2:08 PM

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • How to derive Budget Period from Delivery date in PR/PO

    Hello Gurus,
    I have activated the Budget Period functionality in FM (BCS). I am deriving the budget period from Posting date but in case of PR/PO I want to derive it from Delivery date instead of Document/Posting Date.I know it is not possible while standard derivation. Could any one help me with some suggestion like if I can use some exit/BaDI in MM. Also I am creating a PM order and at the time of release of PM order system creates the PR in background hence I need to know some kind of exit/BADI which can be called to update the Budget Period field in PR.
    Thanks in Advance!
    Regards
    Rohit Goel

    Hello Eli,
    I have one more query to ask on the above scenario.
    The scenario is my delivery date in PO is say July but I did good issue in May hence the Budget Period should be May and not july in my GR and IV.
    Now when I am doing GR in May then system is showing the Budget Period as July in GR document but in FM Document it is populating as May. I have defined a derivation strategy to derive budget period from posting date so may be because of that.
    But when I am doing IV then it is again moving the amount from May to July. It may be right behaviour that system is deriving all the account assignment from Source document but is there any way to overwrite.
    I have defined the derivation strategy with the condition that overwrite with new value if already written (Deriving from Posting Date to Budget Period).
    Please guide me on this if possible.
    Thanks in Advance
    Regards
    Rohit

  • To get first date and end date after entering any month and year

    Hi,
    I need to to get first date and end date of a month and year in yyyyMMdd format. I am reading month and year from a properties file. But I don't know how to get the first date and End date in given format. The properties file gives me just text. But I don't know how to get the date format using this. I need this urgently. Can anyone help me to get code for this?
    I am reading the fields as,
    Properties props = new Properties();
    props.load(new FileInputStream("AnyMonthVolume.properties"));
    String date_month = props.getProperty("date_month");
    String date_year = props.getProperty("date_year");
    Thanks.

    I know this has been posted a while ago but incase someone looking for it, here is the code to get the end of current month date.
    Calendar cal = Calendar.getInstance();
         cal.setTime(new java.util.Date());
         cal.set(Calendar.DATE, 1); //set the date to start of month
         cal.add(Calendar.MONTH,1);
         cal.add(Calendar.DATE,-1);
    System.out.println(cal.getTime());

  • How to display absence start date and end date in workflow notification?

    Hi,
    I would like to display the absence start date and end date at
    1) Subject of workflow email notification/worklist notification OR/AND
    2) Content of workflow email notification/worklist notification.
    Appreciate if anyone can advise on this as this information is very crucial to our client.
    Thank you.
    Regards,
    Shiau Chin, Teo

    1) Subject of workflow email notification/worklist notification OR/ANDyou have to customize the subject of notification message. You can find the message using following query.
    SELECT message_type, message_name
       FROM wf_notifications notif
      where notification_id = <your notification>;> 2) Content of workflow email notification/worklist notification.
    its already there I think.

  • Gettings Fiscalyear period from Billing date code required

    Hi All,
    my requirement is to get FISCAL YEAR PERIOD from Billing Date .Can any one send me the code to be written in transformation.
    Thanks in advance

    Hi ,
    Please use the function module DATE_TO_PERIOD_CONVERT.
    Give your billing date under I_DATE and Fiscal variant under  I_PERIV (for eg 10).
    This will gove you the posting period and fiscal year .Now concatenate year and posting period to get fiscal period.
    Below is the sample code
    call function 'DATE_TO_PERIOD_CONVERT'
        exporting
          i_date                      = Billing date
          i_periv                     = Fiscal varinat
        importing
          e_buper                     = lv_period
          e_gjahr                     = lv_year
        exceptions
          input_false                 = 1
          t009_notfound               = 2
          t009b_notfound              = 3.
      if sy-subrc = 0.
          ls_time-fiscper(4)      = lv_year.
        ls_time-fiscper+5(2)    = lv_period.
    endif.
    This will solve your problem.
    -Vikram

  • How Do I Filter a Report Using a Multi Select List Box and Specifying Date Between Begin Date and End Date

    Hope someone can help.  I have tried to find the best way to do this and can't seem to make sense of anything.  I'm using an Access 2013 Database and I have a report that is based on a query.  I've created a Report Criteria Form.  I
    need the user to be able to select multiple items in a list box and also to enter a Begin Date and End Date.  I then need my report to return only the records that meet all selected criteria.  It works fine with a ComboBox and 1 selection but can't
    get it to work with a List Box so they can select multiple items.  Any help is greatly appreciated while I still have hair left. 

    The query should return all records.
    Let's say you have the following controls on your report criteria form:
    txtStart: text box, formatted as a date.
    txtEnd: text box, formatted as a date.
    lbxMulti: multi-select list box.
    cmdOpenReport: command button used to open the report.
    The text boxes are used to filter the date/time field DateField, and the list box to filter the number field SomeField.
    The report to be opened is rptReport.
    The On Click event procedure for the command button could look like this:
    Private Sub cmdOpenReport_Click()
    Dim strWhere As String
    Dim strIn As String
    Dim varItm As Variant
    On Error GoTo ErrHandler
    If Not IsNull(Me.txtStart) Then
    strWhere = strWhere & " AND [DateField]>=#" & Format(Me.txtStart, "yyyy-mm-dd") & "#"
    End If
    If Not IsNull(Me.txtEnd) Then
    strWhere = strWhere & " AND [DateField]<=#" & Format(Me.txtEnd, "yyyy-mm-dd") & "#"
    End If
    For Each varItm In Me.lbxMulti.ItemsSelected
    strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    Next varItm
    If strIn <> "" Then
    ' Remove initial comma
    strIn = Mid(strIn, 2)
    strWhere = strWhere & " AND [SomeField] In (" & strWhere & ")"
    End If
    If strWhere <> "" Then
    ' Remove initial " AND "
    strWhere = Mid(strWhere, 6)
    End If
    DoCmd.OpenReport ReportName:="rptMyReport", View:=acViewPreview, WhereCondition:=strWhere
    Exit Sub
    ErrHandler:
    If Err = 2501 Then
    ' Report cancelled - ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    If SomeField is a text field instead of a number field, change the line
            strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    to
            strIn = strIn & "," & Chr(34) & Me.lbxMulti.ItemData(varItm) & Chr(34)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Search on basis of start date and end date

    Hi,
    I have added two fields 'Start Date' and 'End Date' on a search page.
    I have done the VO extension also.
    Now, I have to implement search logic to get all the records created in between 'Start Date' and 'End Date' after pressing the 'GO' button on that page.
    Can anyone please provide guidance to extend the controller.
    Thanks in advance.
    Gaurav.

    Hi Anil,
    Thanks for ur reply.
    As per the link, I have written following code in the controller :
    package oracle.apps.irc.vacancy.webui;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean;
    public class xxVacancyCriteriaCO extends VacancyCriteriaCO
    public xxVacancyCriteriaCO() {}
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    // Pressing the Go button causes the search to be executed.
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OAViewObject oaviewobject = (OAViewObject)am.findViewObject("XXIrcVacancySearchCriteriaVO");
    if (pageContext.getParameter("Go") != null)
    String created = pageContext.getParameter("ViewDate");
    oaviewobject.setWhereClauseParam(0, created);
    oaviewobject.executeQuery();
    OAAdvancedTableBean table = (OAAdvancedTableBean)webBean.findChildRecursive("ResultsTable");
    table.queryData(pageContext, false);
    But while compiling it, I am getting the error as :
    "Error(14,42): PerTransactionTopCOImpl not found in class oracle.apps.irc.common.webui.IrcOAControllerImpl in class oracle.apps.irc.vacancy.webui.VacancyCriteriaCO in class oracle.apps.irc.vacancy.webui.xxVacancyCriteriaCO"
    Can u please suggest where the mistake is?
    Thanks again.
    Gaurav.
    Edited by: Gaurav on Jan 14, 2011 12:51 AM

  • Function module to find start date and end date of fiscal year for company

    Hi,
    Is there any function module exist which will provide me start date and end date of fiscal year for company code and fiscal year provided?
    Thanks & Regards,
    Parag

    Hi,
    please check this link
    it would be very useful
    http://www.sapdevelopment.co.uk/fmodules/fms_fiscalyr.htm
    Thanks and regards
    durga.K

  • Org.Assignment Infotype start date and End date is getting wrong.

    Hi, When i create a new employee in PA40, in Org. Assignment infotype start date and end date is getting wrong. for eg. When i create an employee on 01.04.2014.    In org. assignment infotype its getting like this. 01.01.2014  to  31.03.9999  and 01.04.9999 to 31.12.9999  Two date entries are creating by default.

    Hi
    Check in the Table - T588Z : Dynamic Actions ,is there any custom routines causing the defaulting dates functionality.
    Thanks,
    Sreeram

  • Modelling Time Dimension with Fact Table containing Start Date and End Date

    Hi Gurus,
    I have a time dimension with Year till Date. I have a fact table which consists of Start Date, End Date, Person ID, Department ID.
    How do i design Time dimension with fact table the below scenario
    In the dashboard i have start Month and End month as prompts.
    In the report i need to display Count(Person ID) > Start Date and < End Date along the trend.
    For instance, i have selected Jan-2009 as start date and Apr-2009 as End Date, then i need to display Count(Person ID) of Jan-2009, Feb2009, Mar-2009 andApr-2009.
    I Can not connect Time dimension with only Start Date or only with End Date to get the trend along the months.
    Please advice on the issue which i am having.

    Hi,
    Thanks for the response, Infact i tried using Complex join in physical layer. I have considered Time table joined with Fact table, and used >= and took and alias of the Time table and joined fact table using <=. When coming to BMM, i am not knowing how do i design this as if i merge the both the time dimensiona and its alias into single table, values will not be correct and if i make them as seperate columns. i can not show the trend as both are different columns.
    Can you please let know where i am going wrong.
    Thanks

  • How to create start date and end date

    Hi guys
    Need to create start date and end date as prompt in webi report.... how could it be possible please help me ...
    regards

    @Universe:
    Go to Condition/Filter:
    Definition: Date=@Prompt("Select Start Date",D,,mono/multi,free/constrained,...)
    OR @Select(Class\Object Date)=@Prompt("Select Start Date",D,,mono/multi,free/constrained,...)
    Parse it & Apply OK.
    Class/Object : If you have already object Date in any class already, use them.
    Follow the same for End date also.
    For both filters/prompts, check Apply on Universe
    @Report/Query:
    Drag [Date] object to Query filters section and in Operand say Prompt. Change text as Select Start Date & again drag [Date], this time say Select End Date.
    Hope it helps you alot.
    Gracias...!!

Maybe you are looking for

  • FF crashes

    FireFox crashes as soon as I try to open it. I have found a critical error (below) and would like to know if it is the cause, and if it is, how do I fix it? Thanks. Log Name: System Source: Microsoft-Windows-Kernel-Power Date: 31/01/2014 12:30:54 Eve

  • Issue with 2LIS_11_VAITM

    Hi, we are extracting sales related information from ECC through 2LIS_11_VAHDR & 2LIS_11_VAITM  to the BW Evironment. but last few delta runs we are missing new/chanaged records from the VBAK/VBAP. I am not able to understand why we are missing these

  • Many sockets to choose from, which is the right one?

    Using Pavillon T279, with XP Home sp3. I have, for many years, tried to explore which socket on the computer's front corresponds to the "moveable discs" when right clicking "my computer" : There are several to choose from. My problem is as follows: I

  • Exporting to textile/html file

    Hi everyone..I'm sorta new to this java thing..been working on it for a year or so now..and right now im working on this little project where I search a web crawler file and return a string array of results into list in a GUI I made. What I basically

  • AFAB - Ordinary Depreciation Distribution Cost Centre wise

    Dear All I need to distribute ordinary depreciation values for each cost center wise in GL. I have setup, 1.  Cost Centers in Asset Masters 2.  Create GL account with cost element without assigned default cost center 3. ACSET configuration for Cost C