How to use javascript variable in BSP/ABAP and vice versa

Hello Experts,
In IC WEBCLIENT, there is a view.In the view.htm i want to fetch  the screen resolution and as per the resolution i want set the width of that view.
1, I wrote the below  javascript to fetch the screen resolution.
   Can i use a notmal ABAP variable inside the javascript? and   If i use can i access that variable after the javascript.?
   Can i assign a javascript variable to a nrmal abap variable??
   The code sample  is like :
Start of javascript
   if (screen,width == 1024 )
     lv_width = 500  "lv_width is an ABAP variable.
  else
    lv_width = 700
**END OF JAVASCRIPT
   **Now i want to use lv_width  to assign to a table view attribute(Width)
<crmc: tableview..
                width = <%= lv_width >
the code is not giving any error. But the problem is that lv_width is not giving the correct value, its getting initialized to initial value...
Requesting the experts to please provide some suggestions/solution for the above issue.
Thanks and Regards
Sudhansu

Hello Sudhansu,
First of all there was a little mistake at my previous answer:
you got lw_width = 700
because at Server Side you have following code:
lw_width = 500.
lw_width = 700.
but if you were writing your code like this:
<%=lw_width %> = 700.
then you will get the result that I was talking about : 0 = 700
Sorry for the mistake
Now for your question:
if you want to get a value from the server and assign it to JScript variable you should write like this :
var aaa;
aaa = <%=lw_width %>;
this code assign the server variable lw_width value into aaa  JScript varible.
I'm not sure what exactly you want to do but look at this link:
http://www.pageresource.com/jscript/jscreen.htm
to get the idea how to get and use Screen Resolution variables at your JScript code.
Good luck
Eli Steklov
Please Reward Points if it Helped

