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: 

Moving binary formatted file (from archive db) to printer

Former Member
0 Kudos

Hi,

We have a archive database and the tiff/pdf image is retrieved using the function module ARCHIVOBJECT_GET_TABLE. The image retrieved is converted as attachment and sent through email OR displayed in web page with the help of BSP application. No issues in this.

My current requirement is to automatically print the archived document. Using the above function module I can fetch the data from archive database. The output from this FM is in binary format. Pl suggest how this can be sent to a printer for printing (execution of the program to retrive / print will be a background job!).

Thanks,

Krish

9 REPLIES 9

former_member194669
Active Contributor
0 Kudos

Hi Krish,

May be you can convert the Binary output from fm ARCHIVOBJECT_GET_TABLE into text then send directly to printer.


TYPES : BEGIN OF TY_TEXT,
TEXT_FIELD(1000) TYPE C,
END OF TY_TEXT.

TYPES : BEGIN OF TY_BINARY,
BINARY_FIELD(1000) TYPE C,
END OF TY_BINARY.

DATA : LT_BINARY type table of TY_BINARY with header line.
DATA : LT_TEXT_OUT type table of TY_TEXT with header line.

* Convert binary to text.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
  INPUT_LENGTH = 100
  WRAP_LINES = 'X'
TABLES
  BINARY_TAB = LT_BINARY
  TEXT_TAB = LT_TEXT_OUT

Thanks

aRs

Former Member
0 Kudos

Hi Krishnan,

I'm trying to email the archived tiff/pdf image. However, I do not know how to convert the image from binary or from archiveobject using the FM ARCHIVOBJECT_GET_TABLE to the format required as an attachment.

Would you be able to shed some light on how to do this.

Thanks,

0 Kudos

Hi Kim,

While using ARCHIVOBJECT_GET_TABLE, you can get image as binary table from the table parameter "binarchivobject". Also from the importing paramter you can get the binary length in "binlength".

I am using the following steps to convert the binary to line format to send through email.

1. Using fm SCMS_BINARY_TO_STRING to convert the binary to string (inputs - binary length and binary table-- note- the data type for "binlength"(archiv fm) and "input_length" (SCMS fm) are different, so convert and use.

2. Using the FM - SO_STRING_TO_TAB, convert the string to line format. Input is the string output from SCMS fm and output is the table structure of structure SOLI.

Once it is converted as line structure it can be sent as attachment using the function module SO_NEW_DOCUMENT_ATT_SEND_API1 (key inputs are document data, packing list - this is the one which carries the index for texts / multiple images, object header, contents bin - this is the one which carries the image)

Regds,

Krish

0 Kudos

You don't have to call SCMS_BINARY_TO_STRING and SO_STRING_TO_TAB.

You can use TABLE_COMPRESS and TABLE_DECOMPRESS (even if the are obsolete). Try to look at FM SO_OBJECT_DATA_FOR_SEND_GET - there first ARCHIVOBJECT_GET_TABLE is called and then rutine table_copy(saplsokp) is called to do the compress/decompress. The result is a SOLI_TAB

TomS2
Explorer
0 Kudos

Hi Krishnan.

Did you find an answer to your problem? I'm facing the same. I need to put together a series of scanned images from the archive and print the lot.

Cheers

Tom

Former Member
0 Kudos

Hi Tom,

There are two indirect alternatives, which I found for this requirement.

1. We are using Esker software to send fax messages. I sent all the files which are required to be printed as fax message to this server and with the help of Esker developers, I directed this message to a printer.

2. If all the images are pdf then you can download to a folder, append it and then give a single print! This doesn't worked out for me since I have both pdf and tiff and it needs to be printed sequentially. If your requirement is only on pdf let me know so that I can send you the code which I tried to combine files.

Regds,

Krish

0 Kudos

hi Krishnan

thanx for your quick reply.

i had a look at Esker before, but i don't think it's an option to install this software in our system.

for now, the images are not all in PDF, but with some changes that could be the case later on. would appreciate if you had code-examples for appending and printing the PDF's.

do you know if it's possible to convert images of other types to PDF in ABAP?

cheers

tom

Former Member
0 Kudos

Hi Krishnan

I have the same problem, I need to print pdf doc. automatically and I can reach these files using BDS_GOS_CONNECTIONS_GET.

You said that you can download to a folder and append it and then give a single print is this done without the user get involved; if yes please explain it to me. If no please can you explain to me how you use the Esckar system to send the pdf to printer?

Regards

Mohammed

Former Member
0 Kudos

Hi Krishnan

I have the same problem, I need to print pdf doc. automatically and I can reach these files using BDS_GOS_CONNECTIONS_GET.

You said that you can download to a folder and append it and then give a single print is this done without the user get involved; if yes please explain it to me. If no please can you explain to me how you use the Esckar system to send the pdf to printer?

Regards

Mohammed