Current Month, Current Year Variable on Posting Date

Hi,
I need to construct a BEx variable that will return the Current Month of the Current Year based on Posting Date. I want to be able to compare Current Month of the Current Year with Current Month of the Prior Year. I know SAP delivers variables for this based on 0CALMONTH. Is there any way to create the variable off Posting Date without having to write a customer exit?
Thanks,
C

I guess you could use replacement path variables for the same. No need to write customer exits.
Create 2 variables, one on calmonth and the other on calyear.
Variable on Calmonth -
type - replacement path.
Replacement path tab - repace with variable, give variable name into which user enters the posting date, replace with key, offset start 2 and offset length 2.
Variable on calyear -
type - replacement path.
Replacement path tab - repace with variable, give variable name into which user enters the posting date, replace with key, offset start 4 and offset length 4.
to get key figures for current month and previous year, restrict the key figure with calmonth variable created above and use offset on the calyear variable created above, like zcalyear - 1.

Similar Messages

  • Expression - First date and last date of current month, current year

    Hi
    I need to have 2 ssrs expression as I can use  as default parameters in my report where I can -  out from my Time dimension, get the
    first date of the current, current year - and one where I get last date, current month, current year.
    My data source is a SSAS cube and my timedimension is structured like this:
    [Time].[Days].&[2009-01-16T00:00:00]
    Any suggestions how to solve this ?

    Hi ,
    You can use below in Default Values in ssrs ;
    for first Day of current month and year
    ="[Time].[Days].&[" +Format(dateadd("m",0,dateserial(year(Today),month(Today),1)), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-01T00:00:00]
    For last day of current month and year
    ="[Time].[Days].&[" +Format(DateSerial(Year(Now()), Month(Now()), "1").AddMonths(1).AddDays(-1), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-30T00:00:00]
    Please correct me if I misunderstood your requirement.
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.

  • UIX 2.1.21: Date OnBlurValidator automatically add current month or year?

    Would be nice if the OnBlurValidator for a UIX Date field could automatically add a missing month or year.
    e.g. Format dd.mm.yyyy
    When the user enters 01.01. the current year could be added automatically.
    Or when the users only enters 01. the current month and year could be added.
    Would be a nice feature additionally to the already existing lenient-date-formats = true.
    Really great would be to allow entering values like "now" / ".", "yesterday" / "-" or "tomorrow" / "+" that are evaluated to the according dates (of course internationalized).
    Thanks, Markus

    hey mill1640,
    Did you ever get your iPhone to register with iTunes? I just upgraded as well to Snow Leopard, and my my isn't recognized at all also.
    If you did get this resolved, I would appreciate a little suggestion in the right direction.
    Many thanks,
    Josh

  • How to get the current month for a variable based on info object 0FISCPER3

    Hie Gurus
    I am working on the financial reports i am failing to derive the Current month from the variable based on infobject 0FISCPER3 PERIOD .
    I would also like to get the same month from the prevoius year. Any ideas?

    If I understood correctly, you need in your repot
    Current Month Plan This year || YTD Plan This Year || Current Month Plan Last Year || YTD Plan Last Year
    Your variable 0I_FISCPER3 must be on the object 0FISCPER3 which is nothing but just the Fiscal Period. This variable is a user entry mandatory Interval variable.
    if you are entering a range in the input screen for this variable, you will get cumulative values. If you just need to get the value for a month in first column your report, you will have to create another variable of type Customer Exit which will read the "To value" entered for the variable 0I_FISCPER3 and columns for Current Month should be restricted on this variable.
    if you are entering a single value in the selection screen of this variable, current month column should be restricted on this variable with "Equal To" operation and YTD colmns should be restricted to "Less Than Equal to" operator with this variable.
    0FISCPER3 just have posting period and not year, so you will have to use varialbes for 0FISCYEAR separately.
    Please let us know if it helps or if you are using some other variable based on 0FISCPER3 or 0FISCPER.
    Regards,
    Gaurav

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

  • Query for fiscal month till current month of year

    Hi,
    can you please help me to show only fiscal months till current month of year?
    e.g. Current month is Apr of 2012.
    I have to show the fiscal months till the Apr 2012 of year 2012.
    if the date is 24th of Apr then it would show May month also.
    Regards,
    Nilesh

    with t as (
    select to_date('04232012','MMDDYYYY') d from dual union all
    select to_date('04252012','MMDDYYYY') from dual)
    select
    d,
    case
    when to_char(d,'DD') >= 24 then
    to_char(trunc(add_months(d,1),'MONTH'),'MM-YYYY')
    else
    to_char(d,'MM-YYYY')
    end fin_month
    from t
    D     FIN_MONTH
    23.04.2012     04-2012
    25.04.2012     05-2012

  • First day of current month, one year ago

    All,
    Does anyone have a calculation or know how I can calculate the first day of the current month, one year ago? I am trying to setup a filter criteria to show all records created >= 1st day of current month for prior year and <= the last day of the prior month. I have the second half of the equation for last day prior month but need some help on the first half.
    Thanks in advance for any pointers!
    D

    You can try:
    SELECT TRUNC(ADD_MONTHS(sysdate, -12), 'MON') FROM dual;
    Or
    SELECT TRUNC(sysdate-NUMTOYMINTERVAL(1,'YEAR'), 'MON') FROM dual;

  • Find month and year of a given date

    Hi,
    How to find the month and year of a given date.
    month ( sy-datum)  year ( sy-datum )
    --Bala

    hi
    DATA: EDAYS LIKE VTBBEWE-ATAGE,
    EMONTHS LIKE VTBBEWE-ATAGE,
    EYEARS LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
    TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    Call Function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.
    Using teh abiove u can get difference but when u pass previous year u wont get the exact.
    There is no seperate FM for this, u have to use three FM.
    If possible using these three FM code u can create an FM.
    For years and months between two days:
    DATA:   EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE PREL-BEGDA,
                     TODATE   LIKE PREL-BEGDA DEFAULT SY-DATUM.
    CALL FUNCTION 'COMPUTE_YEARS_BETWEEN_DATES'
      EXPORTING
        first_date                        = fromdate
      MODIFY_INTERVAL                   = ' '
        second_date                       = todate
    IMPORTING
       YEARS_BETWEEN_DATES               =  EYEARS
    EXCEPTIONS
      SEQUENCE_OF_DATES_NOT_VALID       = 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.
    Write:/ eyears.
    DATA:       EMONTHS LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE SY-DATUM,
                TODATE   LIKE SY-DATUM
    DEFAULT SY-DATUM.
    CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis         = fromdate
        i_datum_von         = todate
      I_KZ_INCL_BIS       = ' '
    IMPORTING
       E_MONATE            = emonths
    write:/ emonths
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    I_DATUM_BIS = x_faede-zfbdt
    I_DATUM_VON = p_fdat
    I_KZ_EXCL_VON = '0'
    I_KZ_INCL_BIS = '0'
    I_KZ_ULT_BIS = ' '
    I_KZ_ULT_VON = ' '
    I_STGMETH = '0'
    I_SZBMETH = '1'
    IMPORTING
    E_TAGE = dias_v.
    IF SY-SUBRC <> 0.
    ENDIF.
    x_faede-zfbdt -> 20050915
    p_fdat -> 20050811
    dias_v = 4
    try this and let me know.
    regards
    ravish
    <b>plz dont forget to reward useful points</b>

  • Variable on post date

    Hi,
    I have the following record
    Comp code     Post date      Amount
    1000              20.10.2010   2000
    I have a variable on post date and I entered 01.01.2011, then output should be like this
    Comp code    post date      Amount(<=30days)   Amount(<=60days)    Amount(<=90days)
    1000             20.10.2010                                                                    2000
    Difference between entered date 01.01.2011 and post date 20.10.2010 gives you 71 days. So amount should come under 3rd column in the output.
    What to do and where to do to get this kind of output.
    Please help me...

    Hi Samar,
    For this first create 2 formual variables
    1) create a formula variable on posting data
    2) Create one more fromula variable with processing type cusomer exit and implement the logic using i_STEP=2.
    Create a CKF -- which calculates the difference of days.
    using this CKF u can create selection which calculates the buckets
    if diff of days <=30 *KF and so on.
    Check the below link
    [Ageing report -buckets split|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f15839-0cf1-2b10-c6a7-ebe68cc87cdc?QuickLink=index&overridelayout=true]
    Regards
    KP

  • Current Month & Current Year Sales

    hi,
      How to get current month sales & previous month sales if sales measure is available for 2 years. I would like to display current month sales in one column and previous month sales in the second column and difference in the next column. For example, if i take this month as the current month, i have to display march sales in first column, february sales in second column and difference in third column. If you take a query designer, we restrict by month and display that month's value. Please advise.
    Thanks in advance.

    Hi
    create two variables in your WebI report containing if then clauses which restrict your key figures to the actual (or previous) month. Use those variables instead of your key figure directly.
    (NOTE: THIS IS PSEUDO CODE):
    if [0CALMONTH]=CurrentMonth then [KeyFigure1] else 0
    if [0CALMONTH]=PreviousMonth then [KeyFigure1] else 0
    The third column can contain the difference between the first two variables.
    Regards,
    Stratos

  • How to get Current month last year sale in report

    HI,
              I would like to compare the sale value of a  month for any year.
    ie sale of the march month for this year ,previous year and a year before ..like that
    at least for two years..ie current and prvious year.
    how can i get it done in query?
    thnx

    Create three restricted key figures.
    In one restrict month by current month.
    In other use offset of -12 and -24 while restricting current month.

  • Show current month's calendar based on computer date

    As a page loads, is it possible to check the computer date
    and display the current month's calendar (specialized with events),
    either on the same page or on a separate page?
    Any help would be appreciated,
    Cliff

    You can adapt this script to do that:
    http://www.valleywebdesigns.com/vwd_csscalhelp/vwd_csscalhelp_faq.asp#a5
    cliff man wrote:
    > As a page loads, is it possible to check the computer
    date and display the
    > current month's calendar (specialized with events),
    either on the same page or
    > on a separate page?
    > Any help would be appreciated,
    > Cliff
    >
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • How to get the currrent month and year from a new date object

    If I create a new Date object as "d",
    java.util.Date d = new java.util.Date();how can I format the date to get the current Month as 'Jan' and the current year as '2008'. So if I have something like d.getMonth() gets the current month as 'Oct' and d.getYear() gets '2008'
    Thanks,
    Zub

    [Read the flamin' manual you must. Hmm.|http://en.wikipedia.org/wiki/RTFM]
    ~~ Yoda.
    Well no actually, he didn't say that, but he should have.
    Cheers. Keith.
    PS: Don't say that to a 7 foot pissedOff wookie when he's got his head stuck in a smoking hyperdrive, and you're being chased by a S-class battle cruiser... Ask Yoda how he got to be so short.
    PPS: It is the SimpleDateFormat you seek ;-)
    Edited by: corlettk on 14/10/2008 22:37 ~~ Also far to slow... but funny.

  • How to get Week,Month and Year details from a date column

    Hi frenz,
    I've a column like tran_date which is a date column..... I need the next week details based on this column and so on...
    I need month and year details as well based on this tran_date column.... can any one tell me how...
    Thanks in advance

    My example for objects:
    create or replace type date_object as object
      centure number,
      year    number,
      month   number,
      day     number,
      hour    number,
      minute  number,
      second  number,
      daypart number,
      week    number,
      constructor function date_object(p_dt date)
        return SELF as result
    create or replace type body date_object is
      constructor function date_object(p_dt date)
        return SELF as result
      as
      begin
        SELF.centure:= trunc(to_char(p_dt,'YYYY')/100);
        SELF.year:=    to_char(p_dt,'YYYY');
        SELF.month:=   to_char(p_dt,'MM');
        SELF.day:=     to_char(p_dt,'DD');
        SELF.hour:=    to_char(p_dt,'HH24');
        SELF.minute:=  to_char(p_dt,'MI');
        SELF.second:=  to_char(p_dt,'SS');
        SELF.daypart:= p_dt-trunc(p_dt,'DD');
        SELF.week:=    to_char(p_dt,'IW');
        return;
      end;
    end;
    select date_object(sysdate),
           date_object(sysdate).year
    from dual;Regards,
    Sayan M.

  • Problem to insert only month and year instead of full date

    select b.penjara_id, p.penj_lokasi, a.no_daftar, b.episod, b.nama1,to_char(a.trkh_mula_prl,'dd/mm/yyyy') as trkh_mula_prl, to_char(bulan_proses,'mm/yyyy') as bulan_proses,
            b.epd, b.lpd
    from prl_daftar_proses a, senarai_pesalah b, penjara p
    where a.no_daftar=b.no_daftar
    and a.episod=b.episod
    and b.penjara_id = p.penjara_id
    and a.setuju_jplp is null
    and a.bulan_proses between to_date(:FROM,'dd/mm/yyyy') and to_date(:TO,'dd/mm/yyyy')
    order by b.penjara_id, a.bulan_proses,a.no_daftarHi,anyone can help me how i can insert only month and year from the value that have full date in the database??
    for example,the date is 09/18/2012, but i just want to insert 09/2012 as parameter. If i want to insert only one parameter, i can do that..But i have problem when I want to insert two parameters..

    jeneesh wrote:
    Welcome to the forum..
    This..?
    Assuming bulan_proses is a date without time part
    select b.penjara_id, p.penj_lokasi, a.no_daftar, b.episod, b.nama1,to_char(a.trkh_mula_prl,'dd/mm/yyyy') as trkh_mula_prl, to_char(bulan_proses,'mm/yyyy') as bulan_proses,
            b.epd, b.lpd
    from prl_daftar_proses a, senarai_pesalah b, penjara p
    where a.no_daftar=b.no_daftar
    and a.episod=b.episod
    and b.penjara_id = p.penjara_id
    and a.setuju_jplp is null
    and a.bulan_proses between to_date(:FROM,'mm/yyyy') and last_day(to_date(:TO,'mm/yyyy'))
    order by b.penjara_id, a.bulan_proses,a.no_daftar
    i got another problem..
    before that.may i know what is the function of last_day?

