Enhancing WAD template with Javascript

hi,
I have a requirement to draw vector lines on a scatter web item. Those lines are used as delimiters between different areas in the chart results.
I need to draw the lines on top of the existing scatter web item.
My question is what event i need to use when calling the JS function that draws the lines, so they will be drawn only after the web item was entirelly rendered in WAD (and not before)?
Can someone explain?
Many thanks,
Xibi

Write your script after <\Body> and <\HTML> and I think this gets executed after all the controls are drawn in your web page.
Regs
Gopi

Similar Messages

  • WAD template with BSP Application - how to read selection screen values

    Hello,
    I've created Web template with Web Application Designer (WAD).
    I would like to extend  that page with BSP Application...
    Purpuse of this application is to read some information from tables
    on BW transaction server and display them within Web page.
    Question: How to read selection screen values from a Web template ?
    Thanks for any help,
    Pawel Borowiec

    Hi,
    The selection screen parameters will be on an inputField, so try and get the is of the inputfield generated by doing View source...
    And once you get the inputfield Id, you can read the value in the InputField(InF) by
    using the following code...!
    data : if_value type ref to cl_htmlb_inputfield.
    data : variable type string.
    if_value ?= cl_htmlb_manager=>get_data( request = request
                                                name    = 'inputField'
                                                id      = 'InF_ID_here'
           if if_value->value is not initial.
             variable  = if_value->value.
           endif.
    Hope this helps.
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

  • Calling query doc. (text file) from a web template with JavaScript

    Hi,
    I would like to have an explanation of the following:
    My goal is to develop a solution within a dynamic web template that supports calling of query documentation (description and purpose of the certain report). This query documentation will be provided from a textfile(e.g .csv) and presented under the information tab applying a text element web item. This will be done with query technical name acting as key with the following column structure:
    Technical name    Description    Purpose
    I really would appreciate if anyone could provide me with a more or less detailed solution proposal for this. Javascript etc.?
    Thanx in advance

    You can use the command line tool cURL instead of a GUI browser.
    set myFonts to do shell script "curl http://site.com/fonts.txt"

  • How to bypass or modify  WAD initialization with javascript

    Hello WAD Developers
    I want to understand what happens when you load and re-load a page, because I need to invoke some logic only the first time a page is run and not each time you click someone.
    I have created some javascript logic which uses a drop-down to reset a data provider - similar to the Query View Selector item except that I can take advantage of variants. Part of my solution is that I load a drop-down select box from an external list of choices. The BW data part works wonderfully. But what also happens is that my select options load EVERY TIME any event happens on the page. This means that after the data is loaded and the select box is reset, it will not show what was selected. I've tried "first-time only" logic in the function, but since the page refreshes, it's always the first time.
    Any suggestions?
    To show it graphically,
    Here's how the dropdown boxes normally work. Let's pretend my box shows four slots:
    Select a State  <== This is what you see in your box.
    AL
    GA
    FL
    If you select GA, then the next time you might see
    GA           <== Now I'll see the first selected item.
    FL
    IN
    OK
    Select a State  <== Even after a selection,
    AL              <== I always see this
    GA
    FL
    What I have coded the drop-down to do is like this:
    1. In the html itself, there is only one item:
    Selection Goes Here.
    2. After my code loads, by running a function from the <body onload>, I get:
    Variant1
    Variant2
    Variant3  etc.
    If the user selects Variant2, the next time I should see:
    Variant2
    But instead my code shows me:
    Variant1 each time.
    I have code within the function to only load the drop-down when it is in the initial state, but my debugging shows
    me the initial html drop-down values are reset each time. How can I persuade bw NOT to reset this code each time?
    If this is javascript DOM stuff and someone can show me that instead, I'll be greatful.
    Points are awarded, and if you're in Atlanta, I'll even bring you a Coke and a candy bar.
    Thanks in advance,
    Doug Childs

    Hi,
    you could use a wrapper around your Template:
    Your Template is an Iframe in a 'top'-template.
    'onload' in your bw-template you could then chek the upperframe for a variable, which tells you if your function was allready executed.
    Regards,
    Alican

  • Problem on WAD Broadcasting with Javascript

    Hi Experts,
    I have some javascript code on WAD. I put the javascript code in the Script item. It works when I click "execute" icon on WAD.
    But when I broadcast this WAD report to portal. The javascript doesn't work. I check the html source, right-click  and view source on the browser, there is no any javascript code which I added could be found.
    Does anyone know what's wrong on it or any steps I miss?
    Thanks,

    This issue is solved.
    Thanks

  • Problem with Javascript in WAD Template

    Hello,
    I have placed zdate_functions.js  in /sap/bw/Mime/Customer/JavaScript/ with the following function...
    function getDateMMDDYYYY()
    {var curdate = new Date();
    var month = curdate.getMonth(); var day = curdate.getDate();var year = curdate.getFullYear();
    var display = month + "/" + day + "/" year;
    return display;
    In the WAD Template I placed the code to 'register'  zdate_functions based on a view source of the original template...
    script src="/sap/bw/Mime/Customer/JavaScript/zdate_functions.js" /script
    Then later I placed this code to get a date in a fiormat I need it in...
    script document.write(getDateMMDDYYYY()); /script
    However, I am not getting anything.  What I am I missing or do you see a mistake in my code?
    Thank you in advance for any assitance.
    Regards, Dean.
    Edited by: Dean Hinson on Apr 24, 2008 5:36 PM
    Edited by: Dean Hinson on Apr 24, 2008 5:45 PM
    Edited by: Dean Hinson on Apr 24, 2008 5:48 PM
          Having trouble posting code to message.

    Cancelled

  • Problem with WAD Template

    Hi All,
    I have 2 queries Ex: QAS1 and QAS2.Both have same selection parameters expect Date in both queries.QAS1 is having date (RO1) and QAS2 is having (ROS1) date parameters. I have a common WAD 7.0 template for both these queries and both queries are merged. So when i execte the web tepmplate i will enter either RO1 Date or ROS1 date and the web template should display the query/report output based on date entered.
    Can i use web items or Script Item control or any javascript for this issue?Please provide step by step procedure if there is any solution accordingly.
    Is there any better solution for this approach?
    Regards..
    Edited by: sunanda G on Aug 16, 2011 3:41 PM

    Hi,
      Thanks for your reply. I tried many ways in the web template but issue still not yet solved. That is I have selected 2 Data providers for 2 Reports in the web template, But same reports output except date fields. Those 2 date fields also displayed in selection variables, when I run the template in WEB. So, When I select one date variable the corresponding Data Provider should fill the analysis item table in web template. If I select 2nd Date field variable in the query selection the corresponding Data provider-2 should fill the same analysis item table in same web template.
    Actually these templates are available in 3.5 WAD. But that one with java scripts. Now user want to upgrade same templates in WAD 7.0. I also tried using with java script accordingly 3.5 WAD Template. But no use.
    Please suggest me.... what is best procedure we can use for issue?
    Thanks & Regards,
    Sunanda

  • WAD - adding menu entries with JavaScript - help please!

    Hiya,
    I am completely new to JavaScript and I need some help with adding menu entries into my WAD template. Can anyone please help?
    I want to add functionality into my WAD template to enable users adding results rows on a selected characteristic, at a single mouse click. Currently they need to go to the menu -> properties -> characteristic -> display results -> always -> ok. That's five clicks of a mouse (provided they know were to go).
    I want to add this option to the basic menu so that they can click once only.
    What I have managed to figure out so far using SAP help is the following. I have added a Script Item into my WAD Layout and added the following line of code in the Script Editing window:
    sapbi_addToMenu("Add totals", "alternate_context_menu", "X","CHARACTERISTIC", "", "bottom", "", "")
    It worked fine in that it added an extra item "Add totals" to my menu when I righclick on a characteristic. So far so good. However, I have no idea what function I should be using here, or how to code it. Surely WAD uses some function to perform this action, something that I could reuse? Is there a library somewhere of all the function used in WAD?
    Can anyone please help with the code?
    Many thanks,
    Agata

    Hiya again,
    I have managed to partially solve this problem by using the following code. However it requires me to define on which characteristic the function is performed. In this case I have managed to get it working on 0PROJECT, but I want it to be ANY characteristic which has been right clicked?
    Any ideas how I can pass the characteristic name as a VARIABLE, whose value would be read automatically when menu is triggered?
    /* Add Contextmenu entries */
    sapbi_addToMenu("Add totals", "JS_SET_RESULT_VISIBILITY_R", "X","CHARACTERISTIC", "", "bottom", "", "")
    * Javascript functions that are to be integrated into a web template and that
    * are to be used later in the web application ALWAYS have to have the same function
    * signature, i.e. the parameters that will be passed.
    * @param currentState - a list of parameters that describe the state the web item
    * @param defaultCommandSequence - the initially used sequence of commands that
    *       would have been used instead of the custom
    *       script.
    function JS_SET_RESULT_VISIBILITY_R( currentState, defaultCommandSequence ){
    //Note: information can be extracted using the parameter 'currentState'
    // and 'defaultCommandSequence'. In either case create your own object
    // of type 'sapbi_CommandSequence' that will be sent to the server.
    // To extract specific values of parameters refer to the following
    // snippet:
    //  var key = currentState.getParameter( PARAM_KEY ).getValue();
    //  alert( "Selected key: " + key );
    // ('PARAM_KEY' refers to any parameter's name)
    //Create a new object of type sapbi_CommandSequence
    var commandSequence = new sapbi_CommandSequence();
      * Create a new object of type sapbi_Command with the command named "SET_RESULT_VISIBILITY"
    var commandSET_RESULT_VISIBILITY_1 = new sapbi_Command( "SET_RESULT_VISIBILITY" );
    /* Create parameter TARGET_DATA_PROVIDER_REF_LIST */
    var paramTARGET_DATA_PROVIDER_REF_LIST = new sapbi_Parameter( "TARGET_DATA_PROVIDER_REF_LIST", "" );
    var paramListTARGET_DATA_PROVIDER_REF_LIST = new sapbi_ParameterList();
    // Create parameter TARGET_DATA_PROVIDER_REF
    var paramTARGET_DATA_PROVIDER_REF1 = new sapbi_Parameter( "TARGET_DATA_PROVIDER_REF", "DP_1" );
    paramListTARGET_DATA_PROVIDER_REF_LIST.setParameter( paramTARGET_DATA_PROVIDER_REF1, 1 );
      // End parameter TARGET_DATA_PROVIDER_REF!
    paramTARGET_DATA_PROVIDER_REF_LIST.setChildList( paramListTARGET_DATA_PROVIDER_REF_LIST );
    commandSET_RESULT_VISIBILITY_1.addParameter( paramTARGET_DATA_PROVIDER_REF_LIST );
    /* End parameter TARGET_DATA_PROVIDER_REF_LIST */
    /* Create parameter CHARACTERISTIC */
    var paramCHARACTERISTIC = new sapbi_Parameter( "CHARACTERISTIC", "0PROJECT" );
    commandSET_RESULT_VISIBILITY_1.addParameter( paramCHARACTERISTIC );
    /* End parameter CHARACTERISTIC */
    /* Create parameter RESULT_VISIBILITY */
    var paramRESULT_VISIBILITY = new sapbi_Parameter( "RESULT_VISIBILITY", "VISIBLE" );
    commandSET_RESULT_VISIBILITY_1.addParameter( paramRESULT_VISIBILITY );
    /* End parameter RESULT_VISIBILITY */
    // Add the command to the command sequence
    commandSequence.addCommand( commandSET_RESULT_VISIBILITY_1 );
      * End command commandSET_RESULT_VISIBILITY_1
    //Send the command sequence to the server
        return sapbi_page.sendCommand( commandSequence );

  • Javascript to Execute a button or planning function onload of WAD template

    How do I call a javascript to execute a planning function or a button that has a planning function.
    I tried creating a script using script web item and wizard to execute a planning function.  The wizard generated a javascript function that has two parameters currentState, defaultCommandSequence
    I can call the function inside the body tag using OnLoad but what parameters do I need to pass for currentState and defaultCommandSequence.
    Is there any other way of doing.   Any help is greatly appreciated.
    Thanks

    Hi Ravi
    Whatever u hav done is correct. There is no need to transfer any values for the parameters
    currentState and defaultCommandSequence .
    They r automatically derived based upon the current state of ur WAD template and the sequence of commands that you executed till now..
    Try this.. its working fine in my project since long time.

  • Print button on WAD template

    Hi,
    Presently we are in BW 3.5 version with support pack 22. We enhanced the html code based on ' How to ... Web printing with MS Excel' document. We imported the transport file which contains package and ABAP Classes.
    After click on the print button on Web report, it was giving the same result area in the same page instead of giving the excel open or save options.
    How to debug the enhanced html code in the WAD template? How to check the ABAP class('ZCL_RSR_XLS_HELP_WINDOW_PRINT') which i used in the
    code?
    Or is there any way to print the result area of Web report?
    Please help me.
    Thanks in advance.

    This question has been answered

  • How to Refresh a WAD Template

    Hi...i have a WAD template wih 6 queries on it....i want to know how to refresh all the template ...or i have to refresh every query one by one...i try to put a command button but it appears inactive and i dont konw how to actiavte it...
    Regards

    Hi,
    Please try with CMD: REFRESH_DATA. You can find this under 'Commands for Planning Application'.
    Otherwise, you can take Action as : SCRIPT_FUNCTION and give "javascript:location.reload(true)" under Script Function.
    Regards,
    -Vj

  • WAD Templates - Dynamic Tabs !?

    Hello BEx Experts,
    I´m looking for a smart solution to switch the visability of several TAB´s in my WAD Template according to variable values.
    Example:
    we start our templates from an own developed monitor (bsp page) and call the WAD templates for several companies (0COMPANY). for every company we call the same template. that template includes ten TAB´s. and there starts our problem, because we would fading out some TAB´s for some companies. And we don´t want to create diffrent templates for all companies.
    Any ideas?
    BR david

    hello,
    thx for your reply, but both solutions doesn´t work.
    1. It isn´t possible to set the TABPANEL visible / invisible, because there is no selectable object for the TAB. You could select the TABCONTAINER, but it isn´t possible to select a special TAB to set visible or invisible.
    2. I don´t understand the solution with authorization customizing, because all users have the same authorization and the visibility of the TAB should depend on the companyselection.
    However, we solved the issue with JavaScript. So it´s possible to set the TAB caption to invisible in reference to the selected company and so the tabpanal will be minimized.
    BR
    David

  • How to show a WAD template in Portal

    Hi ALL
    How can i show a WAD report (WAD template) in Portal. what are the steps need to followed.
    Like for Bex Application Iview we create it by using a Query String(combination of infocube name and Query name), like wise what should be done from Portal end to get a WAD template in to portal as Iview.
    Regards
    Vijay kumar

    Hi,
    Regarding your issue your template is not active.
    In the first place you need to check if the template is activated in the backend BW system. 
    After activated and launch it from the backend system. Once the BW template is
    active, kindly launch the template from the backend system, please try
    to launch the template in browser version as we can determine the URL
    being launched. If you're able to succesfully launch the template from
    the backend and still you're encountering an error while testing it from
    the iview. Then it should be a problem with the system object configured
    for the iview. There is a need to check if the system alias SAP_BW is
    properly configured to the destination BI content system.
    Please refer the note:
    1048857 - Activating the default Web templates
      In RS_TEMPLATE_MAINTAIN_70 you can choose the version of the
      template to be displayed ("A" per default).
      Please compare and attach the A- and D-version of 0ANALYSIS_PATTERN.
      If the activation from business content was successful, the versions
      are equal. I assume, that they are not equal.
      If they are different it means that the activation was not successful.
      Another indicator would be, that the activation only takes one or two
      seconds. Normally it takes several seconds (up to a few minutes).
      As mentioned in note 1048857 it might happen that the checkboxes, to
      mark the objects for activation, are not checked and therefore nothing
      is activated. For this case note 1070452 is mentioned, which is
      available  in english since today: If the checkboxes are not checked
      and you are unable to do that manually, please use the context menu
      on the object on top to select all objects below. The activate the
      objects again (  > how long does it take, A- and D- version are the
      same afterwards ?)
    It should resolved your issue.
    Thanks,
    Venkat

  • How to Create authorization WAD template for BW3.5?

    Hi All
    How To create Authorization for a Web template in Bw 3.5 ?
    I have a requirement to restrict a particular Web templated in bw 3.5 So that all the end users should not be able to access that template only a particular user should be allowed to view the template?
    I cant find any authorization object for the WAD template in bw 3.5 ?
    Can anyone tell me the procedure to include the WAD template authorization?
    Should i include the authorization template in the Menu - in pfcg??? . i have added the template in the Menu in the PFCG but still it didnt work.
    Thanks

    As you said, the authorizations for the WAD templates should be given in PFCG roles.
    But you have to include the access/authorization details in the authorization objects. WAD templates have been created with including info/multiprovider, info cubes right.. first you have to include these objects inside the Role in PFCG.
    S_RS_COMP,S_RS_COMP1,S_RS_MPRO,S_RS_ICUBE.
    just assigning WAD template in the menu of the roles is to display when you login with the userid.
    Please request your BASIS folks to do the same.
    Hope this would help you.

  • How to use a Web Template with queries from multiple BW Systems?

    Hi all,
    can anybody help me how to use a Web Template with queries (DATA PROVIDER)in it from multiple BW Systems?
    Thanks in advance, best regards
    Frank

    Great! Thanks for the quick response.
    Have you tried this for XMLA datasources created within the EP system also?
    i.e use Web Analyzer to create a view from the XMLA source and use that view within WAD?
    Thanks.

Maybe you are looking for