Assigning a DataProvider filter value with JavaScript

I have a "Fiscal Yr/Period" filter characteristic in my web application that I am assigning the value of the current month and year when the web application is loaded.  In other words, this filter is applied to the DataProvider when the application loads (code below):
<object>
         <param name="OWNER" value="SAP_BW"/>
         <param name="CMD" value="SET_DATA_PROVIDER"/>
         <param name="NAME" value="C_LPR_Q018"/>
         <param name="QUERY" value="C_LPR_Q018"/>
         <param name="INFOCUBE" value="ZPP_C01"/>
         <param name='FILTER_IOBJNM' value='0FISCPER'/>
         <param name='FILTER_VALUE' value='H12004010'/>
         DATA_PROVIDER:             C_LPR_Q018
</object>
As you can see above, the value for the '0FISCPER' object is hardcoded and thus requires me to change this monthly.  I have written some JavaScript code to calculate the current mo. and yr. however I can't get my JavaScript variable that holds the value I need assigned to the FILTER VALUE.  Can I even assign a JavaScript variable as the filter value?  Is there another way?  Any help would be greatly appreciated.

Hi Allen,
if you want to change any param of an object, try the function SAPBWOpenURL, which should be sent against the object you want to change. Documentation is at :
http://help.sap.com/saphelp_bw33/helpdata/en/f1/0a5a2ee09411d2acb90000e829fbfe/frameset.htm -> Business Explorer ->
Web Application ... -> Befehl URLs
Concat the date in JavaScript and call
SAPBWOpenURL(SAP_BW_URL_Get()+'&item=...&FILTER_IOBJNM="0FISCPER"&FILTER_VALUE="TheDateYouWant"') (I hope I set the " and ' correctly, better you should check).
For example you can insert :
<HEAD>
<script>
    function callTheTableWithTheDate()
        SAPBWOpenURL(like above);
</script>
</HEAD>
<BODY onload="JavaScript:callTheTableWithTheDate()">
It's only a hint, adjust it for your requirements. You can save the date in a cookie too and reuse it whenever you want. You know how to handle cookies ?
    Bye
    Ralf

Similar Messages

  • Change "choiseListe" values with javascript

    Dear,
    Is it possible to change "choiseListe"  values  with javascript.
    Exemple il have a choseListe :
         Country //// Values
          USA            us
          France         fr
          Spain           sp
    When il click in a botton i whant to change this choceListe :
         Country //// Values
          Morocco           ma
         Portugal           pt
    Thanks

    Hi,
    Listboxes and dropdowns can be scripted against without too much difficulty.
    You would need something like this in the click event of the button:
    listbox1.rawValue = null; //clear previous choice
    listbox1.clearItems(); //clear the list items
    listbox1.addItem("Moocco", "ma"); //add new list items
    listbox1.additem("Portugal", "pt");
    Hope that helps,
    Niall

  • Change TextView value with Javascript

    Hello,
    I'm trying to find a way of changing the value of an HTMLB TextView on the client side with javascript.
    Do you know how to do that ? Cannot work it out...
    Many thanks
    Nicolas

    Hi,
    this can be a bit tricky, because you have to know, how to access the element. that means you need an unique id or an absolute position of the TextView-element
    if you can see, how to access the specific element in your client-pagesource, a possible javascript could be:
    document.getElementById("<id of element>").firstChild.nodeValue="My new Text"
    or access by name/count of the element:
    document.getElementsByName("<name of element>")[#position of occurance].firstChild.nodeValue="My new Text"
    kr, achim

  • Getting hidden value with javascript problem

    <html>
    <body>
    <form>
    <input type="hidden" id="code" value="123">
    </form>
    </html>
    when open the html file and type "javascript:alert(document.getElementById("code").value)" in the address bar, I get a message box with "123".
    but when i do in the jsp with
    <input type="hidden" id="code" value="<%=request.getParameter("code")%>">
    and type the javascript in the address bar, i get "object not supported".
    Can anyone tell me how to get hidden value in jsp with javascript?
    thank you.

    There is no difference between a JSP or plain html, since javascript executes on the client side after the JSP is done processing. There is obviously something wrong with the HTML content after you input the request value, so check the generated HTML in your browser to see if there are any unwanted quotes in there or something.

  • Use condition for assigning query to data provider with Javascript

    Hi gurus,
    I want to assign a query dynamically to a data provider when the user activated a Tab Panel in a Web Template (BI7).
    I can do that easily with the standard function SET_DATA_PROVIDER_PARAMETERS but this action is do each time of the activation of the Tab Panel.
    So I try to make a javascript for assign the query to the data provider only one time.
    My problem is I havenu2019t found a solution to get the default query assigning to the data provider.
    Itu2019s an example of what I try to do with javascipt :
    function Load_Query()
    var r=GET_DATA_PROVIDER PARAMETER ("QUERYVIEW_DATA_PROVIDER")
    if (r <>empty)
        executeJS_SET_DATA_PROVIDER_PARAMETERS_R()
    Thank you for help,
    Franck

    Hi Janice,
    You can check the Option Display Variable values only once.
    Thie you will the variables being displayed only once eventhough they are used in Multiple Data provider.
    If you want som variable to be data provider specific, then , you can create a new variable and add it int eh query.
    For example in your case let us say COMP1 is the variable for company code used in DP1 and DP2.
    If you want a different values to be selected for company code in DP1 and DP2 just replce the variable in DP2 with a new variabel COMP2.
    Hope this helps.
    Regards.
    Shafi.

  • Retaining BSP Page values with Javascript popup window

    Hi Experts
    We are using a customized BSP application for our performance
    Management. To propmt users for saving their appraisal documents
    before a session timeout,we used an Javascript popup message(alert
    window). This window doesnot affect the BSP page in any way.(code
    provided below)
    Per changed requirement,we now have to retain the BSP page values once
    the user clicks 'OK' on this javascript popup window. I used the page
    refresh option with script. But this is erasing the earlier values.
    Can anyone tell me,how i can holdback the BSP page values after the
    user action on the popup window. If a piece of code is provided,it
    would be greatly appreciated.
    Thanks in Advance
    Alan
    Existing code for timeout popup
    javascript code
    function remind (){
    var msg = "Your Session will expire in the next 10 minutes. Please
    save your data.";
    alert the msg(using alert box)
    <%
    data: v_rem type string.
    DATA: port TYPE STRING.
    data: l_timer type string.
    port = request->get_header_field(
    if_http_header_fields_sap=>server_port ).
    DATA: services TYPE TABLE OF ICM_SINFO.
    CALL FUNCTION 'ICM_GET_INFO' TABLES SERVLIST = services.
    FIELD-SYMBOLS: <service> TYPE ICM_SINFO.
    DATA: wait TYPE STRING.
    READ TABLE services ASSIGNING <service> WITH KEY service = port.
    wait = <service>-KEEPALIVE - 10.
    CONDENSE wait.
    ****Start Changes: Timeout
    **l_timer = wait * 60 * 1000.
    l_timer = 1 * 60 * 1000.
    ****End Changes
    concatenate `'remind(` wait `)',` l_timer into v_rem.
    %>
    <htmlb:content design            = "DESIGN2002+DESIGN2003"
                   sessionManagement = "TRUE"
                   controlRendering = "SAP">
    <htmlb:page title = "<%= otr(ZPMDGL/TITLE_DOCUMENT) %>"
                  disableBackspaceNavigation = "TRUE" onLoad pass v_rem as a  parameter to setTimeout
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:32 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:34 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:35 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:36 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:36 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:37 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:38 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:39 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:40 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:40 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:44 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:46 AM

    If the BSP page is refrehed, all the user input it sent back to the server. If you don't do anything special, the input is lost and not sent back to the client again. You can go to your controller class' DO_HANDLE_DATA to read the user input, and store it in the controller class to send it back to the client.
    If you don't use controller classes, the equivalent would be onInputProcessing. A more advanced alternative would be to use MVC model binding, which would do most of the stuff automatically for you.

  • Capturing form values with javascript (not working in Safari!)

    Hi
    I'm working on a site and I need to be able to take the values of one form (that the user has entered) and use them to populate a second form (more details) in the appropriate input boxes. This works on all browser except Safari. It seems to me a javascript problem (as getElementById does not work properly) but I'm not entirely sure. The code I use to grab the form elements is as follows:
    obj = $('formslider".$this->id."');
    obj.getElementById('registerfirstname".$this->id."').value = callbackfirstname".$this->id.";
    obj.getElementById('registersurname".$this->id."').value = callbacksurname".$this->id.";
    obj.getElementById('registeremail_addr".$this->id."').value = callbackemail".$this->id.";
    obj.getElementById('registertelephone".$this->id."').value = callbacktelephone".$this->id.";
    obj.getElementById('registerrequest_type".$this->id."').value = requesttype_callback".$this->id.";
    This basically takes the values of the "callback" form and places them into the appropriate input boxes of the "register" form. However it seems to lose the values when moving to the next form. Please note, I am not refreshing - I am using Ajax to change the form so new content simply replaces an existing content, not transfering to another page. I use Sessions so it shouldn't forget the values.
    Can anyone help? It's quite an important thing as I need to migrate hidden form inputs too which are needed for this particular request system.
    Thanks
    Michael

    I'm seeing this same issue in Mavericks, 10.9.2.  Althought JavaScript is enabled in Safari, it just doesn't work, for any pages.
    I've tried different user accounts, including a new account, on the same machine, but they all do the same thing, so it's a machine-wide issue.
    I have plenty of other Mavericks machines, including my own, where it is working just fine, however, with the same settings.

  • Filter Subgrid with Javascript - MS CRM 2013

    Hi,
    I want to filter a subgrid.
    My code :
    function FilterCasesSubgrid() {
    var CasesSubgrid =Xrm.Page.getControl("lots_associes");
    if(CasesSubgrid==null){
    setTimeout(function () { FilterCasesSubgrid(); }, 2000); //if the grid hasn’t loaded run this again when it has
    return;
    var fetchXml ="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
    "<entity name='new_lot'>"+
    "<attribute name='new_name' />"+
    "<attribute name='new_nomduprogramme' />"+
    "<attribute name='new_villelookup' />"+
    "<attribute name='new_loyertotal' />"+
    "<order attribute='title' descending='false' />"+
    "<filter type='and'>"+
    "<condition attribute='new_name' operator='eq' value='004' />"+
    "</filter>"+
    "</entity>"+
    "</fetch>";
    //Here i set the fetchxml directly to subgrid
    alert("1");
    CasesSubgrid .control.SetParameter("fetchXml", fetchXml); //set the fetch xml to the sub grid
    alert("2");
    CasesSubgrid .control.Refresh(); //refresh the sub grid using the new fetch xml
    with that I only have the first alert who says '1'. The last alert isn't displayed and the subgrid isn't modified.
    Do you have any idea?

    hey even i am facing the same issue..apparently this works only for Internet Explorer and not chrome or firefox...
    i even  tried with  Xrm.Page.ui.controls.get() and Xrm.Page.getControl() both didn't work for me
    //var SubscriptionGrid = Xrm.Page.ui.controls.get("Subscriptions");
    //var InvoiceGrid = Xrm.Page.getControl("Invoices");
    Does anybody have any suggestions for it.

  • Verify if a report has a null column value with JavaScript ?

    Hi,
    I have report. User can add new rows through a form. Before the user leaves the application I would like to use JavaScript to check if a certain column has some null values. I built my JavaScript for the before logout and it's working properly, but I need to retrieve if that column has some null values, how can I do that ? This field isn't a mandatory one, but I would just like to alert the user.
    Thank you.

    You can also use a TRIM function in Answers. Go to the column in question, click on the fx button and then on the Function button. Click on String and you will see TrimLeading, TrimTrailing and TrimBoth. Use TrimTrailing on your column and you should be good to go.

  • How can i get the h:selectOneRadio value with javascript

    Hi all.
    I have this code
    <h:selectOneRadio id="color" style="font-family: Arial;font-weight:lighter;font-size: 12px" onclick="showColor()" >
    <f:selectItem itemLabel="RED" itemValue="1" />
    <f:selectItem itemLabel="BLUE" itemValue="2" />
    </h:selectOneRadio>
    And javascript function is
    function showColor()
    var tipoRelacion = document.getElementById("form:color").value;
    alert("color" + tipoRelacion);
    And what i get is that color is undefined. How can i get the value of the selected radio?
    Thanks a lot

    you just need to pass this while calling javascript function
    check this-
    <h:selectOneRadio id="color" style="font-family: Arial;font-weight:lighter;font-size: 12px" onclick="showColor(this)" >
    <f:selectItem itemLabel="RED" itemValue="1" />
    <f:selectItem itemLabel="BLUE" itemValue="2" />
    </h:selectOneRadio>
    And javascript function is
    function showColor(obj)
    var val = obj.value
    alert("color" +val);
    }

  • Filter value with wildcards

    Hello there
    I have a table called phone_shop_tab
    ID MODEL CHANNEL
    001 NOKIAn95 3g
    002 % gsm
    003 nokian97 %
    004 nokian97 gsm
    005 % %
    006 % 3g
    i have to select all from phone_shop_Tab if i pass
    MODEL= <value> and CHANNEL = <value>
    Here % is any values
    I should get the output with the follwing constraints
    % denots any value passed . for example % in the MODEL column means that it is OK for any MODEL value passed to the query.
    if i fliter with MODEL= 'NOKIAn97' and CHANNEL = 'gsm' it should select 4th row because it exacly matches the filer
    if i fliter with MODEL= 'NOKIAn97' and CHANNEL = 'XXX' it should select 3th row because it matches model (nokian97) also channel (%) here XXX= %
    if i fliter with MODEL= 'BAC' and CHANNEL = '3g' it should select 6th row because it matches model (%) also channel (3g) ,here BAC = %
    if i fliter with MODEL= 'ABC' and CHANNEL = 'XYZ' which are both not in the table it should select 5th row because it matches model (%) also channel (%) because % mean any value
    hope you all understand the output scinario
    can anyone provide with an SQL statment for this.
    thanks
    prash

    Hi,
    This does what you requested:
    SELECT     *
    FROM     phone_shop_tab
    WHERE     UPPER (:p_model)     LIKE UPPER (model)
    AND     UPPER (:p_channel)     LIKE UPPER (channel)
    ;You said, for example:
    if i fliter with MODEL= 'NOKIAn97' and CHANNEL = 'gsm' it should select 4th row because it exacly matches the filerIf :p_model='NOKIAn97' and :p_channel='gsm', this will indeed returrn the row where id=004. It will also return the rows where id IN (002, 005).
    If you meant that it should only return the best match (however you define "best"), then use the analytic RANK (or perhaps ROW_NUMBER) fucntion to arrange the rows found in "best first" order, then pick the ones labeled 1.
    For example:
    WITH     all_matches     AS
         SELECT     p.*
         ,     RANK () OVER ( ORDER BY  CASE WHEN model   = '%' THEN 2 ELSE 1 END
                          ,      CASE WHEN channel = '%' THEN 2 ELSE 1 END
                        ) AS rnum
         FROM     phone_shop_tab     p
         WHERE     UPPER (:p_model)     LIKE UPPER (model)
         AND     UPPER (:p_channel)     LIKE UPPER (channel)
    SELECT     *     -- or list all columns except rnum
    FROM     all_matches
    WHERE     rnum     = 1
    ;

  • Matching a filter value with mutiple fact columns

    Hello,
    I have been given following requirement to implement in OBIEE dashboard. There is a dimension table which stores Sales Rep IDs and their names. Fact table stores the Sales opportunities identified by these sales reps. Now they can work on the opportunity in any role...say as consultant or primary rep or some other role. Lets call it Role1, Role2 and Role3. The requirement is when user selects a Sales rep name in the filter; the dashboard should show all those opportunities on which he worked in any of the capacities i.e.Role1 or 2 or 3.
    My Fact table has following columns
    Role1_Sales_Rep_ID
    Role2_Sales_Rep_ID
    Role3_Sales_Rep_ID
    The Dimension has
    Sales_Rep_ID
    Sales_rep_Name
    I tries putting following condition ion physical layer join
    Dim.Sales_Rep_ID = fact.Role1_Sales_Rep_ID
    Or Dim.Sales_Rep_ID = fact.Role2_Sales_Rep_ID
    Or Dim.Sales_Rep_ID = fact.Role3_Sales_Rep_ID
    but the RPD gives an error saying that Dim.Sale_Rep_ID used more than once. Please help me solve this scenarion or please suggest any alternate solution.
    Thanks,
    Vivek.

    Hi vivek,
    but the RPD gives an error saying that Dim.Sale_Rep_ID used more than once. Please help me solve this scenarion or please suggest any alternate solution. Ya the joins should be established correctly to achieve your scenerio,i.e here oneto many joins sud be established for example
    take the three fact tables role1,role2,role3 and the dimension table first click the dimension table and join it to role1 so it becomes 1:N the same way again click dimension table and click the role2 and repeat the process then you can achieve what you want.
    Another simpler work around is take all the fact tables into single folder/table and the important columns for your requirment.Then now 1 fact and 1 dimension so its simple for you.
    Hope it helps you.
    Best Wishes,
    Kranthi.

  • WAD - Exclude more than one value with filter button

    Hi guys
    I have been working on a web template with a button to set a filter to exclude two values. E.g. I want to exclude both the values '28' and '30' from the dataprovider.
    What I have done is insert a button group item, create a button with the command SET_SELECTION_STATE_SIMPLE to exclude '28' as command 1 and SET_SELECTION_STATE_SIMPLE to exclude '30' as command 2. This does however not give me the correct result, as it only excludes '30' as set in command 2. So the conclusion must be that SET_SELECTION_STATE_SIMPLE can not be used, as it will only work with one value.
    So I went on and tried with SET_SELECTION_STATE which gives the possibility to choose more than one filter value. However it does not seem possible to exclude values with this command?
    Is it not possible to exclude two filter values with a button in a BI 7.x web template?
    BR
    Stefan.

    Dear Frank
    I did it as like as the following link lead me:
    http://www.oracle.com/technology/obe/obe11jdev/11/adfbc_new_features/adfbc.html
    The problem has been appeared when I attached the "Create" button and when press on it to create new record, then the "LOV" couldn't work correctly.
    Thanks for your reply

  • Changing Filter Values from Macro in BW 7.0

    Hello,
    in my Workbook I need to change Filter Values of some queries in runtime.
    The first thing I found was BEx API reference for BW 3.5, but I wasn't able to make these functions work. After all I found this code:
        Dim BEx As Object
        Set BEx = Application.Run("BExAnalyzer.xla!GetBEx")
        Dim dp As Object
        Set dp = BEx.DataProviders.Item(sDP)
        Dim dimension As Object
        Set dimension = dp.Request.Dimensions.Item("0CALDAY")
        Dim filters As Object
        Set filters = dimension.filters
        If Not BEx.ServerStateExists Then
        MsgBox " Please refresh before using this Makro"
        Exit Function
        End If
        Call filters.SetFilterValue(sFilter) 'this sets the filter value
    But using this code I wasn't able to set more than 1 filter value, because the function SetFilterValue removes all previous filters, but now I need to set more than 1 filters.
    I also tried to separate different filter values with comma, but this did not help.
    Also I will be glad if someone could give me a link on documentation about BEx objects in Excel.
    Thanks in advance,
    Pavel Baronov

    Hi.........
    Check this........
    http://www.netsaptech.com/SDN/demo/BIM301.pdf
    Regards,
    Debjani.......

  • ES_CRM_PARTNER_REDETERMIN* with the filter value *BUS2000223

    Hi,
    I have a requirement in which i have to create a Service Request and enter some particular Account ID for it through which any particular Account is assigned to the partner function "Account owner " automatically.
    Then again before saving the user changes the Account ID entered before to some other.As for this Partner Determination settings has been done in the spro.But now the partner function "Account Owner" is not changed accordingly.
    To make this happen i implented an Enahncement Spot ES_CRM_PARTNER_REDETERMIN with the filter value BUS2000223.
    But this implementation is not getting triggered, it triggers only once the first time when we try to create a Service request.And teh partner determination is not working.
    Please, suggest regarding the same.
    Cheers,
    Sharad

    Hello,
    partner re-determination is only available since crm 6.0.
    Please see the online documentation which explains this at:
    http://help.sap.com/saphelp_crm60/helpdata/en/d4/a8f6967c4b46b2bc2c20283a245199/frameset.htm
    Normally it works only for BUS - types which are maintained in table (these entries are also supported)
    COMS_PARTNER_DET:
    BUS2000108
    BUS2000111
    BUS2000230
    BUS2000231
    BUS2000311
    BUS2000312
    Hence at least you have to maintain the BUS2000223 in the table, but I am not sure if it will work.
    Regards
    Rene

Maybe you are looking for