Skip to Content

Getting NULL from iCommand's getValue() method

Hi all

I am trying to get the details of an employee based on its name.

i have created a query with '[Param.1]' in it. .

i also set the value in it using setParam() method.

But i am unable to get the whole row of that data according to the name.

And there is no redundancy in names.

Regards

Anish

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Sep 26, 2014 at 09:04 AM

    Hi Anish,

    To simplify your approach, you can use a iGrid Display template with your query. Now when you create an applet say named "App1" with this QT/DT combination, keep the height and width as 0.

    Second step would be to get the values for the cells using following code:

    document.getElementById("TextBox1").value = document.App1.getGridObject().getCellValue(rowIndex,colIndex);

    Somemore methods that would help you are in the following blog:

    http://help.sap.com/saphelp_me61/helpdata/EN/4c/d57bccf29560c6e10000000a15822d/content.htm?frameset=/EN/4c/c8a1d98e9b60c…

    Hope this helps.

    Thanks,

    Swaroop

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 26, 2014 at 07:36 AM

    This is how my page looks like. .

    As you can see that i have clicked on a name under EMS.

    Now what i want is that when i click on "Anish" the details of it should be fetched from the database and should be displayed in respective textboxes.

    Now above is the source code of my page

    Above, in the ItemSelection function i am setting parameter and trying to access the data from database with the help of applet.

    But i am getting "blank" from the 5th line in the ItemSelection() function.

    This above image is of the SQL query which i wrote

    Please help me out.

    Thanks

    Regards

    Anish


    Page2.PNG (139.3 kB)
    SourceCode1.PNG (63.8 kB)
    Query2.PNG (70.3 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 26, 2014 at 05:35 AM

    Dear Anish,

    You should be using fixed query or SQL query to get the record. I command is meant specifically for Insert, Update, Delete type of commands. iCommand QT would give you result with no. of rows effected.

    Hope this helps. Let me know if you have any further queries on query templates.

    Warm Regards,

    Swaroop

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Anish,

      You can use either SQL with SQL or FIxed mode. It all depends of the complexity of query you want to use.

      Rather, if you are uncertain about the syntactical details, you should use SQL mode of SQL query. If you are writing a complex logic in the query, better go for fixed mode of the sql query.

      Rest all remains same, like passing param using [Param.x] key etc. Help me with some screenshots if you need any further digging into your issue.

      Hope this helps.

      Thanks,

      Swaroop

  • Posted on Sep 26, 2014 at 11:41 AM

    Depends!! What version are you using??

    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.