on 01-23-2008 1:22 PM
Hi all,
I have an RFC in which import parameters are in the form of a table
so now when i imported that RFC in my webdynpro application and Apply Service Template to it, it created the structure but when i applied form template to it all the inputfields were readonly
and also when i tried to set the input parameter of that table like:
wdContext.currentBAPI_CREATEElement.set<field>("value");
it shows null pointer exception
MY Context structure created after service template is as follows:
Model Node Zcreate_rfc, it icludes another model node
BAPI_CREATE, and it then includes the input parameters
Please tell me how to solve the problem
hi
good
check this link,hope this would help you to slove your problem.
http://search.cpan.org/~piers/SAP-Rfc-1.55/Rfc.pm
thanks
mrutyun^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Suppose the RFC is called ZRFC, and the table structure is called TableStruct, then this works for me (in execute method before calling execute):
ZRFCInput input = wdContext.currentZRFCElement().modelObject();
// these are regular import parameters
input.setAaa(aaa);
input.setBbb(bbb);
if (input.getTableStruct()!=null) {
input.getTableStruct().clear();
}
// In this loop table rows are added
for (int i=0; i<sourcList.size(); i++) {
ZTableStruct table = new ZTableStruct();
table.setDdd(((SomeBean) sourcList.get(i)).getDdd()); // for property ddd
input.addTableStruct(table);
}
Good luck, Roelof
Edited by: R. Knibbe on Jan 23, 2008 3:25 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
Create elements of the node as many as you want like
for(int i=0;i<SIZE;i++)
{
IPrivate<view>.I<Node>Element ele = wdContext.create<Node>Element();
wdContext.node<Node>().add(ele);
}
Now your table will be input-enabled.
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
If you want to send the table to RFC, do like this:
Say your node is tableNode.
for(int i=0;i<tableNode.size();i++)
{
IPrivate<view>.I<tableNode>Element ele = wdContext.create<tableNode>Element();
ele.setX();
....//set all parameters
wdContext.node<tableNode>().add(ele);
}
//call RFC
regards,
Siva
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.