For selection parameter the default date should be of the previous month.

Hi all,
In my selection-screen what i want is  for the selection parameter "Selection period month" the default value to be the previous month.
For example today is 24.09.2008 so the default value of this field has to be 200808 instead of 200809 today.
please tell me how should i do this.
thanks in advance.

Hi,
Check the following code:
data: f_date type sy-datum,
      f_dd(2) type c,
      f_mm(2) type c,
      f_yyyy(4) type c,
      f_pdt type sy-datum.
parameters: p_date like sy-datum.
initialization.
f_date = sy-datum.
f_dd = sy-datum+6(2).
f_mm = sy-datum+4(2) - 1.
f_yyyy = sy-datum+0(4).
if f_mm eq 0.
concatenate f_yyyy '12' f_dd  into f_pdt.
elseif f_mm eq 1 or
   f_mm eq 2 or
   f_mm eq 3 or
   f_mm eq 4 or
   f_mm eq 5 or
   f_mm eq 6 or
   f_mm eq 7 or
   f_mm eq 8 or
   f_mm eq 9.
concatenate f_yyyy '0' f_mm f_dd  into f_pdt.
else.
concatenate f_yyyy f_mm f_dd  into f_pdt.
endif.
p_date = f_pdt.
start-of-selection.
write : / f_date,
         / f_pdt.
Regards,
Bhaskar
Edited by: Bhaskar Chikine on Sep 24, 2008 12:49 PM

