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

updating database table

Hello All,

I am trying to update a database table, the new values for the table will come from input fields from a table.

I created a value node...and created three attributes to it...let say name, age, current date. the node structure looks like this:

node:person

-


>name

-


>age

-


>currdate

to begin with i just enable two first rows of the table to input data....now I am trying to copy this input data to the model table...coming from BAPI....

model node structure looks like this:

node: Zbapi

-


Output

-


outtab <---this is the table i want to pass my data

but I am not able to do so...

I also tried to bind the bapi table(outtab) directly to the UI elements...so that the data can go directly to the bapi and i donot need to copy my value node to the model table....but the input fields are grayed out i can not input any data to it...i could not add the elements to this model table....

can anyone pls tell me how can i bind my outtab to the UI element for user to input data....

Thanks....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2008 at 05:19 AM

    Hi,

    you have to initialize your model node..

    public void wdDoInit()
      {
    Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
        wdContext.nodeBapi_Flight_Getlist_Input().bind(input);
        input.setDestination_From(new Bapisfldst());
        input.setDestination_To(new Bapisfldst());
    }
    
    

    It will enable your input fields.

    Thanks

    Abhilasha

    Edited by: Abhilasha Dahare on Sep 15, 2008 7:19 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 14, 2008 at 10:46 PM

    Hi,

    I think you need to initialize the RFC node. If you don't initialize it, the fields are show gray.

    Best regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 14, 2008 at 05:58 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2008 at 10:13 AM

    Hi J Are

    If you want to pass the values to the bapi as input then you have to copy the values to the directly under the node "Zbapi" which is going to act as the input values. "Output" node is a structure which is going to hold the data in respective node which comes from the back end.

    You can pass the input parameters to the Bapi only if it is under the "zbapi_input" node or input parameters are declared in the form of a node which is not present "zbapi" node. Anything under the "output" node is the actual output. Also check if those attributes which you want to pass as input are declared under the "import" parameters in the Bapi. If the attributes which you want to declare as input parameters are under a node which is a child node of "zbapi_input" then make use of the code to activate those attributes.

    The code is

    public void wdDoInit()

    {

    Zbapi_Input input = new Zbapi_Input();

    wdContext.nodeZbapi_Input().bind(input);

    input.setAttribute1(new Zbapifl());

    input.setAttribute2(new Zbapifld());

    }

    For the above code make necessary changes as per the nomenclature of your Bapi.

    If any queries then do reply the post.

    Thanks & Regards,

    Yusuf.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2008 at 01:40 AM

    solved the issue...

    My problem was not initializing the table.

    my context was like this:

    Zbapi

    ---output

    -ztab < this table was coming from bapi under the import parameter and is type of ztab1 which is the table type in data dictionary.

    what i did is declare a variable of type

    Zbapi input = new Zbapi();

    ztab1 tab;

    for(i=0;i<size;i++){

    tab = new ztab1();

    input.addztab(tab)

    }

    the "size" is coming from user input value from previous view...

    this for loop is in wdDoInit() method of component controller.

    Thanks for your help

    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.