Similar Messages

  • How to convert from UNICODE (UTF16) to UTF8 and vice-versa in JAVA.

    Hi
    I want to insert a string in format UTF16 to the database. How do I convert from UTF16 to UTF8 and vice- versa in JAVA?. What type must the database field be? Do I need a special set up for the database (oracle 8.i)?
    thanks
    null

    I'm not sure if this is the correct topic, but we are having problems accessing our Japanese data stored in UTF-8 in our Oracle database using the JDBC thin driver. The data is submitted and extracted correctly using ODBC drivers, but inspection of the same data retrieved from the GetString() call using the JDBC thin driver shows frequent occurrences of bytes like "FF", which are not expected in either UTF8 or UCS2. My understanding is that accessing UTF8 in Java should involve NO NLS translation, since we are simply going from one Unicode encoding to another.
    We are using Oracle version 8.0.4.
    Can you tell me what we are doing wrong?
    null

  • How to call a Applet from a servlet and vice versa...?

    Hi all
    Can anyone help me how to call a applet from a servlet and vice versa. When the applet is called it should contact the database (oracle8i) and get the data. When i submit the applet form the data in the applet should be saved in the database.
    Thanks in advance
    Kamalakannan

    Sweep is correct about requestDispatcher being another approach for inter-servlet delegation; the only issue that i recall with this approach is that it defaults the method of the destination servlet to the one it was called from...for example, calling servlet2 from within servlet1.post() resulted in the dispatcher attempting to utilize servlet2.post() - i believe that i searched for a parameterize solution to no avail :( (ended up handling the request by placing a "fake" doPost() in servlet2 that simply called servlet2.doGet())
    however, if your application is functioning correctly on your pc/webserver then the problem may be external to servlet communication (e.g. client webserver's ports not configured or blocked, missing runtime classes, etc.)
    my suggestion would be to set aside the programmatic concerns for the moment - what is the response if you open a browser on a client's machine and access the URL in question (i.e. http://clientserver:port/stefanoServlet)? If it will not respond to access in this manner then it certainly won't when your application calls for it.
    It's possible that there is a coding error but, given the info supplied, i'd start examining the environment, first. Let us know if you have any luck with the test i recommended or not (please provide abundant detail). Or, if you've found the solution then you may want to post back with a quick blub so the next person knows how to escape the trap.
    D

  • How to link idoc with its corresponding documents and vice versa...

    Hello Experts,
    What are the tables, transactions, etc that can link a certain document(e.g. PO, GR, invoice) to its IDoc and
    vice versa.
    Thank you guys and take care!

    Hi,
    The Message Control parameters from the partner profiles must also match the corresponding
    fields in the output type. These parameters include:
    u2212 Application
    u2212 Partner
    u2212 Partner function
    u2212 Output type
    Tcode  - NACE  (Output Control)
    Tables - SRRELROLES  (Object Relationship Service: Roles)
    Message Control is a mechanism by which documents are output based on certain conditions.
    1) The application id, communication structure and o/p determination procedure are responsible for triggering IDocs corresponding to a particular application document. For this to happen message control settings have to be done.
    2) Message Control u2013 also referred to as output control or conditioning technique u2013 is a cross-application component used as a service program in several areas. The basic concept behind Message control is to generate and manage outputs from an application and control their timings and medium of exchange.
    3) Message control settings can be done via transaction NACE or via transaction NACO.
    4) Starting point in message control in the u201COutput Determination Procedureu201D (Procedure within NACE txn.). Depending upon the configuration setting in SPRO this procedure is determined.
    A procedure defines a set of possible outputs for an application. We can define several procedures for an application, but only one can be configured as
    active (i.e. for a particular transaction document within an application only one procedure will be determined based on configuration settings).
    Eg->
    a) For Delivery (txn. VL01NO) the document type setting in configuration (SPRO -> Logistics Execution -> Shipping -> Deliveries -> Define Delivery types) determines the procedure.
    So whenever we save a document of particular application (of particular application id) and of particular document type, the particular o/p determination procedure is triggered.
    b) For sales, SPRO -> Sales and Distribution -> Basic Functions -> Output Control -> Output Determination -> Output Determination Using the Condition Technique.
    5) In the transaction NACE we can see that corresponding to application id (say u2018V2u2019 (shipping)) various procedures are defined:
    6) Before making the entry of the output type corresponding to a particular procedure, we have to define it with its attributes.
    The output type defines the characteristics and attributes of the output itself. We can access the output types on transaction NACE by selecting an application and clicking the Output type button.
    7) Access sequence defines a sequence in which business rules are checked for proposing an output type. It has following attributes:
    - A set of business rules or conditions.
    - A sequence in which the rules or conditions are checked.
    - A requirement that checks for business rules using ABAP programs.
    - An exclusive or inclusive strategy.
    We can access the access sequences on transaction NACE by selecting an application and clicking the Access Sequences button.
    Business rule 1 is based on SOrg./Distrib.Ch/Division/Customer. Business rule 2 is based on Sales Organization/Customer Number. Each business rule is, effectively, a set of fields defined in a condition table.
    8) Condition table specifies the key fields for a business rule. Hence for Business rule 1 the key is Sales Org., Distribution Channel, Division and Customer.
    9) Condition records are inserted in the condition table. The transaction is evaluated with the key (of the condition table based on business rule) and if the transactional data matches with the condition record the output is proposed.
    Condition records are defined at last.
    10) Several programs and tables are part of Message Control. For EDI, the following tables and programs will frequently be dealt with:
    *NAST - This table has an entry for the processing program used for an output type.
    *TNAPR - This table has an entry for the processing program used for an output type.
    *RSNAST00 - This program is used to process entries in the NAST table.
    *RSNASTED - This processing program exists for each output medium. ALE_PROCESSING is the routine in the RSNASTED program to process ALE outputs.
    11) Final overview of the components used in Message control to propose outputs.
    12) After doing all the settings for message control, the partner profile setting for this ALE scenario needs to be accomplished. We need to add the following entry to the outbound parameters of the partner profile:
    13) One important question that arises at this juncture is, how is the partner profile determined from the output type is case of ALE?
    This is information is stored in table EDP12 (Partner Profile: Outbound with Message Control). Based on the Partner type of receiver (RCVPRT), output type (KSCHL) and Application for message conditions - without value table (KAPPL), the Partner number of receiver (RCVPRN), Outbound process code(EVCODA), Message type (MESTYP) and other related values are determined.
    Regards
    Pugazhenthi.P

  • How can my husband access my iTunes purchases and vice versa?

    Can someone please advise me how to add my husband to my account to share my downloads and vice versa? I cannot find on iTunes how to do this and I am not that computer savvy - pretty please if you can, be specific as to what I am to do to make this happen - THANK YOU !!!

    Sorry, wrong link:
    How to use multiple iPods, iPads, or iPhones with one computer

  • How to use the variables used in the message mapping

    Hi ,
    In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
    I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
    Please guide me how to use the variables declared in the JAVA section in the message mapping .
    Thanks
    Anita Yadav

    Anita,
    I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
    If you declare a variable in the Declaration Section ,
    int i;
    then in any udf you can use if directly. No need to re declare  the variable in the UDF. If you do this, then it becomes a local variable.
    Regards,
    Bhavesh

  • How  can use a variable in the folowing code?

    How  can use a variable 'W_ROWNUM2' in the folowing code?
    MOVE '1' TO CNT.
    LOOP AT L_T_PM2.
                  CONCATENATE '0' CNT INTO W_ROWNUM2.CONDENSE W_ROWNUM2.
                   CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
        perform  DYNPRO_FIELD       using FLD2
                                     L_T_PM2-vari12_con.
                   CNT = CNT + 1.
                   CONDENSE CNT.                                                              
    ENDLOOP.
    I need to increment the value of W_ROWNUM2.
    Please ,it is urgent!!

    Hello
    CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
    Try using spaces between parts of the resulting string.
    CONCATENATE 'F110V-VARI'  W_ROWNUM2  '(01)'   INTO FLD2
    Regards
    Greg Kern.

  • How to use bind variables in the following query

    CREATE OR REPLACE PROCEDURE MMDB.test IS
    sel_qtn VARCHAR2 (10);
    CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
    AND run_id = 100
    a PT_QUANTITY%ROWTYPE;
    BEGIN
    FOR i IN PT_QUANTITY
    loop
    sel_qtn := i.quanttity-1;
    While sel_qtn>=1
    loop
    insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
    sel_qtn :=sel_qtn -1;
    End loop;
    commit;
    end;

    Don't duplicate threads: How to use bind variables in the following query

  • How to use iterator in standard BSP application BT115QIT_SLSQ

    Hi experts,
    I am new in BSP and my requirement is to put a checkbox icon beside the actions column (that has 2 existing icons already) of BT115QIT_SLSQ enhancement. I read a lot of article about iterators but I believe most of them are used in custom BSPs as we all know that standard BSP uses standard classes as well, which we cannot modify ourselves without access keys. Can someone help me how to use it in standard BSP? Or is there other much appropriate method?
    Thanks and Regards,
    Louie

    Dear Pradeep,
    Find the below link which explains a simple data download to excel from a table view.
    www.sapt echnical.com/Tutorials/BSP/Excel/Index.htm
    Try to avoid the way your using in the BSP application and it is abdicable to use the standard methods / class available like "cl_bsp_utility"
    Hope this will be helpful.
    Regards,
    Gokul.N
    Edited by: Gokul on Oct 8, 2009 9:57 AM

  • How to use bind variables in this procedure

    Hi Experts,
    How to use bind variables in this procedure for static queries.
    PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
    IS
    BEGIN
    V_date DATE;
    SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
        DELETE FROM MER_CLEAR
        WHERE MER_DT < v_date
        AND ID = M_ID;
    COMMIT;
    END;   
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    Please help me.
    Thanks.

    976208 wrote:
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
    Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
    Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
    Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
    One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool.

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

  • How to use Javascript to load random pages?

    I wonder if anyone knows how to use Javascript to load a list
    of links stored in the text file.
    Every address will take a line, and the Javascript will
    randomly select one of the addresses to load.
    The user will click the button "random" and access the page
    randomly selected by the script.

    Addition note:
    I forgot to say this because my computer froze......(how
    lame)
    I got the code for random accessing the links.
    But now the problem is, is there anyway to parse a text file
    into the array in Javascript?

  • How to use JavaScript in Web bean generated JSP

    I want to do some simple JavaScript validations (for example, checking if a particular field is empty) in the JSP page rendered by the data web bean. Because the HTML is rendered by the bean, I'm not able to refer to the HTML controls in the JSP page. I'm not even able to refer to the form with the following standard piece of JavaScript code - "document.forms[0].control_name".
    Is anybody aware of how to use JavaScript with these rendered JSP pages?

    You just have to add it like and applet , including this line in your JSP or JSF
    <script src="http://dl.javafx.com/dtfx.js"></script>Then add the applet
    <script>
        javafx(
                  archive: "./resources/jar/Draw.jar",
                  width: 400,
                  height: 200,
                  code: "Draw",
                  name: "Draw"
    </script>./resources/jar/Draw.jar - is the path and the name of the jar

  • How to Use JavaScript in Controller Class...

    Hi All,
    Can any one tell me how to use JavaScript in Controller Class.
    Requirement is:
    I have
    Radio Group(RG1),
    Two Radio Buttons(RB1,RB2),
    Two messageTextInput(MTI1,MTI2),
    if i click RB1 i should Prompt to the end user to "Enter value for MTI1" or
    If i click RB2 i should prompt "Enter value for MTI2" while submitting page.
    Please let me know the steps to use JavaScript and the above client validation...
    Regards
    Alem...

    Using javascript is against the standard. I can tell you a workaround instead of you setting the javascript, check if that would be acceptable.
    You can use PPR and set the required property on the messageTextInput on clicking of the radio button. By doing this you will let UIX generate the javascript for you to handle the client side validation. But the validation will happen only on click of the submit button. The visual indicator is good enough to tell that the value has to be entered to the item.

  • How to use Bind Variables in Essbase data control

    Hi,
    I am trying to use Bind Variables in MDX query while creating the Essbase Data Control. I have used the below query with the Bind Variable.. this query is working in Essbase admin console..but it is throwing error (*Invalid MDX Query)* while creating Essbase Datacontrol in JDeveloper.
    MDX Query : SELECT {[Measures].Msr_2} ON COLUMNS, [Time].Children ON ROWS FROM cube
    where ($name)
    Could any body suggest me on how to use bind variables with Essbase Data control.
    Thanks,
    Swathi

    Hello Swathi, can you please help me how you created Essbase DataControl? Also were you able to figure out this?
    Thanks, Praveen.

Maybe you are looking for

  • Idoc Acknowledgement

    Hi all, I am having small doubt regarding the setting acknowledgement to Idoc while doing Idoc to File scenario. Where we can set the ack. to IDoc and where we can see the ack. in XI whether ack. is already set to IDoc. Is this necesary to load meta

  • NullPointerException in DBTransactionImpl::clearEntityCache

    Hi, In my app, to clear entity cache i use DBTransaction::clearEntityCache() API. But during some scenarios (i couldn't find what the scenario), when i call clearEntityCache(), i get null pointer exception. java.lang.NullPointerException      at orac

  • Mobile radio app

    My name is Rene, I live in Atlanta GA and I just brought the BB Pearl 8100 for my younger daughter and I May 30th. I am still trying to adjust to the qwerty keyboard for texting, but for the most part I am finding out that this phone is really user f

  • Purple color for Start button and Settings app dissapear shortly after install completes

    I have just completed a Reset of the latest win10 build 10041 to see if it would fix the error of all the grey colors. Settings app is grey and the start button is grey. Looks nothing like the screenshots I see on the web. After install was completed

  • Time taken to execute code vs time taken to render to screen....

    Hello Experts, I noticed something strange while debugging some of my code. I have a for loop in which I'm creating and adding node elements. Above the for loop I'm creating a modal window, and after the for loop I'm destroying the modal window. In t