on 12-05-2007 5:30 AM
In my application there is one RFC that has one import parameter String and a Table for import/export data from webdynpro.
The context of model node and attributes is as follows
A (Root Model Node for RFC)
|....B (Model Sub Node for Output)
|....C (Model Sub Node for Table)
|....x (Model attribute)
|....y (Model attribute)
Table structure in RFC is same as Model node C.
Before Executing RFC using
wdContext.currentAElement().modelObject().execute();
In Java end how to set or add data to x,y attribute so that RFC can get those values from table and insert into the ABAP table.
Hi,
use the setter for the attribute
Ex: wdContext.currentCElemement.setx(<Yourvalue>;
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SBS,
Try this code.
IWDMessageManager msg = wdComponentAPI.getMessageManager();
try {
String empid = 10020;
//or you can take empid from UI field also
// String empid = wdContext.currentValueNodeElement().getEmployeeID();
Bapi_Employee_Getdata_Input input = new Bapi_Employee_Getdata_Input();
input.setEmployee_Id(empid);
wdContext.nodeBapi_Employee_Getdata_Input().bind(input);
// Calls remote function module BAPI_EMPLOYEE_GETDATA
wdContext.currentBapi_Employee_Getdata_InputElement().modelObject().execute();
// Synchronise the data in the context with the data in the model
wdContext.nodePersonal_Data().invalidate();
} catch (Exception e) {
// TODO Auto-generated catch block
msg.reportSuccess(Message : +e.getMessage());
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SBS,
Check the code.
try
{
A aInputModel = new A();
for(int i=0;i<2;i++)
{
ZCstruc cDetails = new ZCstruc();
cDetails.setX(wdContext.nodeTest().getTestElementAt(i).getXVal());
cDetails.setY(wdContext.nodeTest().getTestElementAt(i).getYVal());
aInputModel.addC(cDetails);
}
wdContext.nodeA().bind(aInputModel);
wdContext.currentAElement().modelObject().execute();
wdContext.nodeB().invalidate();
}
} catch (WDDynamicRFCExecuteException e) {
msg.reportException("Error in Creation. Please try Again... "+e.getMessage(),true);
}
finally
{
TestModel testModel = (TestModel)WDModelFactory.getModelInstance(TestModel.class);
testModel.disconnectIfAlive();
}
Regards,
Mithu
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.