Skip to Content
Former Member
Sep 06, 2007 at 01:18 PM

Receiving and sending binary in a function



at first, something I did in another project I have made, just to describe the problem better:

Previously, I have programmed a WebDynpro Java Application and the BAPIs for that. The Webdynpro had to send objects, like jpg pictures or something else, to the backend system by calling a bapi.

That was possible to handle by using an importing parameter from the type "RAWSTRING". Inside the function, I have writte the content of that string to a file on the SAP server.

Later on, with another function, I had to read this jgp from the SAP server again and send it back in in an exporting parameter of the type "RAWSTRING".

That was possible without any problems....

Now, I have a situation, which is a little bit more difficult. Now In have an external system with a c++ application, whcih should send XML files in binary (rawstring) to the SAP, SAP should then read that xml file, select some data from the database, build a response XML and send this as binary (rawstring) back to the server.

This is almost the same like I did in my other project. but now, I have to read the XML-tags of the binary file, work with the content and build a XML file in a binary stream as result.

Do you think, I should save the incoming XML-binary stream in a temporary file on the SAP server, read it as textfile, interprete the XML tags, select the data, build the xml, write it to a binary file on the sap server and send that back?

Or how to read the XML tags directly from the binary stream I´m getting inside of the function.

Hopefully my description was understandable and you know, what I mean! 😊

Greetings Michael