Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with the RFC function module - parameters

Former Member
0 Likes
3,727

Hi,

When i am creating RFC enabled function module, it was throwing an error like <b>'Reference parameters are not allowed with RFC'.</b>. I am implementing the test scenario to create BAPI, for that i have created table with 2 fields. My main intension is through RFC enabled function module planning to update the ztable.

When i was creating RFC enabled function module, it was giving error. I remembered that i need to use new structure when i create RFC enabled function module, so even i created structure also with the same fields of table fields.

can you please let me know the solution for this.

Thanks

jaya

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
1,601

Hi Jaya,

There is a "Pass by Value" checkbox, just check that and you wont get the error. The basic reason behind is since an RFC is called by a different system the parameters have to be sent as values than as references.

Regards,

Ferry Lianto

Read only

0 Likes
1,601

Hi Ferry,

Your solution is perfect. can you please explain the below information...

Call by value

You pass the parameter with values. This means that the parameter

contents are copied both when the parameter is passed and when it is

transferred back to the calling parameter. For structures that contain

tables, performance may be reduced considerably. Therefore, you should

not do this.

I created the parameters with reference to table-fields, what do you mean by 'Call by value'check box usage there.

Is it mean ...if i change the contents of the field in FM will it pass back to the structure which i refered to this parameter, in this case its table-field.

Thanks

jaya

Read only

ferry_lianto
Active Contributor
0 Likes
1,601

Hi Jaya,

As I explained earlier, since an RFC is called by a different system the parameters have to be sent as values than as references. In other word, you need at least to pass back a value to calling system.

If i change the contents of the field in FM will it pass back to the structure which i refered to this parameter, in this case its table-field.

No, it will not change the content of table-field.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,601

Hi,

In RFC function module, data will be passed through parameters using "Pass by Value" concept. And most important thing is from whichever system this RFC enabled function module is called, that system compulsorily expects a return value. Hence we have to pass data using Pass-by-value and get result using Pass-by-value. for this you have to check the checkbox "Pass by value" compulsorily in the function module import/export parameters section.

thanks,

sksingh