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

String as Input/Output Parameter in RFCs

Former Member
3,900

Dear experts,

I trying to pass XML-Strings to a SAP System using RFC-Components.

I found in a SAP-Press-Book that it´s not possible to use the ABAP data type "String" as import and export parameter since the length has to be determined when programming the FM.

On the other hand I saw RFC-FM with String als parameter.

Is this a version issue? Anyone some information on this topic.

Thanx

Oliver

1 ACCEPTED SOLUTION
Read only

rainer_hbenthal
Active Contributor
0 Likes
1,961

As far as i know strings are not allowed in RFC FM because its a deep structure. Never saw this running in any versio, but of course i didnt tried that everywhere.

A table of char1024 might be useful for this, splitting the string into 1024 byte portions.

6 REPLIES 6
Read only

rainer_hbenthal
Active Contributor
0 Likes
1,962

As far as i know strings are not allowed in RFC FM because its a deep structure. Never saw this running in any versio, but of course i didnt tried that everywhere.

A table of char1024 might be useful for this, splitting the string into 1024 byte portions.

Read only

0 Likes
1,961

Hi Rainer,

thx for your response.

The idea that Strings are not allowed as parameters was my idea aswell. But SAP uses it in FM "RSR_NET_INTERFACE" (i.e.)...

So there must be a way...

Thx

Read only

0 Likes
1,961

Then give Pass Value option a try.

Read only

0 Likes
1,961

Hi Rainer,

I did.. doesn't work... strange...

Read only

uwe_schieferstein
Active Contributor
1,961

Hello Oliver

I am not sure where the problems lies but I can create and call the following RFC-fm (rfcdest = 'NONE') without any problems (on our 4.6c):


FUNCTION z_us_rfc_with_string.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(ID_INPUT) TYPE  STRING
*"  EXPORTING
*"     VALUE(ED_OUTPUT) TYPE  STRING
*"----------------------------------------------------------------------


  ed_output = id_input.


ENDFUNCTION.

Regards

Uwe

Read only

1,961

Hi Uwe,

thx for your input.

I believe the problem lies in the RFC SDK used - doing the RFC-Call.

I found that in the current version NW RFC SDK Strings are allowed as data type...diffrent to the "classic" one...

Thanx to every body for your help!

Regards Oliver