cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass value in Table import parameter of an RFC

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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^

Former Member
0 Kudos

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

former_member197348
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Siva,

The problem is a bit different

my problem is that in Bapi import parameter is in the form of a table structure so i am now able to set values in that table fields through webdynpro

please help

former_member197348
Active Contributor
0 Kudos

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