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

Problem passing string value via RFC

Former Member
0 Likes
477

Hello.

We have a big issue sending a string value via RFC.

We need to send some infotype data via RFC to the target system and what we do is encapsulate this data within a PRELP structure, just like this:

CALL METHOD cl_hr_pannnn_type_cast=>pannnn_to_prel_db

EXPORTING

pannnn = <fs_wa>

IMPORTING

prel_db = l_wa_prelp.

data: string type string.

string = l_wa_prelp.

and what we send via RFC is the string value...

The problem is the following: when we try to rebuild the structure with the data in the target system, all decimal values are set incorrectly, as if the string had been corrupted on the way there...

The wierdest thing is that we tried to test it with the same target system (DESTINATION 'NONE') and it worked! So we are thinking that it can be a coding issue, but we are not sure...

Is there any way to avoid this and make it work?

Thank you all.

Edited by: Miguel Ortega on Jun 19, 2009 11:05 AM

2 REPLIES 2
Read only

Former Member
0 Likes
418

Hi Miguel,

CALL METHOD cl_hr_pannnn_type_cast=>pannnn_to_prel_db
EXPORTING
pannnn = <fs_wa>
IMPORTING
prel_db = l_wa_prelp.

data: string type string.
*string = l_wa_prelp.
Move l_wa_prelp to string.  " Try this

I hope the variable in the receiving system is also having STRING data type. If not, then that could be the possible reason for corrupted data.

Would suggest to use declaration as follows in both system :-

data : lv_string(30) type c. " You may change the value depending on your requirement

Thanks,

Best regards,

Prashant

Read only

0 Likes
418

Hello.

We tried using char data types but still doesn't work well, in fact we started using string values because, char format was 'corrupted' during the RFC

Any ideas?