Purpose
Transfer a binary file |
Solution
GuiXT does not provide direct support for binary files, since in the internal representation all GuiXT variables are strings which are terminated by a 0-byte. To transfer binary files, e.g. a .png image file or a PDF, it is best to use a text format of the file. In order to achieve the character format, you may use JavaScript, VB.NET or C#. A conversion to hex code, e.g. "3100" for the "1" and a 0-byte, or the Base64 format commonly used in the web environment, are possible. Alternatively, you can read the file with CopyText and the -hexadecimal option and then use GuiXT means to convert it into a table with fixed length rows (see variant 2 below).
Example
The code below does not contain any error handling, e.g. handling missing authorizations to store the object in the MIME repository. |
GuiXT InputScript, variant 1 (with JavaScript call)
GuiXT
|
JavaScript |
ABAP function module
ABAP
The function module is not remarked as "RFC enabled" in order to allow strings in the interface. The Open Call interface allows us to call up modules which formally are not RFC-enabled in the function library. ![]() |
GuiXT InputScript, variant 2 (without JavaScript call)
GuiXT
Components |