Using a year parameter in a date condition

I am collecting a year parameter from my user and want to use that year as part of a complete date condition.
So I collect the year 2003 from my user.
A condition is applied to the report in that the date must be after 01-APR-...and here is where i want to utilize the parameter @Year. So I can apply the same date condition depending on what year we are looking at.
I am sure this can be done but I am missing the syntax.
Thanks, mpaskevi

Thanks for the reply. I had started taking the date apart using tochar as in:
WHERE (QUAL.CANCELLATION_DATE IS NULL
OR
to_char(QUAL.CANCELLATION_DATE,'YYYY') = :Year
AND
to_char(QUAL.CANCELLATION_DATE,'DD')>'04'
AND
to_char(QUAL.CANCELLATION_DATE,'MM')>'02')
But was still struggling.
If I use your method which is much more efficient I get the following error. I would have expected a prompt for the parameter.
ORA 01008 not all variables bound
Any thoughts?
Message was edited by:
user509963
Message was edited by:
user509963
Message was edited by:
user509963

Similar Messages

  • How to use previous year keyfigure data in current year for other keyfig

    Hi Expert,
    I have 1 requirement wherein I need to use previous year data for some keyfigure calculation.
    Details are as follows:
    I have designed query with CKFs Turnover & UVG (in rows) & Fiscal year period in columns.
    Suppose Keyfigure Turnover data is displayed from Apr2009 to Mar 2011. In UVG: for Apr 2010, i need Turover data of month Apr 2009, for May 2010 turnover data of May 2009 similarly for other months.
    As per my understanding, I need to use customer exit which will store kf turnover data in internal table & in turn it will be used for UVG.
    But I'm not able to put it into syntax.
    Kindly suggest your inputs in this scenario.
    Thanks,
    Shamkant

    Hi
    Note that the variable ZCALCCALMTH is exit type and variable ZCALMTHREF is ready for input.
    WHEN 'ZCALCCALMTH'.
    IF i_step = 2. "après le popup
    READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZCALMTHREF'.
    IF sy-subrc = 0.
    CLEAR l_s_range.
    year1(4) = loc_var_range-low(4).
    year1(4) = zyear1(4) - 1.
    zmonth1(2) = loc_var_range-low+4(2).
    CONCATENATE zyear1(4) zmonth1(2) INTO loc_var_range-low(6).
    zyear2(4) = loc_var_range-high(4).
    zyear2(4) = zyear2(4) - 1.
    zmonth2(2) = loc_var_range-high+4(2).
    CONCATENATE zyear2(4) zmonth2(2) INTO loc_var_range-high(6).
    l_s_range-low = loc_var_range-low(6).
    l_s_range-high = loc_var_range-high(6).
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDIF.
    bye
    Boujema

  • Teradata database error when using a Universe-defined Date condition

    I have encountered an odd problem when connecting Crystal to a Universe.  There is a pre-defined Date condition built into the Universe that is defined as follows:
    @Select(Date\Week End Date)  >  @Select(Conditions\User Response Select Date week -28)  AND @Select(Date\Week End Date)  <=  @Select(Conditions\User Response Select Date)
    The filter is designed to retrieve a rolling 4 weeks of data.
    When I try and create and refresh a Crystal Report that includes this Date prompt, I get the following error:
    Failed to retrieve data from the database.
    Details: 22003:(ODBC Teradata Driver)(Teradata Database) A character string failed conversion to a numeric value.
    If I create the same query in a WebI report it works fine, but in Crystal the error is produced.  I have also tried constructing the same prompt and filter within Crystal rather than use the pre-built prompt but that did not work either.
    Does anyone have any experience or advice on this error?  I can't seem to find many related postings on this specific error.
    BO Enterprise XI 3.1 SP2 running on Windows 2008 Server R2
    Crystal Reports 2008 SP2 running on Windows XP SP3
    Universe is built on a Teradata 12 source
    Thanks!

    One item I found I had to do with Teradata was cast my date/time values to dates, otherwise I got weird errors like this. You say it's working in Web Intelligence, so this might not be the issue, but it is an easy thing to test.
    In the universe, change your end date definition to
    cast(table.end_date as date)
    and see if that helps.

  • Using Fiscal/Year Period to get last year all months data

    Hi,
    Had a requirement to get Last Years 1-12 months data based on Fiscal/Year Period. So here i am using Fiscal/Year period as my input. Please let me know with code.
    Regards,
    Vishnu

    Hi ,
    Where you want to write code ?
    Well the basic logic will be like :
    TYPES: BEGIN OF ty_range,
    sign TYPE c LENGTH 1,
    option TYPE c LENGTH 2,
    low TYPE c LENGTH 8,
    high TYPE c LENGTH 8,
    END OF ty_range.
    DATA : t_range TYPE TABLE OF ty_range,
    w_range LIKE LINE OF t_range.
    DATA :v_lastyear type c length 4  .
    v_lastyear = sy-datum(4) - 1 .
    w_range-sign = 'I'.
    w_range-option = 'EQ'.
    concatenate  v_lastyear '001'  t into w_range-low.
    concatenate  v_lastyear '012'  t into w_range-high.
    APPEND w_range TO t_range.
    ****it will select data from source package for last one year .Internally year and period store like YYYYPPP  (2011001)
    select  SOURCE_PACKAGE WHERE 0fiscper  IN t_range.
    you can modify selection statement as per your requirement .
    hope this will be helpful .
    Regards,
    Jaya Tiwari

  • As iMac user upgraded to Mountain Lion and lost all Legacy connection with years of Apple/Mac data storage. How can recovery since every default says "no longer supported, After years of Mac software use now it is not accessible ??????

    As iMac user upgraded to Mountain Lion lost all Legacy connection with years of Apple/Mac data storage. How can recovery since every default says "no longer supported, After years of Mac software use now it is not accessible ??????

    Please provide more details. What version OS X were you using?
    Are you saying that Mail faIled to upgrade and you lost your old mail?
    Are you asking about PowerPC applications that require Rosetta to run like AppleWorks and Microsoft Office 2004?

  • Custom Report Erroring when using All as parameter

    Hi All,
    I am facing a problem in running custom report.
    => DB Server Info
    RDBMS : 11.2.0.2.0
    Oracle Applications : 12.1.3
    I am getting following error.
    REP-1401: 'afterpform': Fatal PL/SQL error occurred.
    ORA-06502: PL/SQL: numeric or value error
    custom report two parameters one is date parameter and name parameter
    date parameter is using as fnd_date.canonical_to_date(:P_EFFECTIVE_DATE) in queries.
    if I give name parameter for individual, then it works fine.
    if I give name parameter as "All", then its erroring. I tried it in my best way, but its not working.
    variable data length increased though its not working, can any one help me on this please....
    Here is the Afterpform code
    function AfterPForm return boolean is
    lName VARCHAR2(5000); -- its changed from lName varchar2(50);
    begin
    IF :P_NAME <> 'All' THEN
    lName:= 'AND name =:P_NAME';
    ELSE
    lName:='AND name in                                                             (select name from <******>
              order by name
    END IF;     
    :P_Where_Clause := lName;
    return (TRUE);
    end;
    Thanks for all your help so far.
    Ram.
    Edited by: user8822881 on Feb 9, 2012 10:43 AM

    excuse i understood that you use All as parameter name
    ORA 6502 is when you assign a char to a number or when assign a value which length is greater than the variable length
    what's the dimension of p_where_clause for example?
    you can trace with srw.message
    --- <Code>
    function AfterPForm return boolean is
    lName VARCHAR2(5000); -- its changed from lName varchar2(50);
    begin
    srw.message(1,'step 1');
    IF :P_NAME = 'All' THEN
    srw.message(2,'step 2');
    lName:='AND name in (select name from <table>
    order by name
    srw.message(3,'step 3');
    ELSE
    srw.message(4,'step 4');
    lName:= 'AND name =:P_NAME';
    srw.message(5,'step 5');
    END IF;
    srw.message(6,'step 6');
    :P_Where_Clause := lName;
    srw.message(7,'step 7');
    return (TRUE);
    end;
    ---</Code>
    i think your query is not good
    for example
    lName:= 'AND name =:P_NAME';
    when instance the query the query search this condition but no use the value of p_name parameter
    write
    lName:= 'AND name = '||''''||:P_NAME||''''; then :p_name take the value

  • Date condition not working correctly in Desktop

    Hello,
    I have two custom folders in Admin that are joined. One of the folders contains the following query:
    SELECT ORGANIZATION_ID, ASSET_NUMBER, MIN(CURRENT_READING_DATE) FIRST_READ_DATE, MIN(CURRENT_READING) FIRST_READING
    FROM EAM_METER_READINGS_V
    WHERE PREV_DESC IS NULL
    Group By ORGANIZATION_ID, ASSET_NUMBER
    I want my workbook to report the earliest meter reading that exists, based on the date that is specified in the parameters in Desktop. When I create a parameter for the date, the workbook reports the earliest reading in the database; it ignores the date restriction entered in the parameter. This is the parameter:
    First Read Date MIN BETWEEN :First Reading Date and SYSDATE
    If I include the date condition in the SQL of the custom folder the workbook functions exactly as it should. The date condition is in the SQL as the following:
    and current_reading_date between '01-JAN-2007' and SYSDATE
    Since the workbook functions correctly when the condition is coded in the SQL but not when it is based on a parameter, I assume the problem is with the parameter. Any ideas on how I may correct this?
    Thanks,
    Steve

    Thanks for the response Michael. I tried using the MIN function as you suggested, but I still am not getting the expected result. I’m not sure that I was clear in my initial problem description. I will try to provide more detail with this post.
    The reason I have two custom folders is that my original query has a nested Select statement (EAMV) and I couldn’t find a way to pass the parameter from EAMV to Discoverer. Following is the original query. I suppose the first logical questions would be, is there a way to pass the parameter to Discoverer? Would this alleviate the need for the second custom folder?
    SELECT K.ORGANIZATION_CODE "ORG" -- ORGANIZATION
    , K.ORGANIZATION_ID
    ,A.NAME "PM SCHEDULE NAME" -- PREVENTIVE MAINTENANCE SCHEDULE NAME
    --( (B.RUNTIME_INTERVAL/F.USER_DEFINED_RATE) + D.LAST_SERVICE_END_DATE) "PROJECTED READ DATE" -- USES USER_DEFINED_RATE FROM METER DEFINITION
    ,(C.LAST_SERVICE_READING + B.RUNTIME_INTERVAL) "PROJECTED READ UNITS" -- NEXT SERVICE READING DUE UNITS
    ,F.METER_UOM "UOM" -- UNIT OF MEASURE ON METER
    ,F.METER_NAME "METER NAME" -- METER NAME
    ,G.SERIAL_NUMBER "MAINT EQ NO" -- MAINTAINED EQUIPMENT NUMBER
    ,H.C_ATTRIBUTE1 "MAKE" -- MAINTAINED EQUIPMENT NUMBER - MAKE/MANUFACTURER
    ,H.C_ATTRIBUTE2 "MODEL" -- MAINTAINED EQUIPMENT NUMBER - MODEL
    ,H.C_ATTRIBUTE4 "SERIAL NO" -- MAINTAINED EQUIPMENT NUMBER - SERIAL NUMBER
    ,I.SEGMENT1 "ACTIVITY" -- ASSET ACTIVITY
    ,D.LAST_SERVICE_END_DATE "LAST READ DATE" -- DATE OF LAST PM SERVICE READING
    ,C.LAST_SERVICE_READING "LAST READ UNITS" -- UNITS OF LAST PM SERVICE READING
    ,E1.CURRENT_READING_DATE "CURRENT READ DATE" -- DATE OF CURRENT SERVICE READING (FROM METER FORM)
    ,E1.CURRENT_READING                                   "CURRENT READ UNITS" -- UNITS OF CURRENT SERVICE READING (FROM METER FORM)
    ,E1.LIFE_TO_DATE_READING "LIFE TO DATE READING" LIFE TO DATE READING
    --,(E1.CURRENT_READING - C.LAST_SERVICE_READING) "CURRENT/LAST VARIANCE" -- UNITS SINCE LAST PM SERVICE READING
    ,( (C.LAST_SERVICE_READING + B.RUNTIME_INTERVAL) - E1.CURRENT_READING ) "PROJECTED/CURR VARIANCE" -- UNITS REMAINING UNTIL NEXT SCHEDULED READING
    ,J.DESCRIPTION "LOCATION" -- OWNING DEPARTMENT DESCRIPTION OF ASSET NUMBER
    ,J.DEPARTMENT_CODE
    ,E1.DISABLE_FLAG
    ,G.CURRENT_STATUS
    ,B.RUNTIME_INTERVAL
    ,Y.SET_NAME
    ,EAMV.FIRST_READ_DATE READ_DATE
    ,EAMV.FIRST_READING READING
    FROM EAM.EAM_PM_SCHEDULINGS A
    ,EAM.EAM_PM_SCHEDULING_RULES B
    ,EAM.EAM_PM_LAST_SERVICE C
    ,INV.MTL_EAM_ASSET_ACTIVITIES D
    ,EAM.EAM_ASSET_METERS E
    ,EAM.EAM_METER_READINGS E1
    ,EAM.EAM_METERS F
    ,INV.MTL_SERIAL_NUMBERS G
    ,INV.MTL_EAM_ASSET_ATTR_VALUES H
    ,INV.MTL_SYSTEM_ITEMS_B I
    ,BOM.BOM_DEPARTMENTS J
    ,INV.MTL_PARAMETERS K
    ,EAM.EAM_PM_SET_NAMES Y
         ,(SELECT ORGANIZATION_ID, ASSET_NUMBER, MIN(CURRENT_READING_DATE) FIRST_READ_DATE, MIN(LIFE_TO_DATE_READING) FIRST_READING
              FROM EAM_METER_READINGS_V
              WHERE CURRENT_READING_DATE BETWEEN '01-JAN-2007' AND '30-JUN-2007'
              GROUP BY ORGANIZATION_ID, ASSET_NUMBER) EAMV
    WHERE A.PM_SCHEDULE_ID = B.PM_SCHEDULE_ID
    AND A.ACTIVITY_ASSOCIATION_ID = C.ACTIVITY_ASSOCIATION_ID
    AND C.ACTIVITY_ASSOCIATION_ID = D.ACTIVITY_ASSOCIATION_ID
    AND D.SERIAL_NUMBER = E.ASSET_NUMBER
    AND D.ORGANIZATION_ID = E.ORGANIZATION_ID
    AND E.METER_ID = E1.METER_ID
    AND E1.METER_READING_ID =
    (SELECT MAX(METER_READING_ID)
    FROM EAM_METER_READINGS
    WHERE METER_ID = E1.METER_ID
    AND (DISABLE_FLAG = 'N' OR DISABLE_FLAG IS NULL))
    AND E.METER_ID = C.METER_ID
    AND E.METER_ID = B.METER_ID
    AND E.METER_ID = F.METER_ID
    AND D.MAINTENANCE_OBJECT_ID = G.GEN_OBJECT_ID
    AND D.ORGANIZATION_ID = G.CURRENT_ORGANIZATION_ID
    AND G.SERIAL_NUMBER = H.SERIAL_NUMBER
    AND G.CURRENT_ORGANIZATION_ID = H.ORGANIZATION_ID
    AND D.INVENTORY_ITEM_ID = H.INVENTORY_ITEM_ID
    AND H.ATTRIBUTE_CATEGORY = 'EQUIPMENT DETAILS'
    AND D.ASSET_ACTIVITY_ID = I.INVENTORY_ITEM_ID
    AND D.ORGANIZATION_ID = I.ORGANIZATION_ID
    AND G.OWNING_DEPARTMENT_ID = J.DEPARTMENT_ID (+)
    AND I.ORGANIZATION_ID = K.ORGANIZATION_ID
    AND A.SET_NAME_ID = Y.SET_NAME_ID
    AND Y.SET_NAME IN ('MAIN','COMP')
    AND G.CURRENT_ORGANIZATION_ID = EAMV.ORGANIZATION_ID
    AND G.SERIAL_NUMBER = EAMV.ASSET_NUMBER
    AND K.ORGANIZATION_CODE = 'MCC'
    Using this query I want to show the most recent reading (current reading) and then give users the flexibility to enter an earlier date so the earliest reading as of that date will also show. For example, if they enter 1-JAN-2007 as the parameter and there was a reading taken on 2-JAN-07 and 28-JAN-07, the report should show the 2-JAN-2007 reading (in addition to the most recent reading in a separate column). Currently, everything on the report displays correctly, except for the reading based on the parameter.

  • How to enable or disable report parameter based on certain conditions

    Hello ALl,
    I have 3 parameters in my report. Fst parameter is having a LOV which is having all status value like 'Received,Refunded, Exempted etc).
    second parameter is From date and third parameter is To Date which is having value set as "FND_STANDARD_DATE'
    Now my requirement is If Status is selected as "Exempted" then From and To Date should be disabled.
    if other than that then both should be enabled.....
    Please help me out.
    How it cna be done.
    Thanks in advance
    sheetal

    Hi,
    You can use a condition
    <?xdoxslt:ifelse(Condition,'Paragraph','')?>
    Condition is the condition that needs to be satisfied
    Paragraph is the paragraph that needs to be displayed if the condition is satisfied
    '' is what needs to get displayed if the condition is not satisfied.
    Thanks,
    Swarna

  • How do you use the "Item Containing Start/End Date" in a Calendar?

    Hi
    I want to do a calendar where the days shown will be conditional to a certain interval. Now I though I could achieve that using the Item Containing Start Date of a calendar. But it doesn't seem to work. In the help it says :
    Enter an item in the application which holds the start date of the calendar. The format of the date in this item must be YYYYMMDD.
    This is what I did here
    http://apex.oracle.com/pls/otn/f?p=34530:1::::::
    I have 3 fields. 2 for the Start Date and End Date and 1 for the "Date Item" parameter. Only the latter has an effect on the calendar display, the calendar only displays the month of the "Date Item" (in monthly mode).
    Wether or not I check "Begin at Start of Interval", it doesn't affect the way those fields are affecting the Calendar.
    So, how do we use that "Item Containing Start/End Date" parameter?

    Hello,
    does yout Script work when you begin with ?:
    Start-Process powershell -Verb runAs
    Best regards,
    Stefan
    German Orchestrator Portal ,
    My blog in English

  • How to limit extract base on date condition in oracle goldengate?

    Hi all,
    I have a problem about date condition in extract parameter:
    My extract parameter:
    GGSCI>edit params ext1
    EXTRACT ext1
    USERID ggadmin, PASSWORD ggadmin
    EXTTRAIL /u01/app/oracle/product/gg/dirdat/lt
    DDL INCLUDE MAPPED
    table test.chien, where (id >4 and TDATE>TRUNC(TO_DATE('01/01/2011 00:00:00','DD/MM/YYYY HH24:MI:SS')));
    when I start extract, have a error:
    +7. 2011-11-04 07:06:45 ERROR OGG-01157 Oracle GoldenGate Capture for Oracle, ext1.prm: Error in WHERE clause for TEST.CHIEN.+
    I check where condition in the select statement is ok.
    I don't know what is different between condition in params of extract and condition in select statement?
    Please explaint to me and hepl me how to limit extract capture base date condition,
    Thanks so much.
    Omni
    Edited by: user12378049 on 21:46 03-11-2011

    Thanks for Stevencallan's reply.
    I try again with Stevencallan's way, but not successful.
    TABLE SCOTT.EMP, sqlpredicate "where EMPNO >4 AND HIREDATE> TO_DATE('01/01/1911 00:00:00','DD/MM/YYYY HH24:MI:SS')"; All Error is the same my old post:
    2011-11-07 05:37:52  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, ext1.prm:  Position of first record processed Sequence 26, RBA 21009936, SCN 0.1498876, Nov 7, 2011 5:34:14 AM.
    2011-11-07 05:37:53  ERROR   OGG-00212  Oracle GoldenGate Capture for Oracle, ext1.prm:  Invalid option for MAP: "where.
    2011-11-07 05:37:53  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, ext1.prm:  PROCESS ABENDING. {code}
    The trunc(date) to round date to the first time in the day. I think it is not reason of the error.
    {code} The TRUNC (date) function returns date with the time portion of the day truncated to the unit specified by the format model fmt. The value returned is always of datatype DATE, even if you specify a different datetime datatype for date. If you omit fmt, then date is truncated to the nearest day. Please refer to "ROUND and TRUNC Date Functions" for the permitted format models to use in fmt.
    {code}
    I have no resolution for this problem yet.
    Who had passed this case and had resolution? Please tell me your way
    Thanks so much.
    ---Omni                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Two commands in the report using the same parameter - fail under Java

    I have a report that contains 2 SQL commands.
    Both of these commands use one parameter X of type Number in their 'WHERE' clause.
    When i'm viewing the report in CR 2008, i'm asked for a value of this parameter and all data is filled in the report - OK
    The problem occurs when the same report is printed through Crystal Java Runtime:
    Report is printed without data! - it's empty.
    What we noticed in the debug information thrown by the Crystal libraries is that parameter value is set only in one of these commands:
    Original statement 1:
    select a.something
    from ANM_T a
    where a.anmid = {?PARAMETER01Id}
    Original statement 2:
    SELECT * from ANM_T a
    WHERE  a.anmid={?PARAMETER01Id}
    OUTCOME of Statement 1:
    select a.something
    from ANM_T a
    where a.anmid = 0
    OUTCOME of Statement 2:
    SELECT * from ANM_T a
    WHERE  a.anmid=9825
    In above example we may see that crystal set the value only in the second statement - first one got 0 - i suspect its some default value.
    Parameter in the Java code is set in the right way. In case of using only one statement it works. If we use two separate parameters (whose values are equal ) it also works.
    // we have also the loop over the parameters
    ParameterFieldController paramFieldController =
                    report.getDataDefController().getParameterFieldController();
    paramFieldController.setCurrentValue( "", paramName, paramValue );
    What is strange for me is that Crystal Reports enables to use the same parameter in two commands but if you edit one of them you may change the type of this parameter for a command ( for example from Number to String) but the parameter type in the second command remains unchanged ( it's strange because in my opinion it is the same parameter). In the Field Explorer under the Parameter Fields i still see one parameter of type used in the second command.

    Hello all,
    We have prepared some sample code to illustrate the issue.
    We have modified the sample application (Link: [http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/c07fec3e-3e11-2c10-1991-8c0fb0b82b75]) to that it also changes the parameter value. Parameter is used in two commands saved in report.
    The code changing the parameters value looks like this:
    private static void changeParameters(ReportClientDocument reportClientDoc) throws ReportSDKException {
              DataDefController dataDefController = reportClientDoc.getDataDefController();
            Fields fields = dataDefController.getDataDefinition().getParameterFields();
            for( int i = 0; i < fields.size(); i++ ){
                Field field = (Field)fields.getField( i );
                if( field.getKind() == FieldKind.parameterField ){
                            setParameter( ((ParameterField)field).getName(), "9825" , reportClientDoc);          
    private static void setParameter( String paramName, String paramValue, ReportClientDocument document ) throws ReportSDKException {
         ParameterFieldController paramFieldController =
                    document.getDataDefController().getParameterFieldController();
         paramFieldController.setCurrentValue( "", paramName, paramValue );
    We have tried the following codes to change the connection info used in commands:
    Attempt 1
              Tables tables = databaseController.getDatabase().getTables();
              //Set the datasource for all main report tables.
              for (int i = 0; i < tables.size(); i++) {
                   ITable table = tables.getTable(i);
                   //Keep existing name and alias.
                   table.setName(table.getName());
                   table.setAlias(table.getAlias());
                   //Change connection information properties.
                   IConnectionInfo connectionInfo = table.getConnectionInfo();
                   //Set new table connection property attributes.
                   connectionInfo.setAttributes(propertyBag);
                   //Set database username and password.
                   //NOTE: Even if these the username and password properties don't change when switching databases, the
                   //database password is *not* saved in the report and must be set at runtime if the database is secured. 
                   connectionInfo.setUserName(DBUSERNAME);
                   connectionInfo.setPassword(DBPASSWORD);
                   connectionInfo.setKind(ConnectionInfoKind.SQL);
                   table.setConnectionInfo(connectionInfo);
                   //Update old table in the report with the new table.
                   databaseController.setTableLocation(table, tables.getTable(i));
                   //databaseController.setTableLocation(tables.getTable(i), table);
    Attempt 2
             newConnectionInfo.setAttributes(propertyBag);
             connectionInfo.setUserName(DBUSERNAME);
             connectionInfo.setPassword(DBPASSWORD);
             //preserve subreport links
             SubreportController src = doc.getSubreportController();
             Map<String, SubreportLinks> linkMapper = new HashMap<String,SubreportLinks>();
             for(String subreportName : src.getSubreportNames()){
                 linkMapper.put(subreportName,
                     (SubreportLinks) src.getSubreportLinks(subreportName).clone(true));
             //If this connection needed parameters, we would use this field. 
             Fields<IParameterField> pFields = doc.getDataDefController().getDataDefinition().getParameterFields();
             replaceConnectionInfos(doc.getDatabaseController(), newConnectionInfo, pFields);
             IStrings strs = src.getSubreportNames();
             Iterator<String> it = strs.iterator();
             while (it.hasNext()) {
               String name = it.next();
               ISubreportClientDocument subreport = src.getSubreport(name);
               pFields = subreport.getDataDefController().getDataDefinition().getParameterFields();
               replaceConnectionInfos(subreport.getDatabaseController(), newConnectionInfo, pFields);
             //reconnect subreport links since when using replaceConnection links are erased
             for(String subreportName : src.getSubreportNames())
               src.setSubreportLinks(subreportName, linkMapper.get(subreportName));
    private static void replaceConnectionInfos(DatabaseController aDc, IConnectionInfo aNewConnInfo, Fields<IParameterField> aParameterField) throws ReportSDKException {
             ConnectionInfos cis = aDc.getConnectionInfos(null);
             for (IConnectionInfo oldConnInfo : cis)
               aDc.replaceConnection(oldConnInfo, aNewConnInfo, aParameterField, DBOptions._useDefault
                   + DBOptions._doNotVerifyDB);
    In both cases, the observed problem occurred. In one query the parameter was set properly, while on the other it was set to 0 (or empty string in case of string parameters). What is more, no data appeared on the print.
    Do you happen to know the reason of this issue?How can we fix the problem?
    Best regards
    Mateusz Błaż

  • Issue with Custom data parameter in Excel Data Connection

    Hello,
    We are querying a OLAP (SSAS 2008) cube using Excel 2007 by creating a data connection to SSAS server with an extended parameter “Custom Data”. We are using custom data parameter to apply our application’s user security to filter dimension
    members in Excel’s pivot table report. We have created a pivot table in Excel and the excel is including this custom data parameter along with each request that excel is submitting to SSAS.
    However, when the user selects “Show Properties in Report” option for a dimension which is selected in Row-axis of pivot table, Excel is not including custom data parameter . Why this “Custom Data” parameter is not being included in
    the request only for this specific case?
    1. The Request which sent from Excel to SSAS when user clicks on “Show Properties in Report” option
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Session xmlns="urn:schemas-microsoft-com:xml-analysis" SessionId="AE6B294B-4983-4010-BC5F-E0896A49ECD9"/></soap:Header><soap:Body><Discover
    xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>DISCOVER_LITERALS</RequestType><Restrictions/><Properties><PropertyList><Content>SchemaData</Content><Format>Tabular</Format></PropertyList></Properties></Discover></soap:Body></soap:Envelope>
    2. The sample Request which sent from Excel to SSAS for all other requests
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Session xmlns="urn:schemas-microsoft-com:xml-analysis" SessionId="74165AD6-C240-4634-92A1-61A400A3FC97"/></soap:Header><soap:Body><Discover
    xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>MDSCHEMA_CUBES</RequestType><Restrictions><RestrictionList><CUBE_NAME>RepCube</CUBE_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>QAV10_12thMay2010</Catalog><Timeout>5000</Timeout><SafetyOptions>2</SafetyOptions><MdxMissingMemberMode>Error</MdxMissingMemberMode><LocaleIdentifier>1033</LocaleIdentifier><DbpropMsmdMDXCompatibility>1</DbpropMsmdMDXCompatibility><CustomData>xxxxxx</CustomData></PropertyList></Properties></Discover></soap:Body></soap:Envelope>
    As the Custom Data parameter is missing in 1st request our application logic is throwing a custom exception to Excel and Excel is not able to understand the exception message. Excel is sending the same request repeatedly (going into infinite loop) and the excel
    window is freezed. Not able to work with excel until restarting the Excel.
    Can anyone help me to resolve the above? quick help is much appriciated!
    Thanks,
    Venkat

    Venkat,
    We have a very similar issue, but there is almost no material to help us. If this gets to you, please let me know if you progressed it or whether I need to go to Microsoft for a solution
    THanks
    David

  • Report from sql query invalid date condition

    Hi, I created a Reports From SQL Query. My sql is like
    "select column1, column2
    from myschema.tablename
    where mydate > :p_date1 and mydate < :p_date2"
    I am using portal with turkish and english option. If I pass p_date paramaters 'dd-MON-yyyy' format
    (for example p_date1 = 23-MAR-2003 p_date2 = 26-APR-2003) in english mode portlet is return correct result,
    in turkish mode 'No Row Returned'. I changed my sql statement with
    "select column1, column2
    from myschema.tablename
    where to_date(mydate,'dd/mm/yyy') > to_date(:p_date1,'dd/mm/yyy') and to_date(mydate) < to_date(:p_date2,'dd/mm/yyyy')"
    and I pass p_date parameters 'dd/mm/yyyy' format (for example p_date1 = 23/03/2003 p_date2 = 26/04/2003)
    but now turkish and english mode No row returned.
    How may I write correct sql statament. My database NLS_DATE_FORMAT=DD/MM/YYYY and NLS_LANGUAGE=TURKISH.
    thanks.

    Hi,
    Try this for turkish mode:
    Case 1: the 'mydate' column has a kind of a char data type (like char, varchar or varchar2)
    and a value like '30/03/2003'
    "select column1, column2
    from myschema.tablename
    where
    to_date(mydate,'DD/MM/YYYY') > :p_date1
    and
    to_date(mydate,'DD/MM/YYYY') < :p_date2"
    Case 2: the mydate column has a date type:
    "select column1, column2
    from myschema.tablename
    where
    mydate > :p_date1
    and
    mydate < :p_date2"
    In both cases use the following parameter values:
    p_date1 = 23/03/2003
    p_date2 = 26/04/2003
    This should work
    Thanks
    Peter

  • 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.

  • How to use the out parameter of a transformation

    Hi All,
    I have a requirement where I need to move all the transformations from process flows to map.SO for each transformation I need to have 1 map which calls this transformation.I have 1 transformation which has both input and output parameter.If I use this transformation in mapping then how to use the out parameter of thsi transformation.This out parameter needs to beused in other mappings.Can soemone please help me.
    Thansk in advance

    Hi,
    I'm not quite sure what you are trying to do.
    What works: Connect the outgroup of a pre- or post-mapping process operator to the mapping output parameter operator..
    What does not work: Connect the outgroup of an operator that can return more than one row (e.g. table operator, filter, joiner ,...) to the mapping output parameter operator. The mapping output parameter just returns "one row", like a pl/sql function call.
    You cannot pass a "data stream" from one mapping to another. Maybe the pluggable mappings is what you are looking for.
    Regards,
    Carsten.

Maybe you are looking for