cancel
Showing results for 
Search instead for 
Did you mean: 

updating database table

Former Member
0 Kudos
85

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....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

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

Best regards

former_member254270
Participant
0 Kudos

Hi,

U did not create the object of the model.U create that and bind that to the Main node of ur context and execute the model.The main thing u have to do is to invalidate all the response nodes.There is no need to create separate Nodes u can make use of Model nodes and get ur work done.

Follow this link,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

Thanks.

Former Member
0 Kudos

Did you check [this|http://www.octavia.de/fileadmin/octavia_files/content_bilder/Hauptnavigation/SAP_NetWeaver/WebDynpro/Web_Dynpro_Part_II.pdf?PHPSESSID=c528a60bf8857431c0fa6f6595639da7] and [this|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/761eba66-0401-0010-b982-d5f5bd9e8f90] ?