Assigning a value to a parameter.

Hi all,
I am using CR XI, developping a report built upon a query in BW (using SAP Kit). The query in BW has a parameter PARAM1 of type string that comes automatically into my report but the type or the parameter is greyed. I can't change it.
In reality, I am expecting a date to be entered. It would be more user friendly to offer the user the calendar interface to select a value rather than the textbox for a string.
I can create a second parameter PARAM2 of type Date in CR, transform the input value to string but I do not know how to assign the result to PARAM1.
I have tried an assignment in a formula using beforereadingreports but no luck.
Does anybody know how to do this or if this is even possible ?
Thanks.

Thanks Graham - sorry it took me so long.
That is an interesting suggestion that I did not think of. I tried but for some reason the parameter for the report against BW does not show up in the link part of the subreport definition. I created a "fake" main report with a date type parameter, a formula to translate it to a string but no way to "assign" its value to the parameter in the original report.
Queries against SAP seem to have "specificities"...
In other words, i am still stuck !

Similar Messages

  • Conditionally assign a value to a parameter

    I'm using this code to conditionally assign a value to a parameter p_data_type:
    <?if:H_ACCOUNT_HIER_DESC='EST'?><xsl:param name="p_data_type" select="'number'" xdofo:ctx="begin"/> <?end if?>
    <?if:H_ACCOUNT_HIER_DESC='PAR'?><xsl:param name="p_data_type" select="'text'" xdofo:ctx="begin"/> <?end if?>
    However, I'm getting the following error.
    Caused by: oracle.xdo.parser.v2.XMLParseException: Duplicate variable 'p_data_type' definition.
    Once I get this working, I want to use it as follows:
    <?sort:current-group()/ACCOUNT_SEQ;'ascending';data-type='{$p_data_type}'?>
    Does anyone have any suggestions on how I might do this?
    Thank you,
    Tam

    Thanks, Vetsrini. Works great. I do have one further question if you don't mind. In the <xsl:when test...>condition below, why is the '//' reference required for H_ACCOUNT_HIER_DESC. The code didn't work unless I used the '//'
    Here is my template code:
    <?import:xdo://XXFIN.XXFIN_PSB_NUMBER_FORMAT.en.CA PROVINCE?>
    <?start:body?>
    <?for-each:XXFIN_PSB_GOS_EXP_ANNUAL_ACT_SUM?>
    <?for-each:G_HEADER_PAGE?>
    <xsl:variable name="p_data_type">
    <xsl:choose>*<xsl:when test="//H_ACCOUNT_HIER_DESC='EST'">*<xsl:value-of select="'number'"/></xsl:when><xsl:otherwise><xsl:value-of select="'text'"/></xsl:otherwise></xsl:choose>
    </xsl:variable>
    Here is my XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <XXFIN_PSB_GOS_EXP_ANNUAL_ACT_SUM>
    <P_OUTPUT>E17-1</P_OUTPUT>
    <P_ACCOUNT2_HIGH>
    <G_HEADER_PAGE>
    <H_RECIPIENT_NAME/>
    <H_PROG_SUM_LEVEL>SV/SP</H_PROG_SUM_LEVEL>
    <H_ACCOUNT_HIER>AC0000</H_ACCOUNT_HIER>
    <H_ACCOUNT_HIER_DESC>EST</H_ACCOUNT_HIER_DESC>
    Thanks again for your help.
    Tam

  • How to assign a value to a parameter {?MyParam} dynamically?

    How to assign a value to a parameter {?MyParam} dynamically?
    Example:
      {?One_Or_Two}  <- my first parameter
      {?MyParam}       <- My second parameter
    The Code:
    If ( {?One_Or_Two} = 'One'  then
        {?MyParam}  = 'One' ;
    else 
        {?MyParam}  = 'Two' ; 
    (THIS IS NOT WORKING FOR ME!  ANYONE KNOW WHY?)
      IT NEVER ASSIGN THE VALUE?
    My Command query looks like:
    SELECT * FROM MyTable
        WHERE MyTable.MyColumn = {?MyParam}
    THANKS

    Hi Joseph,
    I'm a bit unclear as to what you are doing and from what I see you're running in circles. 
    Your Command query is looking for a field that is equal to {?MyParam}. 
    Now you want to take {?MyParam} in the report and change the value after you've set it. 
    Parameters cannot be set from the Command, you can format it and manipulate it but they cannot be set except from the parameters window or from a front-end. 
    Thanks,
    Brian

  • Can we assign two values to the same parameter? If yes how? For details ple

    Can we assign two values to the same parameter? If yes how? For details please go through the following SAP related program.
    Here I need to print 2 queries using the same parameter "QUERY" the value assigned to this parameter(query) is REPORT_TEST1. I want to assign one more value to this Parameter. Is is possible? This question may sound stupid if it is not possible please kindly reply.
    I want to do this to print two documents(values) with a single command (parameter)
    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    <param name="QUERY" value="REPORT_TEST1"/>
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    Hi,
    Try assigning two values seperated by a delimiter ( say '|') to the same parameter.
    In the function get the parameter value and seperate the values using the same delimiter.
    <param name="QUERY" value="REPORT_TEST1|REPORT_TEST2"/>
    Regards,
    Uma

  • Can we assign two values to the same parameter? If yes how?

    Can we assign two values to the same parameter? If yes how? For details please go through the following SAP related program.
    Here I need to print 2 queries using the same parameter "QUERY" the value assigned to this parameter(query) is REPORT_TEST1. I want to assign one more value to this Parameter. Is is possible? This question may sound stupid if it is not possible please kindly reply.
    I want to do this to print two documents(values) with a single command (parameter)
    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    <param name="QUERY" value="REPORT_TEST1"/>
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    Hi,
    Try assigning two values seperated by a delimiter ( say '|') to the same parameter.
    In the function get the parameter value and seperate the values using the same delimiter.
    <param name="QUERY" value="REPORT_TEST1|REPORT_TEST2"/>
    Regards,
    Uma

  • Can I assign a default value to a parameter like C++ ?

    My question is whether I can assign a default value to a parameter in Java? Let's say : public void myMethod(int p1, int p2=3){...} Is this syntax acceptable ?
    Regards,
    WenBin

    I don't think so (the easiest way to find out is to try), but if you want something like that, most people do it like so:
    private static final int DEFAULT_P2 = 3;
    public void myMethod(int p1)
        myMethod(p1, DEFAULT_P2);
    public void myMethod(int p1, int p2){...}Hope this helps,
    Radish21

  • Oracle how to assign a date value in a parameter declaration

    How can I assign a date value to a parameter declaration in SQL?
    Here's my existing script.
    CURRENT:
    select distinct summary as "iCash EAD Error Summary",count(*)
    from AAA.BKS_ICASH_EAD_ERRORS
    where creation_date > to_date('5/26/12 8:50','mm/dd/yy HH24:MI')
    group by summary
    I'd like to assign the date I'm searching for into a parameter and use the parameter in my query.
    GOAL:
    DECLARE
    pCreateDate DATE;
    exec :pCreateDate := '5/26/12 8:50';
    select distinct summary as "iCash EAD Error Summary",count(*)
    from AAA.BKS_ICASH_EAD_ERRORS
    where creation_date > to_date(:pCreateDate,'mm/dd/yy HH24:MI')
    group by summary

    Hi,
    In SQL*Plus, you can do this:
    VARIABLE     pcreatdate     VARCHAR2 (20)
    EXEC           :pcreatedate := '5/26/12 8:50';
    SELECT    summary          AS "iCash EAD Error Summary"
    ,       COUNT (*)          AS "Total Count"
    FROM        aaa.bks_icash_ead_errors
    WHERE       creation_date  > TO_DATE (:pcreatedate, 'MM/DD/RRRR HH24:MI')
    GROUP BY  summary
    ;"GROUP BY summary" means you'll get one output row for each distinct value of summary. There's no need to SELECT DISTINCT since the GROUP BY is already making sure the rows are distinct.
    There are no DATE bind variables in SQL*Plus, so you have to use a VARCHAR2.
    If you do something similar in PL/SQL, then you can use a DATE variable. Make sure you don't call TO_DATE on something that's already a DATE.
    Edited by: Frank Kulash on Jun 26, 2012 2:01 PM

  • Error: Missing initial value for session parameter

    Hi,
    I'm facing a problem while running the ETL process for Complete 11.5.10 Execution Plan in DAC Client. Some tasks are getting failed beacuse of the following error:-
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: VAR_27026 [Error: Missing initial value for session parameter:[$DBConnection_OLAP].].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: CMN_1761 [Timestamp Event: [Mon Nov 19 21:01:52 2007]].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: TM_6270 [Error: Variable parameter expansion error.].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: CMN_1761 [Timestamp Event: [Mon Nov 19 21:01:52 2007]].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: TM_6163 [Error initializing variables and parameters for the paritition.].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: CMN_1761 [Timestamp Event: [Mon Nov 19 21:01:52 2007]].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: TM_6226 [ERROR:  Failed to initialize session [SDE_ORA_Product_Category_Derive_Full]].
    ERROR : LM_36320 [Mon Nov 19 21:02:08 2007] : (2108|2632) Session task instance [SDE_ORA_Product_Category_Derive_Full]: Execution failed.
    When i checked the parameter file i can see the value assigned to the $DBConnection_OLAP. The same tasks ran successfully when i ran the ETL process for Complete 11.5.10 for the first time. I did not change anything after that and also all these are came built-in with the installation of Oracle BI Applications.
    Please anyone give me an idea what is causing the problem.
    Thanks,

    in DAC > Run History > Task Details, query
    Name = SDE_ORA_Product_Category_Temporary
    Open Status Description, look for string -lpf, the file after it is the actual parameter file DAC send to INFA server. E.g
    -lpf D:\DACTOPUS\Informatica\parameters\SDE_ORAR12_Adaptor.SDE_ORA_Product_Category_Temporary.txt
    Open the parameter file, most likely the [session_name] does not match with SDE_ORA_Product_Category_Derive_Full or some parameters are missing.

  • How to check for null value of output parameter?

    Hi guys, I get a test procedure with 2 output parameters and do nothing:
    CREATE OR REPLACE PACKAGE BODY p_parameters_test AS
      PROCEDURE p_null_output_basetype(p1 OUT NUMBER,p2 OUT VARCHAR2)
      AS
      BEGIN
        DBMS_OUTPUT.PUT_LINE('DO NOTHING');
      END p_null_output_basetype;
    END;And I have below C# code:
    cmd.CommandText = "p_parameters_test.p_null_output_basetype";
    OracleParameter p1 = new OracleParameter("p1", OracleDbType.Decimal, System.Data.ParameterDirection.Output);
    OracleParameter p2 = new OracleParameter("p2", OracleDbType.Varchar2, System.Data.ParameterDirection.Output);
    cmd.Parameters.Add(p1);
    cmd.Parameters.Add(p2);
    try
        conn.Open();
        cmd.ExecuteNonQuery();
        if (p1.Value==null)
            Console.WriteLine("p1.Value==null");
        else if (Convert.IsDBNull(p1.Value))
            Console.WriteLine("Convert.IsDBNull(p1.Value)");
        else
            Console.WriteLine("p1 else "+p1.Value);
        if (p2.Value==null)
            Console.WriteLine("p2.Value==null");
        else if (Convert.IsDBNull(p2.Value))
            Console.WriteLine("Convert.IsDBNull(p2.Value)");
        else
            Console.WriteLine("p2 else "+p2.Value);
        Console.WriteLine("finished");
    catch......The output of it is:
    p1 else null
    p2 else null
    Does anyone have any idea why it always goes to the 'else' of the condition-branching, and how can I check if the output parameter is null?
    Thanks in advance.

    Morven... I ran into similar problems. Maybe you've found a solution of your own by now, but here's what I've learned...
    The Value property of output parameters, like p1 and p2 in your code, actually varies, according to (I think) the OracleDbType of the parameter. You've got OracleDbType.Decimal for p1 and OracleDbType.Varchar2 for p2. These look about right, since they match the parameter types in your actual stored procedure.
    After cmd.ExecuteNonQuery() executes, the respective Value properties of p1 and p2 are actually of different types. For p1, it's going to be "OracleDecimal" and for p2 it's "OracleString". Keep in miind that these are the types of the Value property of the OracleParameter objects, not the OracleParameter objects themselves.
    OracleDecimal and OracleString (and some other types like OracleDate, etc.) have an "IsNull" property you can use if you cast the Value property to its runtime type...
    if ((OracleDecimal)cmd.Parameters["p1"].Value).IsNull) { …do something… }
    else { …do something else… }
    Or maybe something like this...
    Decimal p1val = ((OracleDecimal)cmd.Parameters["p1"].Value).IsNull ? 0 : ((OracleDecimal)cmd.Parameters["AVG_SALARY"].Value).Value;
    I'll admit that expressions like this: ((OracleDecimal)cmd.Parameters["AVG_SALARY"].Value).Value look a little weird. But the "Value" of the "OracleDecimal" property is a regular .NET decimal type (System.Decimal). So, it's a "Value" of the "Value" property of the OracleParameter class.
    Even when the stored procedure returns a null, the Value property is still populated. In the case of p1, it's populated with an OracleDecimal object (actually a struct) where IsNull is true. That's why "p1.Value==null" tests false.
    From what I can see, OracleDecimal, OracleString, etc. will never be typed as DbNull, or DBNull.Value. So, that would be why Convert.IsDBNull(p1.Value)) always returns false. btw, it appears that these are Value types. That would suggest that coding something like like this, should be avoided…
    OracleString p2val = ((OracleString)cmd.Parameters["p2"].Value;
    if (p2val.IsNull) { …do something… }
    else { …do something else… }
    By assigning the value to another variable, you’d be actually creating an entire copy of the OracleString structure, which is pointless.
    I hope that helps
    Edited by: 897674 on Jan 3, 2012 10:44 AM
    Edited by: 897674 on Jan 3, 2012 10:46 AM

  • Passing a value to a Parameter Field From a VB Form

    Post Author: as1971
    CA Forum: General
    Hello everyone
    I'm using Visual Basic 6.0 and Crystal Report 9.0
    I built a report using Crystal Report and named it Player_Statement.rpt. I then included it to my VB project and named it Player_Statement.Dsr
    In this report I have a Parameter Field called P_Player_ID which I'm using in Record Selection Formula.
    I'm using the following code to pass a value to the parameter:
    Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue CLng(cmbPlayerNB.BoundText)
    When I execute the application I get the error message "The value or range you are adding has already existed" at the last line of code (Where I'm assigning the parameter a value)
    Could anybody help me please

    Post Author: VinoTinto
    CA Forum: General
    Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.GetItemByName("P_Player_ID").ClearCurrentValueAndRange                                               Report.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue = CLng(cmbPlayerNB.Boundtext)

  • Assign Javascript Value to JSP

    I have a dynamic link that links to a Javascript function:
    test
    The javascript function:
    function frames(testing)
    <%=testHere%> = testing
    <%
    HttpSession testSession = request.getSession(true);
    testSession.putValue("tested", testHere);
    %>
    I want to assign the javascript value, testing, into JSP value,testHere, which will be place in the session, which is :~
    .......putValue("tested", testHere).
    Does anyone know how to solve it? =)
    Thanks in advance...

    You can't. As is stated here about 3 times a day, Java, the JSP code, and servlets run on the Server, while javascript runs on the client (in the browser). By the time javascript begins to run, the JSP is compiled, run, the response generated and sent to the browser as HTML.
    The only means to do this is to send the variable back to the browser by requesting the same or another page and including the javascript value as a parameter to that page.

  • Assigning Javascript value to ABAP variables

    Hi Experts,
    I have written the HTML code mixed with Javascripts to create a table in the 'View' of a BSP Component.
    I was able to set the value of assign the value of ABAP parameters into HTML fields.
    This table has some input fields. I need to fetch the value of input parameters which has been entered by screen on an event which is present in Overview Page.
    I can calulate the value mentioned in input field but i am not able to assign the same value to ABAP parameter for further processing.
    I have already referred the following link but it did not work.
    Assign Javascript variable to Abap variable
    Please help me how i should i acheive it.
    Thanks In Advance,
    Rajeev Singh

    Hi,
    I am not understanding your problem and what you want due to description, but it seems to be very similar to a post which I answered very recently [here|How to return values from a BSP page to Javascript;.

  • Assigning a value to screen field

    Hi,
      Anybody knows how to assign a value to a field in a standard transaction without using parameter ID.
    Pionts will be awarded.
    Thanks,
    lakshmi.

    Thank you so much Rich & eswar. here is my problem.
    Actually I am updating this field based on the contract starts date and material group using one user exit.But this field is geting updated whenever there is a change to this field.it is not geting updated in other cases that is "it is geting updated if you are changing the contents of the filed or giving a new value".
    But I want this field updated all the times.
        So I thought I will assign a dummy value to this filed before I update it.For this We need a parameter id. but it is not there. So I am searching for other solution.
      Can you please help me.
    Regards,
    Lakshmi

  • Assign a value to a global variable - form personalization

    Hi All,
    We have a requirement in which we want to display a message depending upon the out parameter of the procedure in form personalization.
    We are using 'Builtin' with the buitin type 'Execute a Procedure'.
    And the argument passed is :
    *='declare
    l_request_id Number;
    l_out_come VARCHAR2(10);
    begin
    apps.xx_sr_email_pkg1.xx_sr_email_p1
    ('''||${GLOBAL.XX_CUST_ACCOUNT_ID.VALUE}||''',
    '''||${GLOBAL.XX_INCIDENT_ID.VALUE}||''',
    '''||${GLOBAL.XX_EMAIL_TYPE.VALUE}||''',l_request_id);
    :GLOBAL.XX_REQUEST_ID := l_request_id;
    end'*
    But its not assigning the value of l_request_id to the gloabal variable XX_REQUEST_ID.
    Can you please help?
    Thanks

    I don't have a solution but a work around.
    What if you create a function that accepts the same in parameters and returns the message.
    And then you create an action of the type message and in the message you call the function such as
    = select xx_sr_email_pkg1.sr_email_f1 .... from dual
    Sandeep Gandhi

  • How to assign a value to the page variable to enable partial page rendering

    This is part of my code:
    <bc4j:rootAppModuleScope name="App1"
    rendered="on@ctrl:page">
    Now, I want to change the value of "on@ctrl:page" to "true" after user click a button so that part of the page will be displayed. But how do I assign the value to "on@ctrl:page". I tried to put the followings in my even handler:
    <bc4j:setPageProperty name="on" value="true">
    <bc4j:parameter name="on" />
    </bc4j:setPageProperty>
    But it doesn't work. Could someone pls tell me how I should do it.
    Thanks a lot!
    Ling

    You should do is:
    in your event handle codes,you add the list:
    public static EventResult eventname(
    BajaContext context,
    Page page,
    PageEvent event) throws Throwable
    EventResult result = new EventResult(page);
    result.setProperty("on","true");//or "false"
    return result;
    then,
    change
    rendered="on@ctrl:page" -> data:rendered="on@ctrl:eventResult"
    also ,you should see the 5th part of 'UIX Developer's Help'

Maybe you are looking for

  • Why does for-each not work with Enumeration?

    I'm sure there's some reason for this but I don't know what it would be. I am calling an existing method [http://java.sun.com/javase/6/docs/api/java/util/zip/ZipFile.html#entries()] And it returns Enumeration<? extends ZipEntry> What I would like to

  • Wireless users getting disabled

    Hi, I have WLC 4404 with 7.0.116.0 version. I was getting following messages for particular APs *Dec 20 14:11:13.875: %LINK-5-CHANGED: Interface Dot11Radio0, changed state to reset *Dec 20 14:11:13.908: %LINK-3-UPDOWN: Interface Dot11Radio0, changed

  • How to get the best from Lightroom with my Nikon D700

    I am having real trouble with the results from Lightroom from my Raw files. I love Lightroom but am going to have to use another program unless I can figure out what to do. Can anyone give me any advice? I have never had to use presets etc. so am in

  • Add selection criteria to Billing due date list VF04

    Dear gurus, I need to execute report VF04  but looking sales documents by material. is there any enhacement point or user-exit to add this option to program? Thank in advance. Best regards Juan

  • How to update Mac OS X 10.5.8 to 10.6.8?

    I have an Imac that has OS 10.5.8 version but needs the 10.6.8 version to be able to update to the latest Itunes. How do I do this? It says all updates have been installed?