Skip to Content
-1

Convert Binary data to Spool

Feb 02 at 01:21 PM

182

avatar image

Hi All,

Can someone please help me to meet the below requirement.

Need function modules to convert Binary Data to Spool.For this, I am using below function modules to create spool.

1.RSPO_SR_OPEN : Creating spool with doctype as 'BIN'.

2.RSPO_SR_WRITE_BINARY: Writing binary data to a spool.

After creating the spool it showing some junk characters in the output.

Thanks in Advance.

Thanks!

Sairam

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sandra Rossi Feb 02 at 03:00 PM
1

Binary data corresponds, by definition, to junk characters. What else do you expect, and why?

Show 8 Share
10 |10000 characters needed characters left characters exceeded

Hi Sandra Rossi,

Thanks for the reply.

Here my requirement is to convert the Binary data to SAP spool to print the files from SAP i.e; either PDF or Image files.To meet this requirement I tried to write the data to spool using the FM "RSPO_SR_WRITE_BINARY" and it happened successfully using the fm.After closing the spool then I am trying to check using the transaction SP01 then below is the screen appearing in the spool.

Can you please suggest how to move forward.

Thanks!

Sairam

error-spool.png (88.6 kB)
0
parimi suryasairam

So, this is binary. The display converts the bytes into characters, they are said to be junk. Normal. Perfect. Now, what is your question?

0

Hi Sandra,

My aim for this is I want to take the print from the Spool finally.But when I check spool it's displaying the binary data.

Here my expectation need to get the Print from the spool same like as PDF.

Thanks!

Sairam

0
parimi suryasairam

Sorry I missed your point in your previous reply. You are assuming that a spool containing any file can be printed, but you're wrong.

In ABAP-based solutions, only spools containing OTF (Smart Forms, SAPscript forms) and ABAP List formats can be translated into the languages of printers (PCL, PostScript, etc.) With Adobe Forms in SAP, the spools are linked to files generated by ADS directly in the language of the target printer.

For printing files coming from other sources (not Smart Form, not SAPscript, not Adobe Forms in SAP), you can't use ABAP, but an external solution (for instance, one which is SAP-certified, using the BC-XDC interface).

For images of type BMP/TIFF, a workaround is to wrap them into SE78 and then into a smart form.

You should better update your question or create a new one.

2

Another questions on your requirements:

I look at your question. Why are you doing those steps? What are you sending to the spool? Smartform, PDF, SapScript? Any of those can be sent without being switch to binary. So why / what are you switching to binary before printing?

1.RSPO_SR_OPEN : Creating spool with doctype as 'BIN'.

2.RSPO_SR_WRITE_BINARY: Writing binary data to a spool.

0

Hi Michelle,

We are getting the Binary data from the Non SAP system using RFC.Once we get the binary data from the third party we need to print the file from the Spool because of this reason I am using FM to create spool.

Thanks!
Sairam

0

Hi Sandra,

I tried to convert the Binary data to OTF format using few standard function modules in this case spools generating successfully with the below format.

Also, i tried to upload the files using SE78 and that works fine for me.But my requirement is I don't want to create any image in SE78.can you please suggest Is there any other possibilities to convert binary files to printable spool.

Thanks!

Sairam

0
parimi suryasairam
Spools can be created with anything inside, but only OTF, ABAP lists and content in printer languages (PCL, postscript, etc.) can be printed, so... you're stuck.

Nothing more to add to my previous answer.

1