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

Reference-Problem in RFC-Function Module

Former Member
0 Likes
1,961

Hello,

I am new to ABAP. As an introduction I read the book "ABAP Objects" from SAP Press.

I need a web service which returns a before uncertain number of objects.

First I have written a class representing my object. Then I added a new table type to the DDIC which has as "line type" simply my class as referenced type.

Afterwards I have implemented a function module which has an export parameter with the TYPE of my table type. The whole thing works fine, if I configure the function module as a normal function module. As soon as I click on RFC, I get the error message "Reference parameters are not allowed with RFC ". However, I have already clicked "pass by value" for the export- and import-parameters. The problem seems to be the table type with my class as referenced type.

Is the approach in general correct, to create a web service?

How can I fix the problem with the reference?

Best regards

Philipp

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
953

Hello Phillip

You cannot send references via RFC. However, if you have added the interface IF_SERIALIZABLE_OBJECT then you can serialize your object instance within the calling program and send it as XML stream to the RFC fm. In the RFC fm you can regenerate the object instance. This way you can read and change the object instance on the remote system yet I do not think you can transfer back any changes to the calling system.

Regards

Uwe

Read only

Former Member
0 Likes
953

Ok, I understand the problem is that I can not export any reference. And therefore no objects because the declaration has to be done with TYPE REF TO...

Can you tell me a little more detailed about the usage of the interface IF_SERIALIZABLE_OBJECT?

Is it possible to serialize the whole internal table which has to exported?

Would it have the same effect like a table type based on a structure with attributes like my object?

Best regards

Philipp