Similar Messages

  • MDX calculation based on date logic for the Jan 1 of current year through the 15th of the previous month

    Hello, 
    We need some help with an SSAS MDX query based on date logic. One of the problems is that I don't have access to the Cube but have been given a query example with the logic needed for the calculation. Here's the scenario; 
    The ETL process will run on the first Tuesday after the 15<sup>th</sup> of a given month. The Analysis Cube data queried should include the current year up to the end of the previous month. For example, on May 19<sup>th</sup>
    (the first Tuesday on or after the 15th) the query should include data from January 1<sup>st</sup> through April 30<sup>th</sup>.
    The 15<sup>th</sup> of the month is not part of the query, it is a factor in when the query is run. The query will always be in terms of complete months.
    SELECT
                    NON EMPTY { [Measures].[Revenue Amount],
                    [Measures].[Utilization],
                    [Measures].[AVG Revenue Rate],
                    [Measures].[Actual Hours] }
    ON
                    COLUMNS,
                    NON EMPTY { ([dimConsultant].[User Id TT].[User Id TT].ALLMEMBERS * [dimConsultant].[Full Name].[Full Name].ALLMEMBERS * [dimConsultant].[Employee
    Type].[Employee Type].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
                    MEMBER_UNIQUE_NAME
    ON
                    ROWS
    FROM
                    ( SELECT
    ( { [dimDate].[Week Date].[1/4/2015], [dimDate].[Week Date].[1/11/2015], [dimDate].[Week Date].[1/18/2015], [dimDate].[Week Date].[1/25/2015], [dimDate].[Week Date].[2/1/2015] } )
                    ON
                                    COLUMNS
                    FROM
                                    ( SELECT
    ( { [dimIsBillable].[Is Billable].&[True] } )
                                    ON
    COLUMNS
                                    FROM
    [SSASRBA]
    WHERE
                    ( [dimIsBillable].[Is Billable].&[True], [dimDate].[Week Date].CurrentMember ) CELL PROPERTIES VALUE,
                    BACK_COLOR,
                    FORE_COLOR,
                    FORMATTED_VALUE,
                    FORMAT_STRING,
                    FONT_NAME,
                    FONT_SIZE,
                    FONT_FLAGS

    Hi Hans,
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Regards,
    Simon Hou
    TechNet Community Support

  • Exit/BADi for ml81n to check GRN date should be PO Date.

    Exit/BADi for ml81n to check GRN date should be > PO Date.Kindly suggest .

    Hi,
    You can achieve it using the below enhancement.
    Enhancement: SRVEDIT
    Function module: EXIT_SAPLMLSR_001
    Regards,

  • HT3275 I've 1.85TB empty space on my time Machine, but it only backs up to the beginning of the previous month. it should have weekly back-ups for every month before that. Any ideas why it deletes stuff older than a month?

    I've 1.85TB empty space on my Time Machine, but it only retains back-ups to the beginning of the previous month. I should be able to access weekly back-ups for every month before that until the disk is full. Any ideas why it deletes stuff older than a month?
    Thanks, Rigby.

    If you are using Ethernet to connect your Mac to the Time Capsule, are you allowing at least 2-3 minutes for Time Machine to fully load when you open the application to see your backups?
    If you are using wireless to connect, you may need to allow 8-10 minutes or longer for everything to fully load, depending on the speed of your wireless connection.
    If you see only white time "bars" on the timeline at the right of the screen, you are seeing temporary backups. Permanent backups are displayed with purple "bars".

  • How to have more months and years appear for selection in the archives for blog posts?

    Hello,
    How to have more months and years appear for selection in the archives for blog posts?  It just shows past 3 months in the year 2014, but we have many blog posts in years 2013, 2012 and 2011 and further back.  I am using the OOB SharePoint blog
    feature.
    Paul

    Hi,
    Thanks for the reply; it doesn't add anything as RSA6 was one of the options I listed and this was my fall back option if there was no other special treatment for the COPA datasources.
    I have found out why this, and other fields, are not available in KEB0.  The program uses a Function called KERA_COPA_METADATA_INTERFACE within which there is a section that selects the COPA fields:
    ***** 1. RULES (choice/class)
    * set rules for fixed fields
      PERFORM COPA_SET_RULES_FIXED_FIELDS USING I_ACCTCOST
                                          CHANGING E_T_RULES[].
    When you look at this code section there is a hard coded list of fields to exclude:
      MRULE 'MANDT     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PAOBJNR   ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PASUBNR   ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PAPAOBJNR ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PAPASUBNR ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'HRKFT     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'HZDAT     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'USNAM     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'RKESTATU  ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'TIMESTMP  ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PERDE     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PERIO     ' OBLIGATORY CHAR_CE3 OBLIGATORY CHAR_CE3.
      MRULE 'COPA_AWTYP' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'COPA_AWORG' NEVER FORGET_IT NEVER FORGET_IT.
    As this is a standard delivered SAP function I do not recommend that you change this code as you will invalid your SAP support and upgrade paths.
    Thanks
    Neil

  • Filter a List for data from the Previous Month

    Hello,
    I have audit data for each month of the year.  At the beginning of one month I pull a report from the previous month.  I would like to have a view in my SharePoint list that shows only the data from the previous month.
    I am not a programmer or developer, so I was wondering if this is possible without out of the box tools.
    Here is what I have done so far:
    Created two calculated columns to find the start and end date of the previous month
              Previous Month Start =DATE(YEAR([Date of Review]),MONTH([Date of Review])-1,1)
              Previous Month End   =DATE(YEAR([Date of Review]),MONTH([Date of Review]),0)
    I have verified these two calculations do show the correct dates. 
    So I can generate the dates, but I don't know how to set up a view filter that will show only data from the previous month. 
    Please help.

    What you need is the calculated column to display the start and the end of the next month, not the previous month. Then you can do a view filter where Start<Today & End>Today.
    EX: If you have a document with date 15-03-2014, you need to save the dates 01-04-2014(start) and 30-04-2014(End).
    Then If Start < [Today] and End > [Today], you can show the document

  • Posting Depreciation for the previous months

    HI Experts,
    We got new asset  AS100SA  capitalized on 28.02.2013 (Fiscal Year Period 4  2014 )  and we want to start depreciation  this  asset
    start from  Feb 2014 (Fiscal Year Period 4 2014),
    We have run the  depreciation  for all asset in current Month ( Period 5 2014) , when we try run the  depreciation for new asset  AS100SA
    for the previous months in the Current Period , system prompt error msg : "Period  4 is already posted".
    Asset Master Data
          when I view the posted values Tab in the Asset Explorer (AW01N), system is showing the planned values beginning period 5 (Fiscal Year =  March 2014)  
           AFAB - Depreciation Run
           Period 4 (Previous Month for new asset)
          Error Message 
             kindly advise on this issue. thanks in advance.

    Hi Ginee,
    Radio button planned posting run can only be choose once per period and when you choose planned posting run you should not specify your asset number.
    As for your case, you can run the depreciation (AFAB) by choosing the repeat button (specify your asset number) since you already done the planned posting run for period 4 and after the depreciation posted you can check the posted value tab in AW01N again, system will show the posted value in period 4.
    Ex : asset acquisition : 01.01.2014, in AW01N it start with period 2 but the depreciation start from period 1.
    run AFAB with this parameter
    AW01N after AFAB
    Regards,
    Lelyana

  • Function module which could calculate the previous month's start date.....

    hi,
    I want a function module which could calculate the previous month's start date and end date...
    Say todays date is  like 29.05.2007(start date) it should return
    01.04.2007 and 30.04.2007...
    IS there any FM for this ... or how to go about this scenario ???
    thanks in advance
    samm

    See the below Logic :
    DATA :g_date(2) TYPE n,           " Date
          g_month(2) TYPE n,          " Month
          g_year(4) TYPE n ,          " Year
          g_bill_low(10) TYPE n,       " From date
          g_bill_high(10) TYPE n,      " To date
          g_month1(2) TYPE n,         " Month
          g_year1(4) TYPE n,          " Year
          g_date1(2) TYPE n,          " Date
          g_year2(4) TYPE n,          " Year
          g_datum LIKE sy-datum.      " System date
    RANGES : r_bdate  FOR vbrk-fkdat.             " Billing date
      g_datum = p_date + 10.
      g_month = g_datum+4(2).
      g_year = g_datum+0(4).
      IF g_month = 1.
        g_year = g_year - 1.
        g_month = 12.
        g_date = 1.
      ELSE.
        g_month = g_month - 1.
        g_date = 1.
      ENDIF.
    Passing the date to billing date-low
      CONCATENATE  g_year g_month g_date  INTO g_bill_low.
      r_bdate-low = g_bill_low.
      r_bdate-sign = 'I'.
      r_bdate-option = 'BT'.
      g_month1 = g_datum+4(2).
      g_year1 = g_datum+0(4).
      IF g_month1 = 1.
        g_year1 = g_year1 - 1.
        g_month1 = 12.
      ELSE.
        g_month1 = g_month1 - 1.
      ENDIF.
      CASE g_month1.
        WHEN 1.g_date1 = '31'.
        WHEN 3.g_date1 = '31'.
        WHEN 4.g_date1 = '30'.
        WHEN 5.g_date1 =  '31'.
        WHEN 6.g_date1 = '30'.
        WHEN 7.g_date1 = '31'.
        WHEN 8.g_date1 = '31'.
        WHEN 9.g_date1 = '30'.
        WHEN 10.g_date1 = '31'.
        WHEN 11.g_date1 = '30'.
        WHEN 12.g_date1 = '31'.
      ENDCASE.
      g_year2 = g_year1.
      IF g_month1 = 2.
        g_year2 = g_year2 MOD 4 .
        IF g_year2 = 0.
          g_date1 = 29.
        ELSE.
          g_date1 = 28.
        ENDIF.
      ENDIF.
    Passing the date to billing date-high
      CONCATENATE  g_year1  g_month1  g_date1 INTO g_bill_high.
      r_bdate-high = g_bill_high.
      APPEND r_bdate.
    Reward Points if it is helpful
    Thanks
    Seshu

  • I had the icloud account changed on the iPad (have added new ID and deleted old one). However when updating/downloading , it still asks for password to the previous account...?

    I’m giving my ipad to my sister and I had the icloud account changed. I have added new ID and deleted the old one. However when updating and downloading apps, it still asks for password to the previous account. Does anyone know how to fix this? Thanks very much!

    Maybe you should set it up as new device again:
    How to back up your data and set up as a new device
    Apps are tied to the Apple ID they were bought with and can not be shared with other devices that have a different Apple ID.

  • Is there a way to show the end dates of the previous month stand out?

    is there a way to show the end dates of the previous month in bold or make it stand out? so 30,31 and 1st of this month don't all look the same? For example the 30,31st get a regular text since they are a part of the the last month and this month gets bold dates? Its hard to read the dates anyways.

    Pics and more
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    5:05 PM Sunday; January 4, 2009

  • I want to see the previous month workload statistics for my system.

    Hello,
    I want to see the previous month workload statistics for my system. When I go to st03n ->expert mode, go to month view and when I click on previous month workload analysis I see data for 12 days only. However, the data is available in weekly view.
    What can be the problem?
    Please help.

    which version of SAP System you are using
    try this option ST03N -> Expert mode -> Total -> Choose the month

  • Function module to get the same date of the previous month

    Hi
    Can anybody tell me how to get the
    same date of the previous month.
    example if i am entering date as 30 may 2007
    i want the date as 30 april 2007

    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
    date = pa_end
    days = '00'
    months = '01'
    signum = '-'
    years = '00'
    IMPORTING
    calc_date = pa_end.
    ENDIF.
    nd try below FMs as well...
    CCM_GO_BACK_MONTHS
    HR_PT_ADD_MONTH_TO_DATE
    RP_CALC_DATE_IN_INTERVAL
    Hope it will solve your problem...
    Reward points if useful..
    Thanks & Regards
    ilesh 24x7

  • How to correctProcess Order confirmation data posted in the previous month

    Hi All PP Gurus,
    Can anybody tell me the answer of following
    How we can correct the process order confirmation data posted in the previous month.

    Dear Ashok/Brahmankar,
    Actually i am facing the following problem:-
    1) If you cancel the confirmation done in the previous month by the tcode CORS, the CO document is posted in the previous period because we cannot change the posting date in CORS. But the previous period is already closed.
    Can we change the posting date in CORS manually? Or do you have any other idea? 
    2) When reading the master data in COR2, I face the error because the status of PO is already set as 'DLV'.
    Do we need to read the master data even when the value is changed in KP26?
    Thanks,
    Narayan

  • VZW sucks, after overcharging me for four months they issued a credit and then charged me for that credit the following month and 2 cost service reps and one supv can't figure out why...THEY SUCK

    Does anyone else find it odd VZW starts every conversation with the standard "this call may be recorded" line, but if you imply you are recording them, they freak out and go silent.  It's amazing they never want to stand by what they say.  I was overcharged and basically screwed for four months, they then issues me a credit and then CHARGED me for that credit the following month.  I explained it in their second grade terms so they could understand and still NO ONE gets it.
    RIDICULOUS

    Grothka wrote:
    First, can you elaborate a bit on what the concern with the credits are? It is really hard to give advice about the scenario without really knowing what is happening. #2: I don't find it odd at all that vzw wants to record their calls but not have customers record them. In fact I can't imagine that any medium-large company (or many small companies either) would be comfortable with their rep's being recorded seeing as they could make mistakes or just decide to not be appropriate. VZW records their calls for 'quality and training purposes.' Meaning that they are doing it in an attempt to improve their customer service internally, and if it means that they can go back and listen to a call to see if a rep made a mistake then that is just gravy. In most cases if a call is listened to and it's found that the rep did lie or make a mistake it will be corrected and handled internall. If, however, a customer records a call there is a pretty good chance that they will blast it all over the world and damage vzw's reputation... this is a problem if vzw would have fixed the issue anyways once they had a chance to listen to the call.
    Thats interesting. Sounds like a fairy tale but interesting.

  • Show data of last day of previous month against any day of current month

    Hi,
    I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
    Any suggestion ???

    You're asking to filter your data set to only include rows between:
    1) last day of the previous month
    2) any day of the current month
    This can be achieved with prompting in OBIEE Answers.
    last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
    In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
    For the 'last day of previous month' , use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    For the current date, use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt.

Maybe you are looking for

  • Mail Account sync from mac to iPhone

    i cant sync my mail accounts from my mac to my iphone 4! the register "info" isnt there in iTunes. so i have to type all the settings on the iphone again. with mountain lion it was really easy to sync my mail accounts. why is this function not includ

  • Value has to be entered for an optional parameter for WS

    Hi, I have created a webservice from a PL/SQL package using the below tutorial. http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm I wrote my package to get the user status from fnd_user table. The pac

  • Update Image In ADF Business Component

    I can create Image into database but I cannot Edit .Please help me!Thanks

  • Feedback-form (PHP - JSP)

    Hello, I have to change a PHP-feedback page to JSP. But I have no experience in JSP. They told me something about a Email.sendMail-function in JSP but I can't find any info about it. Can somebody help me ? Also how to catch the form-field (email, nam

  • AD Site with no Domain Controller

    Hello, I have a customer that wants to set up a GPO to add a printer only when users are at a new remote office. They do not want to set up a Domain Controller at this site, so I was wondering if the best way to set this up would be to create a new s