2012 Jun 15 1:47 PM
Hi ABAP Experts,
Requirement :
Need to Convert Binary Data(PDF data or DOC data or TXT data) into String.
Procedure:
lt_phio_content is a binary table of Table Type SDOKCNTBIN
CALL FUNCTION 'SCMS_BINARY_TO_STRING'
EXPORTING
input_length = v_fsize
IMPORTING
text_buffer = lv_string
TABLES
binary_tab = lt_phio_content
EXCEPTIONS
failed = 1
OTHERS = 2.
Problem:
I am not able to retrieve exact content of RTF or DOC or PDF binary data(Table type SDOKCNTBIN) with this Function Module.
Following is the output string when RTF binary data is passed
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}{\f2\fswiss\fcharset0 Tahoma;}}##{\colortbl ;\red0\green0\blue0;\red255\green255\blue255;}##{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 he
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
But I can able to get the correct string when binary data of text doc is passed with this function module.
Please provide me more details on this function module to retrieve correct string when RTF or DOC or PDF binary data is passed.
Thank You,
Swetha.C
2012 Jun 15 1:53 PM
2012 Jun 15 5:00 PM
works for me when I upload via CL_GIU_FRONTEND_SERVICES - method GUI_UPLOAD using "BIN" and into a binary table described like itab type table of tbl1024. Then I get the actual file size with another method of the class...
are you certain that you binary table is correct after your upload or import from apps server?
2012 Jun 15 6:42 PM
Hi Swetha,
What exactly is incorrect with the RTF output that you are getting? When I'm looking at that the only characters that look out of place are the '#' characters but I can say with 99.9% certainty that these represent carriage return/newline pairs because they are not displayable characters.
Regards,
Ryan Crosby
2012 Jun 15 11:13 PM
Hi,
"Convert Binary Data(PDF data or DOC data or TXT data) into String."
Binary is binary, String is character (character length depends on unicode).
You can convert binary data to XSTRING using class
Regards
Clemens
2012 Jun 18 11:17 AM
Hi ABAP Experts,
I am using function module BBP_PROCDOC_GETDETAIL to retrieve attachments in PHIO_CONTENT table of ET_ATTACH exporting parameters.
PHIO_CONTENT is of table type BBPT_ATT_CONT(line type = SDOKCNTBIN)
Using FM SCMS_BINARY_TO_STRING,
1. We are able to convert the text document binary data retrieved from PHIO_CONTENT to string exactly as it is in the document.
2. We are not able to convert the PDF binary data retrieved from PHIO_CONTENT to string exactly as it is in the PDF document.
Can any one please help me out of this problem to retrieve PDF data as string with this FM (SCMS_BINARY_TO STRING) other wise suggest me how to convert the PDF binary data retrieved from BBPT_ATT_CONT to string format.
Thank You,
Swetha.C
2012 Jun 18 3:25 PM
I only deal with PDF in XSTRING and binary tables. I don't know what you would get with converting to a string, but I doubt it would be readable or usable.
2012 Jun 18 4:26 PM
Hi Break Point,
Yeah. You are correct that PDF deals with binary data.
But I need to display the PDF data in my adobe form(created in SFP Tcode).
Thank You,
Swetha.C