Application Development 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: 

SWNC_STATREC_READ TaskType values in XML

Former Member
0 Kudos

Hope I'm posting this to the right place. I couldn't find an RFC specific forum anywhere.

I'm working on an app in C using RFC to call the function module SWNC_STATREC_READ. When I receive back the normal records in XML format, the task type values don't seem to be correct. For example, for an obvious RFC record, the task type field is "<TASKTYPE>/g==</TASKTYPE>". I've looked at the constants for task type in CL_SWNC_CONSTANTS and things don't seem to match up. How am I supposed to get a raw 254 value from this string? I'm assuming the encoding is UTF8, so I've tried to break the values down to hex and binary and figure out some kind of pattern that would tell me something is off (byte or nibble swapped, etc) but haven't had any luck. With the example, /g== would be 2F 67 3D 3D in hex, this doesn't seem to get me near the FE value I'm looking for. I've looked at several other task types from this data and am still at a loss in figuring it out. I have several other 'raw' fields to extract that seem to have the same formatting.

Thanks for any help.

2 REPLIES 2

Former Member
0 Kudos

Update: I've tried changing the codepage of my RFC connection with no effect. The SAP system I'm connecting to is 4103 (UTF-16LE).

Former Member
0 Kudos

...and the answer is, Base64 encoding. I don't deal with XML too often and didn't recognize it. Many searches later thru SDN and I stumbled on the answer.