Skip to Content
author's profile photo Former Member
Former Member

Read Table onBlur of Inputfield

Hi,

I have a inputfield say: t_comp_code where I want the user to enter the Company Code.Then I want to check the Company Code master table to see if the entry exists or not. This I want to do oBlur of the field and then output an error message in an alert box via Javascript.

How do I achieve reading an internal table & then calling the Javascript function if sy-subrc = 0?

And where do I select all values of the master table?

As I am new to BSP I am having problems visualizing this.

Please help.

Regards

Tejaswini

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2004 at 12:52 AM

    check out onClientClick you can activate Javascript there for a button element or so.

    As for giving a variable to JavaScript you have to set the variable in your event handler then pass it to your page layout

    <script>
    alert(<%=myvalue%>);
    </script>
    

    If you set a page attribute called myvalue TYPE STRING and in OnCreate set

    myvalue = 'hello'.
    

    Do that on a test page and you will get a good idea how passing to JavaScript can work.

    As for reading tables and so you can do that in the Event Handlers or in the page layout with ABAP.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.