Maybe you are looking for

  • Cost Center Authorization

    Dear Friends / Experts We have around 10 HR (BW/BO) reports. All are woking fine. Now the users wants to restrict the report based on cost center. Hence, I have created one DSO with relevent information and extracted the data from ECC ( Used id, Cost

  • In report in one colum month data in another colum YTD toal required

    Dear All,               Please can anybody help me,it is important for me                 There is a requirement as below when the user enters the value in varible screnn for some month (like april09) the the report will be in one column january09to

  • Why is the download "Not applicable" for my online purchase of Adobe Captivate 8 Student and Teacher Edition for Mac?

    I purchased "Adobe Captivate 8 Student and Teacher Edition" for Mac on 7/31/14 and it is now 12/17/14 (only 5 months later) but it is showing as "Not applicable" when I go to download (maybe re-download) the program. I understood that I would be able

  • Controlling model questions

    Dear SAP Guru's, Kindly provide me Controlling Model Question papers. My Controlling cetificqation is on 26th June. Removed by Moderator Humbly request you to help me. Thanks Deepak Edited by: Lakshmipathi on Jun 20, 2010 7:33 PM Dont deviate the for

  • Help with 8008 Error

    I have done the whole removing downloads folder and all that but sadly it still comes up with app games I want to download. It includes Tap Tap 4 which i really want but pops up with the error when it finishes downloading :/ I really want this sorted