Setting date parameters with yesterdays date

Hi everyone.
I have a very basic report where I have two date fields as parameters, 'From Date' and 'To Date'.
I want the From date to default to yesterday, and the To date to default to today.
I can set todays date simply by adding DEFAULT sy-datum to the parameter.
But I've been unable to figure out how to set yesterdays date.
I tried adding some code before the parameters eg:
lv_yesterday = sy-datum - 1.
and then add DEFAULT lv_yesterday to the parameter but it doesn't do anything.
Anybody able to help here? Seems rather trivial but no luck so far!
Moderator message - You're right, this is a pretty basic question. Please search before asking - post locked
Edited by: Rob Burbank on Jun 23, 2009 5:21 PM
Moderator message - OK - I'm going to unlock it long enough so that you can mark David's solution as - solved your problem (I'd use INITIALIZATION rather than LOAD-OF-PROGRAM though
Edited by: Rob Burbank on Jun 23, 2009 5:23 PM

Hello Kieran,
I think you need to calculate the date in the LOAD-OF-PROGRAM event block:
REPORT z_test.
DATA: gv_yesterday TYPE d.
PARAMETERS:
  pa_date TYPE d DEFAULT gv_yesterday.
LOAD-OF-PROGRAM.
  gv_yesterday = sy-datum - 1.
Best regards
David

Similar Messages

  • Transport request for Set Control Parameters for Actual Data.

    Hi Viewers,
    I am unable to create the transport request for the below settings
    Controlling->Profit Center Accounting->Basic Settings->Controlling Area Settings->Activate Direct Postings->Set Control Parameters for Actual Data.
    Is it possible to move the request through transport request or do we need to create the settings directly in the target system.
    Thanks
    Aswin.

    Hi,
    Please read the IMG help at the given path.  There are certain profit center accounting settings which cannot be transported directly from the same path, but there is another node in SPRO path for doing this.  If possible I will try to locate the path but I am not sure I can post it immediately as I am not having system handy.
    thanks,
    Kumar

  • Error in viewing data in a data template with multiple data sources

    Hello,
    I have designed a data template with two data sources.One is from DEPARTMENTS table and the other datasource is a xml file.Following is the code for the data template :
    <dataTemplate name="EmployeeListing" dataSourceRef="demo">
    <parameters>
    <parameter name="p_DEPTNO" dataType="character" defaultValue="20"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT DEPARTMENT_NAME,DEPARTMENT_ID,LOC from DEPARTMENTS]]>
    </sqlStatement>
    <xml name="empxml" expressionPath=".//ROW[DEPARTMENT_NAME =$DEPARTMENT_NAME]">
    <url method="GET" realm="" username="" password="">file:///D:\OraHome_1\xmlp\XMLP\DemoFiles\Employee Salary Report.xml</url>
    </xml>
    /dataQuery>
    </dataTemplate>
    The problem is when i am trying to view the data, only data from SQL Query Q1 is getting displayed and the data from Employee xml is not at all getting displayed.
    Could anyone please let me know what i am missing?
    Thanks
    Nutan
    Edited by: user609971 on Oct 23, 2008 8:06 AM

    This is from Documenation sample....
    Did you see the data structure section, where you say, how you wanted the columns ?
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="Employee Listing" description="List of Employees" v
    ersion="1.0">
    <parameters>- Defines a single parameter for the Department Number
    - with default of 20:
    <parameter name="p_DEPTNO" dataType="character"
    defaultValue="20"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT DEPTNO,DNAME,LOC from dept
                      order by deptno]]>
    </sqlStatement>
    <xml name="empxml" expressionPath=".//ROW[DEPTNO=$DEPTNO]"> - Defines name
    - and link to DEPTNO in Q1
    <url method="GET" realm="" username="" password="">
    file:///d:/dttest/employee.xml</url> - Defines url for xml data
    </xml>
    </dataQuery>-
    <dataStructure>- The following section specifies the XML hierarchy
    - for the returning data:
    <group name="G_DEPT" source="Q1"
    <element name="DEPT_NUMBER" value="DEPTNO" />
    <element name="DEPT_NAME" value="DNAME"/>
    - This creates a summary total at the department level based
    - on the salaries at the employee level for each department:      
    <element name="DEPTSAL" value="G_EMP.SALARY"
    function="SUM()"/>
              <element name="LOCATION" value="LOC" />
    <group name="G_EMP" source="empxml">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="MANAGER" value="MGR"/>
    <element name= "HIREDATE" value="HIREDATE"/>
    <element name="SALARY" value="SAL"/>
    </group>     
    </group>
    </dataStructure>
    </dataTemplate>

  • Query To update a date column with a date of my interest

    All,
    How to update a column in a table which is in date format with a date of my interest??
    Pls suggest.

    Please detail :
    1. what exactly you are trying to do
    2. what exactly you have done
    Nicolas.

  • Not able to save date column with custom date format. in OBIEE 11g

    Hi,
    I have migrated one report from OBIEE 10g to 11g. There is a date column with customized date format(i.e. Default format is 'dd-MMM-yyyy' and I have used 'MMM-yyyy').
    But when I use this custom format and try to save the report in 11g its giving this below error.
    ''Catalog object privilege validation failed for user to path /shared/ALM BI/Finacial Results/History Income Statement Detail.
    You do not currently have sufficient privileges to save a report or dashboard page that contains HTML markup.
    This HTML might be present in column headings, table headings, text views, narrative views, the print header,
    or the print footer and must be removed before saving.''
    Please let me know what changes I need to do for this.
    Regards,
    Ambika Nanda.

    Hi ,
    privilage issues...check the security settings once..
    Thanks,
    Ananth

  • Filling bc travel data model with test data

    Hey i read somewhere that there is a app to fill the bc travel data model with test data.I been searching but havent found one in the preview version.Please help me if anyone knows how to get it done.Filling it manually is taking a whole lot of time.

    Go to the ABAP Editor (SE38) and execute the SAPBC_DATA_GENERATOR program. This program generates suitable sample data in the tables of the flight data application.

  • Default date parameters with timestamps

    Hi everyone!
    I have an user request that I thought should be fairly simple, but I cannot quite get it working.
    We have a concurrent request with beginning and ending date parameters. The users have requested that these dates default to the beginning/end of the current day.
    For example:
    20-MAR-2009 00:00:00
    20-MAR-2009 23:59:59
    I thought this would be a simple sql statement, but Apps does not seem to agree.
    The parameters are of type FND_STANDARD_DATE.
    What we have tried:
    select to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01' p_beg_date
    , to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59' p_end_date
    from dual
    -- did not work, said looking for DATE format --
    select to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE
    , to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE
    from dual
    -- works for beg date, but not end date, both display time as 00:00:01 ( I believe i was having issues in TOAD trying to get it as 00:00:00) --
    Any ideas?
    Thanks!
    Janel
    (apologies for the double post - what exactly is the difference between the 2 EBS forums?!?!?)

    Your second code snippet is correct - it works in my instance :-)
    SQL> alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
    Session altered.
    SQL> select to_date(to_char(sysdate, 'DD-MON-YYYY') || '00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE,
      2  to_date(to_char(sysdate, 'DD-MON-YYYY') || '23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE from dual;
    P_BEG_DATE                 P_END_DATE
    20-MAR-2009 00:00:01       20-MAR-2009 23:59:59HTH
    Srini

  • Date parameters with Sage

    I am attempting to build a report for SSRS using Visual Studio. 
    I have a query that is returning results, and the report is functioning perfectly.  However, the end user decided they wanted a date range selector on this report.  I have done this hundreds of times before with standard SQL databases/reports,
    but never before when accessing a Sage database.
    Here is my issue.  When I put the date parameters into the query, it throws an error message.  Here is the line in the query that is causing me the issue:
    AND SO_SalesOrderDetail.PromiseDate between {d @beginDate} and {d @endDate}
    And here is the error message it gives:
    Error[37000][ProvideX][ODBC Driver]Expected lexical element not found: <identifier>.
    This query functions perfectly if I hard code a static date into it, but the user wants to be able to select a date range of their own.  Any ideas on how to fix this issue?
    Mitchell Colwell

    Hi Wedge47,
    Based on your description, you are experiencing the problem when adding date range selector on this report by creating two parameters: BeginDate and EndDate, but when added them in the query, it caused some error, right?
    In SQL Server Reporting Service, there are two methods to filter the data by using a parameter, one is add it to the query, another one is add a filter to your dataset. I have tested on my local environment, the problem due the query is incorrect by using
    “{d @Date}” , so in order to avoid this issue, you can choose another method by adding a filter to create the date range selector:
    You can check steps below to know how to add the filter:
    Right click the main dataset to select the “Dataset Properties” and choose the filter on the left pane
    Click “Add” and add the filter: In the Expression choose the field of the date: PromiseDate
    Please refer to the article about the Transact-SQL Statements for the timestamp and date:
    http://msdn.microsoft.com/en-us/library/ms191307.aspx
    If you still have any question, please feel free to ask.
    Regards
    Vicky Liu

  • How to compare the date value with the date datatype column?

    Hi,
    I am executed a query to get output for the particular date in two different database.
    I got output in one db environment, but in the another environment i didnt get the output.
    APP_DECISION_DATE column contains date datatype
    ex:
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE = TO_DATE('23-JAN-07',
    'DD-MON-YY'); 2
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060106 SYSTEM
    DATABASE - II
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE=
    TO_DATE('31-JAN-2007','DD-MON-RRRR') and application_id=2007010028552;
    no rows selected
    in the same db i got the output while i used the TO_DATE(APP_DECISION_DATE)
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where TO_DATE(APP_DECISION_DATE)=
    TO_DATE('31-JAN-2007','DD-MON-YYYY') and application_id=2007010028552; 2
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060113 SYSTEM
    is it necessary to use TO_DATE function while i am using the data datatype column in the WHERE CLAUSE?
    Thanks in advance.
    siva

    Sorry & thanks sathish,
    Now i got the result.
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE BETWEEN TO_DATE ('31.01.2007 00:00:00', 'DD.MM.YYYY HH24:MI:SS') AND TO_DATE ('31.01.2007 23:59:59', 'DD.MM.YYYY HH24:MI:SS')
    2 and application_id=2007010028552;
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060113 SYSTEM
    ================================
    But one doubt,
    When i created the column with the date datatype how it gets the time value,
    And in one environment db i got the result but in another environment i dont get,
    Shall i want to change any session status of date?

  • Date Query With Restricted Dates

    Sorry not really an easy thing to explain:
    I have specified in a Query that i Only want values with a date BETWEEN:
    01JAN2002 08:00 AND 01SEP2003 08:00
    Now in the same query, what is the simplest way to restrict that only the following dates are examined and not all the dates within the above time window:
    Say 06/01 - 07/01
    The following dates i am looking to analyze will thus be
    01JUN2002 08:00 - 01JUL2002 08:00
    01JUN2003 08:00 - 01JUL2003 08:00
    Thanks

    Had a little bit more time to test, today. So in case you couldn't find the complete soultion yourself, here you go. The records with flag='Y' are the ones that fit within your selection criteria (between any 7-OKT 8:00AM and 8-OKT 8:00AM).
    drop table testDate;
    create table testDate(id number,flag char,yourDate date);
    insert into testDate values (1,'Y',to_date('7-OKT-2003 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (2,'Y',to_date('8-OKT-2003 7:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (3,'N',to_date('7-OKT-2003 3:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (4,'N',to_date('8-OKT-2003 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'Y',to_date('7-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'N',to_date('6-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'N',to_date('9-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    commit;
    select id,flag,to_char(yourDate,'DD-MON-YYYY HH:MI:SS') from testDate
    where trunc(yourDate,'HH')-trunc(yourDate,'YYYY')
    between to_date('7-OKT-2003 08:00:00','DD-MON-YYYY HH:MI:SS')-to_date('01-JAN-2003')
    and to_date('8-OKT-2003 08:00:00','DD-MON-YYYY HH:MI:SS')-to_date('01-JAN-2003')
    /

  • Dynamic current date variant with static date

    I have a report that I want to execute with a variant that defaults dynamically to today's current date, but I also want to select based on if that date field is initial too.  In one execution.  So select record if date is either today's date (dynamically calculated) or date is initial.
    Anyone know how I can do that?
    Thanks so much
    Cathy

    hi
    Did you try to force value in the variant in the multiple value with a value equal to space? So it will be like default date as today's date and fixed values as space.
    Force value in the sense we use fixed values in the selection screen.
    If this is not working then do coding in infoset
    Br
    Vijay V

  • Migration of Equipment Master Data together with PRT data

    Hello Experts,
    we need to migrate Equipment Master Data which have activated the view PRT data. Most of the fields in this view are stored in table CRFH. Is there a way to migrate Equipment Master Data together with the PRT data of the Equipment? All the BAPI's I found do not have an import structure for those fields. Is a batch-input the only way?
    Does anybody know a mass change transaction for Equipments?
    Thank you and Regards
    Christian

    Hi Krishna,
    You can use the standard batch input program RFBIDE00 in LSMW to update the customer master data. However, there might be scenarios where you might be required to update the fields which do not get updated by the standard bacth input program. If any of such fields are defined as mandatory, then you wont be able to use this method directly.
    In such cases you will have to either create a recording to poplate the fields which do not get updated by the standard program and use both the recording and the standard batch input program to update the customer master data OR create a recording for customer master create and use the same in LSMW.
    Best regards,
    Harsh

  • Business View data foundation with dynamic data connection hangs

    We are running Business Objects XI 3.0 with Crystal Reports 2008 and Business View Manager 12.0.0.683.  In the Business View Manager tool, when I try to open a data foundation that uses the ACD Dynamic data connection, it hangs with the hourglass icon.  I have left it trying to open for at least an hour before killing the Business View Manager with the Windows Task Manager.  Data foundations using a static connection open fine as do the elements and views based on the data foundation with the dynamic connection.  The static data connections included in the ACD Dynamic connector point back to an Oracle Server.  Any ideas how to get the data foundations to open so I can edit our custom business views?
    Thanks,
    Kathy

    I created some Views to pull the data in from the Oracle side.

  • Date compare with system date

    Given date time is in yyyyMMddHHmmss format, want to compare with system date time.
    ie given date time is greater than zero then go inside if block otherwise else block.

    I am using below code which always greater than zero. But I want to use compare to method to compare given date with system date and goto if or else condition:
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
             String delaytimeFormat = sdf.format(new Date("10/10/2009"));    
             System.out.println("delaytimeFormat: "+delaytimeFormat);
             long timeDiff = Long.parseLong(delaytimeFormat) - System.currentTimeMillis(); 
             System.out.println("timeDiff->"+timeDiff);
             String newCallbackUrl = null;
            if(timeDiff > 0){
                 s = s+" new URL"+"test" ;
                 System.out.println("if:->"+s);
            else{
                 System.out.println("else");
            }

  • Transction data loading with master data as key?

    Expert's,
    I am trying to load the transction data with master data as a key.ZEMPID is my masterdata which having attributes ZEMPNAM and ZEMPDES .My transction data contains ZEMPID.ZEMPSAL and ZEMPAGE.I could create the master data and also load it successfully.But when I tried to create the infosource for trasctional data I should get all the attributes whatever I have given it for the ZEMPID.This I am not getting.Also While creating the cube if I select the infosource then in chraracterstic tab I am not getting my characterstics(master data+attribute).Please any one help me.

    Hello Vasu
    You are talkin abt transactional data and saying that not created cube/Ods ..
    Let me put the things again
    1. When you load master data you create infosource ( direct or indirect), All the attribute will be automatically comes in the infosource...when you define application component in master data tab in infoobject maintenance it is ready for data to be loaded. Search for application component in infosource..u will get the flow
    2. When you load data in infocube only transactional data goes in it.....master data presents in master data tables...In infosource you define what are the field which need to be present in cube.......so you will be able to include only these objects which are present in cube dimensions + attribute which are defined navigational in the cube....
    Master data attribute will never be pushed automatically....only componding object are pushed automatically.....
    If you want to load attribute of ZEMPID then make them navigational in cube or add them in one of cubes dimension...
    Hope i could make myself clear
    Thanks
    Tripple k

Maybe you are looking for

  • Excise Invoice Number through Purchase Order no. or Material Document no.

    Hi, Is there any report through which I can find Excise Invoice Number (J1IEX) with the help of either Purchase Order no. or Material Document no.? Can anyone provide some idea in this regard? Thanks in advance

  • How re-install OS X Lion fresh without disks?

    Something is wrong with programs or something on my Mac and I want to completely wipe the hard drive and start over with a fresh copy of Lion.  I did a Time Machine backup last night and will then just bring over files one at a time from that externa

  • HTML tag problem when adding Google rich snippets in templates?

    The new Google plus Rich Snippets allow us to add a schema tag like this example: <html itemscope itemtype="http://schema.org/Article"> I can do this on my .html pages but as soon as I make any changes to the .dwt template for the page it reverts all

  • Saving files locally using captive runtime?

    Hi All, I'm creating an app using Flash Builder 4.7 and trying to export as an Air-powered desktop executable (.exe / .app) using Captive Runtime. End users won't have permissions for an Air installer. Part of the app uses a gallery where users can u

  • Windows 7 partition got corrupted after yosemite upgrade

    Loner T please help. I can't believe Apple would do this to me. After Yosemite upgrade, windows 7 keeps booting into setup or recovery. Salmans-MBP-2:~ salman$ diskutil list /dev/disk0    #:                       TYPE NAME                    SIZE