cancel
Showing results for 
Search instead for 
Did you mean: 

Problems sending Input Table back to R/3

Former Member
0 Kudos

Hello,

I have a RFC that has Table parameter say "InputLoad".

In webdynpro, I populate this table dynamically.

This works fine.

But when I execute the model, the values are not passed to R/3? What am I missing?

Do I again need to create an instance of the model and then copy all the elements one by one and then execute it?

There should be some simplar way.

Any suggestions are welcome.

Regards,

Shubham

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

after importing the model you will also have the table which you are sending as input parameter,

so while binding the model

z<rfc-name> r1 = new z<rfc-name>();

z<table-name> tab = new z<table-name>();

tab.set<table-columns>("value");

r1.add<table>(tab);

only then value will get passed in the table.

Former Member
0 Kudos

Hi Subham,

I don't know If I can be help you out. I'll give you the usual steps I follow to connect to R/3.

Say you have an RFC 'ZMYRFC' which uses a table 'mytable' of type some type 'ZTAB'. When binding this node make sure you bind the tables inside th 'output' node and not those outside to it. The lines of code you need to write to invoke this RFC with the table as input are :

ZMYRFC_Input input = new ZMYRFC_Input() // create an instance of the Input class;

ZTAB table = new ZTAB();

//if you do not know table type of 'mytable', check the function input.addMytable(<table type>)

table.set<property>('value');

.

.

table.set<property>('value');

input.addMytable(table);

wdcontext.currentZMYRFC_inputElement.bind(input);

wdContext.currentZMYRFC_inputElement().modelObject().execute();

wdContet.nodeOutput.invalidate()

// clears the old value in the output node

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Subham,

My suggestion is first check in R/3 system weather insertion is working or not using se37 transaction .

Regards, Anilkumar

Former Member
0 Kudos

Hi Anilkumar,

The insertion works.

If we remember the flight program example, in that before excuting the model we bind the nodeelement again to the node and then execute the model.

Here also now I am doing the same, but still there is no data being passed to backend.

Any sample code of any table passing to backend will be helpful.

Regards,

Shubham

Former Member
0 Kudos

Hi

Can anyone share his code to pass a table back to the RFC?

This is urgent.

Regards,

Shubham

Former Member
0 Kudos

Hi,

do check the following article it will answer all your queries regarding passing table and structures to RFC.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/li... rfc to web dynpro.pdf

Regards,

Vijith

Former Member
0 Kudos

Hi Vijith,

I am stuck up at the following place.

try {

wdContext.currentZ_Kwf01Modify_Pax_Size_InputElement().modelObject().execute();

wdContext.nodeModifyPaxSizeOutput().invalidate();

} catch (Exception ex){

ex.printStackTrace();

}

In this code, when I check the values of the node Addnpaxload inside Z_Kwf01Modify_Pax_Size_Input, it has 10 rows. But when I see the table Addnpaxload in R/3, there is No record.

Am I missing something. Do I need to create another instance of the model and then copy all the values from one node to other?

All inputs are welcome.

Regards,

Shubham