Assign a Javascript variable value to a ABAP variable

Hi,
   I wish to assign a javascript variable value to  a ABAP variable. Any ideas how to do that?
    Many thanks.
Rgds,
Bernice

Here's another suggestion for you.
BSP Application: SBSPEXT_HTMLB
Check out the radionbuttongroup.bsp
So then instead of using a standard HTML radio buttons you can use the HTMLB element with the parameter for onClick set then in your DO_HANDLE_EVENT you can read the value.
VIEW
<htmlb:radioButtonGroup id="radio">
  <htmlb:radioButton id="id_link"
                   text="Link"
                onClick="myClickHandler"/>
  <htmlb:radioButton id="id_unlink"
                   text="Unlink"
                onClick="myClickHandler"/>
</htmlb:radioButtonGroup>
DO_HANDLE_EVENT
  DATA:   lt_event        TYPE REF TO if_htmlb_data.
  lt_event = cl_htmlb_manager=>get_event_ex( request ).
  if lt_event IS NOT INITIAL.
    if  lt_event->event_name = htmlb_events=>radiobutton.
       case lt_event->event_id.
        when 'control_id_link'.
          schalter = ' '..
        when 'control_id_unlink'.
          schalter = '1'.
       endcase.
    endif.
  endif.
There is an example of how to use it and read it in the DO_HANDLE_EVENT you then just have to pass the variable around (in this example the variable name is schalter and is defined as char1 in the class)

