CONVERT_RTF_TO_ITF
Hi experts ,
Can any one give the code for executing the Function Module CONVERT_RTF_TO_ITF.
Hi experts ,
Can any one give the code for executing the Function Module CONVERT_RTF_TO_ITF.
Similar Messages
-
Conversion Error in CONVERT_RTF_TO_ITF
Dear all,
I´m using FM CONVERT_RTF_TO_ITF to convert contents of an .rtf document to SapScript format. This basically works fine. Since the customer is based in Austria, there is a need to convert german special characters in the text as well (ä, ö, ü, ß).
This works for some characters, but not for all. I do get some incorrect results, that actually look like chinese characters. Here´s an excerpt of the result of a conversion
<< looking good >>
Ich habe soeben erfahren, dass sich die Flughafensteuern für Ihr Ticket
nach ... erhöht haben.
<< /looking good >>
<< looking not so good >>
Die anfallenden Geb黨ren (Flughafensteuern) werden von der jeweiligen
Fluglinie an die einnahmeberechtigte Stelle zB. Flughafen AG abgegeben.
F黵 die Berechnung ist der Kurswechsel am jeweiligen Tag
ausschlaggebend, da die Betr鋑e in der jeweiligen Landesw鋒rung
anfallen. Daher k鰊nen sich die Taxen ver鋘dern, wenn das Ticket nicht
am Tag der Buchung ausgestellt wird.
<< /looking not so good >>
I tried to debug into form import_rtf (subsequently called by FM CONVERT_RTF_TO_ITF) but didn´t get any hints on where the error occurs.
I kind of think that it may be a problem linked to our systems codepage, since we are running a unicode database and i found a line of coding, that looks suspicious to me in form import_rtf (include LSTXKFRI, line 19)
ascii_codepage = 1133. " empirisch, bis genau bekannt
Any ideas?
Thanks a lot & Regards
ChristophJust in case somebody´s interested! I found that the source .rtf files we were trying to convert were not valid .rtf, at least in the way SAP sees it.
We removed some of the formating information, then the FUBA was able to parse the code directly.
Thanx anyway & Kind regards
Christoph -
Sample code CONVERT_RTF_TO_ITF
hi Guys.
I have a requirement that I need to upload RTF file in to SAP Script format. For that I am using the FM CONVERT_RTF_TO_ITF I donu2019t know how to use it .
Can you please provide me sample code and sample data what data needs to pass to FM. After some analysis I have observed the below points.
1. RTF should be converted into RAW data (HEXA)
2. RAW data needs to pass FM CONVERT_RTF_TO_ITF
I tried by above steps but no luck. plz do need full.
~YSR
Moderator Message: No Sample codes will be provided here. First construct a code of your own. If you have any issues with it, post the relevant portions here and ask for clarifications.
Edited by: kishan P on May 19, 2011 12:29 PMHi,
<<removed by moderator>>
checkout this,may help u..
regards.
Edited by: kishan P on May 19, 2011 12:29 PM -
CONVERT_RTF_TO_ITF execuion
hello guru's,
Can someone tell me how to execute the FM CONVERT_RTF_TO_ITF.
Thanking in advance.
Vikr@mhello guru's,
Can someone tell me how to execute the FM CONVERT_RTF_TO_ITF.
Thanking in advance.
Vikr@m -
Error while converting RTF to PDF
Hi,
I have got a requirement to convert .rtf file to .pdf file while downloading. The .rtf file is in application server. I have used the FM CONVERT_RTF_TO_ITF to convert to ITF format. After this I am using the FM CONVERT_OTF to convert it to pdf format. But in this step I m not getting the pdf format file. I am getting an exception 'ERR_BAD_OTF'. Is there any other step in between after converting to .itf format and convert_otf. Can any one please help me on this.
Thanks & Regards,
Rama.Hi,
Use the FM's in the following order :
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lc_formname
IMPORTING
fm_name = v_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION v_fm_name
EXPORTING
IMPORTING
job_output_info = gt_job_output
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = v_bin_filesize
TABLES
otf = gt_job_output-otfdata -
How to convert a Word document to text or html in an ABAP program
Hi,
At my client's site, for the recruitment system, they have the word processing system set to RTF, instead of SAP Script. This means that all the correspondence is in Word format. A standard SAP program takes the word letter, loads word, does the mail merge with the applicant's info and then sends the document to a printer.
The program name is RPAPRT05. The program creates a document proxy (interface I_OI_DOCUMENT_PROXY) and manipulates the document using the methods of the interface.
Now what we want to do is to instead of sending the document to a printer, we want to email the document contents to the applicant. But I don't know how to get the content from the Word document into text or html format so that I can make an email from it.
I know I can send an email with the word document as an attachment, but we'd prefer not to do that.
I would appreciate any help very much.
ThanksOk, here's what I ended up doing:
First of, in order to call FM 'CONVERT_RTF_TO_ITF' you need the RTF document in a table with line length 156. The document is returned from FM 'DP_CREATE_URL' in a table with line length 132. So first I convert the table:
Transform data table from 132 character lines to
256 character lines
LOOP AT data_table INTO dataline.
IF newrow = 'X'.
Add row to new table
APPEND INITIAL LINE TO xdatatab ASSIGNING .
newrow = space.
ENDIF.
Convert the raw line of old table to characters
ASSIGN dataline TO .
Check line lengths to determine how to add the
next line of old table
newlinelen = STRLEN( newline ).
ADD addspaces TO newlinelen.
linepos = linemax - newlinelen.
IF linepos > datalen.
Enough space available in new table line for all of old table line
newline+newlinelen = oldline.
oldlinelen = STRLEN( oldline ).
addspaces = datalen - oldlinelen.
CONTINUE.
ELSE.
Fill up new table line
newline+newlinelen(linepos) = oldline(linepos).
ASSIGN newline TO .
newrow = 'X'.
Save the remainder of old table to the new table line
IF linepos < datalen.
oldlinelen = STRLEN( oldline ).
addspaces = datalen - oldlinelen.
CLEAR newline.
newline = oldline+linepos.
ELSE.
CLEAR newline.
ENDIF.
ENDIF.
ENDLOOP.
Write the last line to the table
IF newrow = 'X'.
APPEND INITIAL LINE TO xdatatab ASSIGNING .
Next I call FM 'CONVERT_RTF_TO_ITF' to get the document in SAPScript format:
Convert the RTF format to SAPScript
CALL FUNCTION 'CONVERT_RTF_TO_ITF'
EXPORTING
header = dochead
x_datatab = xdatatab
x_size = xsize
IMPORTING
with_tab_e = withtab
TABLES
itf_lines = itf_table
EXCEPTIONS
invalid_tabletype = 1
missing_size = 2
OTHERS = 4.
This returns the document still containing the mail merge fields which needs to be filled in:
LOOP AT itf_table INTO itf_line.
WHILE itf_line CS '«'.
startpos = sy-fdpos + 1.
IF itf_line CS '»'.
tokenlength = sy-fdpos - startpos.
ENDIF.
token = itf_line+startpos(tokenlength).
REPLACE '_' IN token WITH '-'.
ASSIGN (token) TO .
ENDIF.
MODIFY itf_table FROM itf_line.
ENDWHILE.
ENDLOOP.
And finally I use FM 'CONVERT_ITF_TO_ASCII' to convert the SAPScript to text. I set the line lengths to 60, since that's a good length to format emails to.
Convert document to 60 char wide ascii document for emailing
CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
EXPORTING
formatwidth = 60
IMPORTING
c_datatab = asciidoctab
x_size = documentsize
TABLES
itf_lines = itf_table
EXCEPTIONS
invalid_tabletype = 1
OTHERS = 2.
And then the text document gets passed to FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' as the email body. -
How to download and convert RTF/DOC file in DMS into PDF file
Hello.
We're on ECC6.0. We have a requirement to get the *.doc or *.rtf file checked in DMS, convert it to pdf format and download it as *.pdf file. The document data is stored in DRAO-ORBLK (LRAW data type). Has anyone programmatically done this? What is the process to achieve this? I've read in the forum that you should first convert RTF(.doc) data to OTF format using CONVERT_RTF_TO_ITF and then you will get the script format from rtf data. Generate the spool using the script data. Convert the spool to PDF using CONVERT_OTFSPOOLJOB_2_PDF. However, the fm CONVERT_RTF_TO_ITF uses RAW data type. There's also fm CONVERT_OTF_2_PDF but I don't know how to implement this for my purpose.
Also, if Adobe Distiller is installed on the SAP application server, can it be used from an ABAP pgm?
Thanks in advance for your inputs.Hi Maria,
I realize this a rather old post, but was wondering if you managed to do this as I am having a similar requirement. Appreciate if you could share any solution or findings.
Thanks,
Lashan
Maybe you are looking for
-
"The operation could not be completed" error when starting VS 2013 (premium)
It was running fine and then msbuild wouldn't stop so I had to kill VS. After that I get the above error every time I try to start VS. Same result with the various console invocation devenv options (/safemode, /resetuser, ...) My path is < 2048 chars
-
Sent items are sometimes not saved
Hi, I have an intermittent problem in Mail 2.0.5, where some e-mails are not being saved in the sent items folder I have set up. I'm using IMAP, and have selected the option to store messages on the server, and have selected a folder to use for sent
-
Automatic Addition of Excise Duty Condition
I would like to know how we can make the excise duty condition automatic mean if we define excise duty condition 1% then it automatically calculate the duty and add it in PO. Regards
-
Hi everyone, I've been trying to switch usage between Forte for Java running on 2 platforms (Win NT and Solaris 8). For this reason, I want to try to use the GUI Editor in each. But when I tried copying the same .class file from one platform to anoth
-
Dng icons appear instead of thumbnails
Just recently, when I open up Bridge CS3, DNG icons appear instead of my thumbnails. I have not intentionally changed any settings, so don't know how to clean this up. Once I click on the icon, the photo opens up in Photoshop. Frustrating, since ever