‎2008 Nov 12 11:40 AM
Hi i am using function module SCMS_BINARY_TO_STRING to convert Binary data [28*1000] to Text format.
DATA outrec TYPE string.
CALL FUNCTION 'SCMS_BINARY_TO_STRING'
EXPORTING
input_length = 28000
FIRST_LINE = 1
LAST_LINE = 28
MIMETYPE = ' '
IMPORTING
text_buffer = outrec
OUTPUT_LENGTH =
TABLES
binary_tab = l_pdf_data
EXCEPTIONS
FAILED = 1
OTHERS = 2
.
The resultant Text data is stored in "outrec" variable. But when i try to write this data to file, I notice that outrec does not contain all the data in the Binary format.
Can you please advice, if I am passing the parameters wrongly.
Thanks
Shital
‎2008 Nov 12 11:59 AM
can u please explain what l_pdf_data holds...so that we can check and correct ur error.
‎2008 Nov 12 12:04 PM
This is how l_pdfdata gets populated. The below FM read data from PDF formated spool
*Read the spool content
CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
EXPORTING
i_spoolid = p_spono
i_partnum = '1'
IMPORTING
e_pdf = pdf_data
e_pdf_file = file
EXCEPTIONS
ads_error = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
Modify the spool contents to prepare internal table
l_len = XSTRLEN( pdf_data ).
WHILE l_len >= 1000.
l_pdf_line = pdf_data+l_offset(1000).
APPEND l_pdf_line TO l_pdf_data.
ADD 1000 TO l_offset.
SUBTRACT 1000 FROM l_len.
ENDWHILE.
IF l_len > 0.
l_pdf_line = pdf_data+l_offset(l_len).
APPEND l_pdf_line TO l_pdf_data.
ENDIF.
‎2009 May 10 6:27 PM