on 04-09-2010 10:08 AM
Hi All,
I want to send data to the back-end from a view,I have inputed the data in different rows of a table & I want to send the data to the back-end on the event of a click of a button tables respective of their columns in the back-end table.
Hi ,
For sending data to back end on click of button you can use this peace of code
Here Test is a value node which we can bind with Table.
int valueNodeSize=wdContext.nodeTest().size();
for(int i=0;i<valueNodeSize;i++){
IPrivateCheckView.ITestElement valueEle=wdContext.nodeTest().getTestElementAt(i);
//=================Create Model Node Element===================
IPrivateCheckView.IModelElement modelEle=wdContext.nodeModel().createModelElement();
modelEle.setAddress(valueEle.getAddress());
modelEle.setName(valueEle.getName());
wdContext.nodeModel().addElement(modelEle);
}
Regards
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please find sample code to interate table values and to send data to backend RFC on click of a button.
Bapi_Mat_Dispach_Input dispach_Input = new Bapi_Mat_Dispach_Input();
ZStr_Mat_List mat_List;
//iterate the table datasouce node and set the values to RFC
for(int i=0;i<wdContext.nodeMaterialDetails().size();i++)
{
mat_List = new ZStr_Mat_List();
mat_List.setChallan_Date(wdContext.nodeMaterialDetails().getMaterialDetailsElementAt(i).getChallan_Date());
mat_List.setDeliveryQty(WdContext.nodeMaterialDetails().getMaterialDetailsElementAt(i).getDelivery());
. . .
. . .
dispach_Input.addIt_Details(mat_List);
}
wdContext.nodeBapi_Mat_Dispach_Input().bind(dispach_Input);
//executing RFC
wdContext.currentZpps_Bapi_Cspd_Mat_Req_Dispach_InputElement().modelObject().execute();
Call the RFC execution code on click of Button to send the data to RFC.
Regards,
Bala Baskaran.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anurag,
If you want to send table data to backend system then you need to execute the model node(RFC/BAPI).
before executing need to iterate the table data from context node and set to backend table for your RFC/BAPI.
Then exeute you model. find the code to saving table data to backend system. refer to the link and find the tutorials
https://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-Adaptive+RFC
Hope it helps
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.