Similar Messages

  • How to assign list of default value for select-option variable???

    Hi every one
    This is Deepak,
    I want to know how to assign list of default value to select-option variable ? please any body tel me solution
    for example
    select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
    Thank you in advance
    Deepak

    Hi.
    Check the following sample code.
    REPORT ztn_test.
    " It is example for list populating.
    TABLES:knvp.
    data: BEGIN OF itab OCCURS 10,
          kunnr like knvp-kunnr,
          END OF itab.
    data: wa_itab like itab.
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id,
    list TYPE vrm_values,
    value LIKE LINE OF list.
    PARAMETERS: s_kunnr(20) type c  as LISTBOX VISIBLE LENGTH 40 .
    AT SELECTION-SCREEN OUTPUT.
    SELECT kunnr from knvp  into  CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
    " I have used loop to populate some values from table
    loop at itab into wa_itab.
      name = 'S_KUNNR'.
      value-key = sy-tabix.
      value-text = wa_itab-kunnr.
      append value to list.
      clear wa_itab.
    endloop.
    " If u want individaully assign the values change the code as
    name = 'S_KUNNR'." Select option name
      value-key = 1." Index
      value-text = 'VAL1'.
      append value to list.
    name = 'S_KUNNR'." Select option name
      value-key = 2." Index
      value-text = 'VAL2'.
      append value to list.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING id = name
    values = list.
    Edited by: tahir naqqash on Feb 21, 2009 4:38 PM

  • Assigning a Jython variable value to an ODI variable

    I have to implement database cursor functionality in ODI.
    For storing the returned values from database, I am using a Jython list.
    The next functionality that I have to implement is as follows:
    (i) For each value in the Jython list, I have to pass that value as a variable to an interface and then execute the interface
    (ii) Return back to the Jython list to get the next value in it
    (iii) Execute the interface for the new value from Jython list
    (iv) Have to execute the interface for as many values as in the list and stop when list is over.

    Hi,
    Thanks for your replies.
    I tried your method of using source as a query in procedure and using ODI startScen in the Target of the same procedure. But the scenario runs only once, and then stops even though the Source query returns 4 rows.
    Do we have to write Source and Target in separate steps of the procedure?
    Does ODI store the many records returned into some internal variables?
    I need to implement a cursor functionality so what is the best approach?
    Can i pass array variable value to some odi variables and do a loop?
    I used a workaround....it works but dont know if that's a good way of doing things:
    I retrieved all the different values that I need in a string by appending the values(this was done using Java loop).
    In my next step in the procedure I call a scenario(package which has some variables and my interface), which passes this long variable from Java as <@...@>
    Then in the package I use an iteration variable which is used to find out the SubString position so that I can extract the correct string to use for my Interface in the next step of the Package.
    It is working fine as of now.....but things could be made simpler if I could call the scenario in the Java loop, then I wouldn't need the iteration variable etc.

  • Adding a Variable Value to the cpQuizInfoPointsScored Variable

    I have a variable that I am using to track incorrect responses (clicking incorrect buttons while completing a process) and I want to add the value of the the variable to the value of cpQuizInfoScored. I can create an expression to add the two but I can't select cpQuizInfoePointsScored to receive the total.
    Any help would be appreciated.

    Jimmy.  This might be that you are misunderstanding how the Interactive Master widget works with partial scoring.  Basically you need to specify the score that will be allocated to a slave object using the Scoring section in the Master Widget properties interface.  That's the score that will be reported to the Quiz instead of the default score you've assigned to the interactive widget via the Properties > Report Score section in Captivate.
    Using the preference settings you select, the Master Widget is going to try and work out whether or not the Variable Slave is in a Success or Failure condition, and THEN it will report whatever score you've assigned for that circumstance.
    What you're trying to do is a little different.  You want to have ONE variable slave that can have a score anywhere between 60 to zero.  My suggestion is that you consider using setting up different user variables for each of the interactive objects on the slide that you are tracking and then add each of these variables into the Master widget as Variable Slaves, assigning each one a Success or Failure score in the Scoring screen. 
    For example, if you ahve a number of click boxes on a slide and you are tracking whether or not the user clicks the right ones, you need to set up a user variable with a default value of 0 for each click box and assign that variable a value of 1 if the click box gets clicked.
    The Master Widget will be able to determine for each of these slaves whether they are in a Success or Fail condition based on whether the variable is set to 0 or 1 and then add up the relevant scores allocated for each variable.  This aggregated score is what can be reported to the quiz score, over riding the default score assigned to the widget.

  • Restrict variable values based on another variable in the bex query...

    I am struggling to restrict the variable values from other varaible in the selection criteria. I have a variable which restricts he organisation(0ORGUNIT) and another to restrict employees.
    When the user selects any organisation unit form the hierarchy, I want only those employees related to that organsation in the varaible selection options.
    Is there any way I can make a variable values dependant on the another variable value in variable selection screen?
    Thanks,
    Your help in this matter will be much appreciated.
    Edited by: Kthapa on Nov 25, 2010 11:08 PM

    Hi Kthapa,
    Did u try using cmod?
    i_step = 1? Used to provide default values for the selection screen variables and
    i_step = 2 for filling up the variables after selection screen.
    Try using based on ur requirement.
    Hope this helps. Revert back for any queries.

  • Run Variable values out of the "variable values window" in a excel workbook

    Dear experts,
    I am working on BI 7.10.
    Our workbooks are made of several data providers based on the same query and require many different variable values, which give us a long and unconvenient (for the users) "select values for variables" window (ex : we have a Profit and Loss report to run on different consolidation versions, fiscal years etc...)
    So I wonder if there is another way to enter these values, out of this window...(macro?)
    Many thanks for your help.
    Armelle

    my variables are global for all data providers since I use the same query for my data providers.
    It's just the values (some of them : ex: conso version) that differ from one data provider to another.
    ex : here for 2 diff Data providers based on the same query i need to enter the following values for mandatory variables
    Different versions / different years but same conso group / data entry year/ posting period.
    i would like to have the possibility to enter these values out of the "select values for variable" window (not convenient when we have 7 or 8 DP...), but directly in the workbook.
    But maybe this is not possible...
    In DP1                 
    conso version = A_PL                         
    conso group = FR01
    data entry year = 9999
    fiscal year = 2010
    Posting period = 12
    In DP2
    Conso version = P4_MAG
    Conso group = FR01
    Data entry year = 9999
    fiscal year =2011
    Posting period = 12

  • How to assign Javascript variable to ABAP variable

    Hi All,
    I have a requirement to create a page where each of the table cells will have drop down boxes with Red, Yellow and Green colors.
    When the user selects the color it has to be saved to database.
    Now the problem is, I'm using HTML as HTMLB was very complicated for the kind of layout the client needed.
    I have created a onChange event for each of these drop down boxes (please keep in mind the dropdown ids are dynamically created by looping the ABAP internal table).
    I'm passing this.id on change event and capturing the id name. Now using this id I have to read an internal table.
    But the problem is, this is javascript variable and cannot be passed directly to read table statement.
    Please help me in this regard.
    Lots of points will be given for valuable inputs.
    PS: I have gone through the thread Assign a Javascript variable value to a ABAP variable
    But doesn't seem to work for my case as I'm using HTML.

    Hi Chait,
    you need to populate a HTML form field with the variable. Most commonly people use the...
    <INPUT type="hidden" id="param1">
    construct.
    In your javascript you can then just set the value of param1.
    Of course you could also dynamically create the elements at runtime in your javascript code.
    Cheers
    Graham Robbo

  • Pass javascript field value to  ABAP field value

    Hi all,
          how can i Pass javascript field value to  ABAP field value  and utilise that value within layout.

    since you are new here, may i suggest you to search the forum, before posting a question. This has been discussed many times here.
    to set a js variable value to a ABAP variable value, you cannot do it on the client side, your page has to go for a server rountrip so that the value can be set into a ABAP variable.
    for this we generally follow the approach of setting the js variable value to a hidden html element (input type=hidden) and submit the form, and then in oninputprcessing retrieve the value from the form field and set it to a ABAP variable.
    Regards
    Raja

  • Getting JS variable value in ABAP variable

    hi experts,
    I am fairly new to ABAP programming so please bear with me. To my issue.
    I am creating a BSP which will read from the tax number table in CRM into an itab.
    Next it loops into an wa and then passes each tax number through a javascript/JQuery API to validate the number. 
    The JSON response then comes back and is stored in a JS variable.
    I am unclear how to get this into an ABAP variable so I can handle as needed.  I have read some posts but they seem to be created for those ABAP experts which I am not there yet.
    Any help is most appreciated.
    thank you kindly!
    Chris

    Thanks for the reply Kiran.
    I am still stuck where I try to create the hidden field, assign the JS variable value to it and then retrieve on server side using ABAP.
    I read some places where it mentions accessing in the controller but this is not specific enough for me to know what to do.  Here is a snippet of my JS/html code.
    <form id="api">
    <div><input type="hidden" name="json" id="json" value="" /></div>
    var json = data;
    document.getElementById("json").value = json;
    document.api.submit();
    </form>
    I am using a Jquery api to get a boolean value and storing it in the json variable.  then I want to pass that value to an ABAP variable.  I did maintain a page attribute of json type STRING as well.  I also tried maintaining a controller class attribute of the same.  I did not redefine any controller class methods.
    Your help is most appreciated.
    thx
    Chris

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • Web report - Variable values while switching between views.

    Hi Gurus,
    We have a query which has a few variables that are getting populated with default values during query execution[customer exits].
    We have added this query to the web.Now there is a date variable  which gets populated with the current date value by default.Suppose the users don't vant to run the report for the current date, they are able to change the date in the variable window and execute. But once the report is run, and we try to choose a different vieew for the report, the report automatically gets refreshed with the selected view, but for the default current date value (because of the customer exit).Shouldn't the selected view be getting refreshed with the date values that the user had entered while executing the report?
    Also when navigating between the different views, shouldn't a variable window pop up? Is there any setting to have the variable window pop up when navigating between the different views of a web report?
    Would appreciate a quick response.
    Thanks a Lot
    Arvind

    hello,
    we need to go to Query properties -> interaction tab-> remove reuse variables to populate the variable screen everytime or "Save and reuse variable values" to supress variable window
    or
    Problem could be due to any personalisation.try this:
    One the query is executed, click on the button which says change variable values.
    In the variable pop-up screen which comes up click on the personalization button
    In the new screen which comes up click on reset personalization button
    Enter new variable values and execute the query.
    Reg,
    Dhanya

  • Variable value not showing in sql developer  tool

    HI,
    I am using sql developer tool. when i take mouse in variable name at debugging its not showing variable value and instead showing variable name data type and owner. but in past i have used sql developer tool where when i take mouse on variable at debugging mode it shows the varable value.  please tell me is there any issue in sql develper tool currently i am using.
    sql developer version 2.1.0.63

    Sorry - but I doubt if you will get much help for that ANCIENT version of Sql Developer.
    My best suggestion is to download the current version and see if you still have the problem. There have been HUNDREDS of bug fixes since that version you are using.
    Oracle SQL Developer Downloads
    Take note that the current version REQUIRES a much higher JDK version than what you may be using. And do NOT try to install the new version on top of the old one.
    Install the new version into a totally new folder. You will be ask if you want to import your settings from your current version.

  • 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 javascript value to a JSP variable

    How do i assign a javascript value to a JSP variable?
    eg
    <%
    String JSPvar;
    %>
    <script language="JavaScript1.2">
    <!--
    var javascriptVar="hey"
    -->
    </script>
    <%
    JSPvar = javascriptVar ???
    %>

    You do know that the JSP runs on the server and generates HTML, including Javascript, that is executed on the client, don't you?

  • How can i assign a Javascript variable to JSP variable

    Hi guys
    how i can assign a javascript variable to jsp expression.,
    e.g.,
    <input type = "button" value = "Add more" onclick = "return submitform1('<%=s%>')">
    function submitform1(String s)
          var s1 = s
    document.form1.action = "../intimation.do";    /* Here i want to pass the value s1 to jsp or servlets without using hidden fields and Query string*/
           document.form1.submit();
          return false;
    /*  i want to pass the values thru session whether it is possible */
    pls give sample code
    Reply
    Marimuthu

    You don't have the session.
    All you have is HTTP.
    The only way to communicate from the client to the server is via an HTTP request. The only way to send a value like that is with a parameter.
    Using a form with method="submit" as mentioned will pass the parameters without displaying them in the url bar (is that what you wanted?)

Maybe you are looking for

  • 99% CPU on Front Row with Snow Leopard, possible workaround...

    This might be helpful for some who have experienced this issue as well. It seems that Front Row will continue to work in the background when you exit from it using Apple - Q, but if you exit using the remote, holding down the Menu button for a couple

  • Adding keywords to stacks

    Hi folks, Quick question: Is there any way of allocating a keyword to an entire stack, rather than having to expand the stack and shift-select all the images? The stacking system I use maintains all similar images in the same stack, so being able to

  • Creating generic datasource using function module in R/3 4.6c

    Hi, I am not able to see the option (in TC RSO2) to create generic datasource using function module in R/3 4.6c. Is there any special plug in or some SAP Note to be applied to get the option ? Waiting for a quick response. Thanks and Regards, Deepak

  • My time capsule has been "preparing" for days--what to do???

    My time capsule has been "preparing" for days--what to do???

  • Delete without a where condition

    Hi, I am giving a delete <tablename> statement in a macro, the table name is passed as a parameter. However while compiling it gives me an error saying that it expects a where condition but I don’t have an where condition I want to delete all the ent