cancel
Showing results for 
Search instead for 
Did you mean: 

save binary data

Former Member
0 Kudos

Hi all,

i want to create a function module getting a binary data stream of undefined length as importing parameter, which saves this binary data stream as it is.

Tried with SCMS_BINARY_TO_XSTRING and then e.g. Mime Repository Class Interfaces using xstrings, but this BINARY_TO_XSTRING needs a table of binary data of DEFINED length.

Any advice? Thanks in advance!

Christoph

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Cristoph,

If you want save a binary stream in a file you can do it as follows:

<i>REPORT zzzztest.

CONSTANTS file TYPE text80 VALUE 'test'.

DATA stream TYPE xstring.

stream = '4142434445'.

OPEN DATASET file FOR OUTPUT IN BINARY MODE.

TRANSFER stream TO file.</i>

Of course when you open this file by a text viewer you'll see 'ABCDE'.

p.s.:

addition 'IN BINARY MODE' is default so you can omit that.

:bus

nablan_umar
Active Contributor
0 Kudos

Hi Christoph,

Where you want the binary data stream saved to? If it is a DB table, then you can define the a custom table with type XSTRING as per my colleague answers.

former_member183804
Active Contributor
0 Kudos

Hello Christoph,

what Release you are on? At least with 6.10 or higher you can store String / XStrings on Database. You just can define the XString as part of the DB table definition.

Kind Regards

Klaus

Former Member
0 Kudos

the R/3 system has got a 6.20 Basis.

But I'd rather use standard functionality than self defined tables.

Christoph