To upload a RTF and a PDF file to SAP R/3 and print the same through SAP

Hi,
I have a requirement to upload a PDF file and a RTF file to SAP R/3 and print the same.
I wrote the following code for uploading a RTF file to SAP R/3 and print the same. However, the problem is , the formatting present in the RTF document( bold/italics..etc) is not being reflected when I do the 'print-preview' after the executing the code below :
report z_test_upload .
data: begin of itab occurs 0,
         rec type string,
      end of itab.
data: options like itcpo.
data: filename type string,
      count type i.
data: filetype(10) type c value 'ASC'.
DATA: HEADER  LIKE THEAD    OCCURS   0 WITH HEADER LINE.
DATA: NEWHEADER  LIKE THEAD    OCCURS   0 WITH HEADER LINE.
DATA: ITFLINE LIKE TLINE    OCCURS   0 WITH HEADER LINE.
DATA: RTFLINE LIKE HELP_STFA OCCURS   0 WITH HEADER LINE.
DATA:   string_len TYPE i,
        n1 TYPE i.
selection-screen begin of block b1.
  parameter: p_file1(128) default 'C:\test_itf.rtf'.
selection-screen end of block b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
  CALL FUNCTION 'F4_FILENAME'
       IMPORTING
            file_name = p_file1.
start-of-selection.
move p_file1 to filename.
call function 'GUI_UPLOAD'
     EXPORTING
          filename                = filename
          filetype                = filetype
     TABLES
          data_tab                = itab
     EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
if sy-subrc <> 0.
  message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at itab.
  string_len = strlen( itab-rec ).
  n1 = string_len DIV 134.
  ADD 1 TO n1.
  DO n1 TIMES.
    rtfline-line = itab-rec.
    APPEND rtfline.
    SHIFT itab-rec BY 134 PLACES.
  ENDDO.
endloop.
HEADER-TDSTYLE = 'S_DOCUS1'.
HEADER-TDFORM = 'S_DOCU_SHOW'.
header-tdspras = 'E'.
CALL FUNCTION 'CONVERT_TEXT'
  EXPORTING
  CODEPAGE               = '0000'
    DIRECTION              = 'IMPORT'
    FORMAT_TYPE            = 'RTF'
   FORMATWIDTH            = 72
    HEADER                 = header
    SSHEET                 = 'WINHELP.DOT'
    WITH_TAB               = 'X'
    WORD_LANGU             = SY-LANGU
    TABLETYPE              = 'ASC'
  TAB_SUBSTITUTE         = 'X09  '
  LF_SUBSTITUTE          = ' '
  REPLACE_SYMBOLS        = 'X'
  REPLACE_SAPCHARS       = 'X'
  MASK_BRACKETS          = 'X'
  IMPORTING
    NEWHEADER              = NEWHEADER
  WITH_TAB_E             =
  FORMATWIDTH_E          =
  TABLES
    FOREIGN                = RTFLINE
    ITF_LINES              = ITFLINE.
  LINKS_TO_CONVERT       =
if sy-subrc <> 0.
endif.
CALL FUNCTION 'PRINT_TEXT_ITF'
  EXPORTING
     HEADER        = newheader
     OPTIONS       = options
IMPORTING
  RESULT        =
  TABLES
    LINES         = itfline.
if sy-subrc <> 0.
endif.
Any hints or suggestions to solve this problem will be highly appreciated.
Thanks,
Avra

Hi Vishwas,
Check out the thread [Efficient way of saving documents uploaded|Re: Efficient way of saving documents uploaded by users; and check the blog by Raja Thangamani.
Also check the thread [Export Images through Function Modules   |Export Images through Function Modules;.
Hope it helps you.

Similar Messages

  • I have a pdf file filled out but when i print, the doc comes out blank

    I have a pdf file filled out but when I print, the document comes out blank

    Is the base form printed?
    If so, in the Print Dialog, verify that in the Comments and Forms field > Document and Markups is selected

  • When trying to upload a report as a PDF file to my clubs website, I get the message 'should be a PDF file', while it is a PDF file. What is wrong?

    Writings, produced by me and some collegues are to be uploaded to some site. This writings are PDF files. When trying to upload an error message apperars, telling this file is NOT an PDF file. In Google Chrome and Opera there is no problem.

    Hi H.Barker,
    Zou is correct, LabVIEW supports all GIF bit depth images 24bit and below.
    Thank you for forwarding the GIF images, I also experienced the same error when trying to import the "logo.gif" image in LabVIEW however I was able to import the image when I opened it in Microsoft Paint and resaved it as a new GIF.
    This suggests there is a corruption in the original GIF file generated on the web, for example a "terminiating block" may be missing at the end of the GIF file. LabVIEW is not forgiving of GIF images that do not meet the GIF specification whereas other Windows editors may be, it seems that opening and resaving the GIF file in Microsoft Paint added the missing characters thus allowing for the file to be imported into LabVIEW.
    I have attached the working GIF image to this post.
    Hopefully this assists with your application H.Barker.
    Many Thanks
    Jamie S.
    Applications Engineer
    National Instruments
    Attachments:
    LOGO GIF (2).gif ‏34 KB

  • How can I store and share PDF files via iCloud?

    I am trying to use iCloud to store and share PDF files from my PC, iPad2 and iPhone 4S... They are supposedly supported. I can share .docs, .xls, etc.... However, I cannot figure out how to share a pdf!

    Welcome to the Apple Community.
    You can download an iWork document from iCloud as a PDF, but you can't share a PDF document with iWork apps on iOS devices.

  • Differences Between SAP PDF and Normal PDF Files ???

    Hi,
    In SAP, we are converting Delivery Outputs to PDF and getting with another win32 application using RFC.
    However, PDF's taken from SAP don't work like other PDF's which Created with Adobe PDF Creator.
    For Example,
    I have a delphi application which converts PDF files to image files (JPEG,TIF). Normal PDF files converting normally but SAP PDF Files can't convert.
    What's the differences between "SAP" PDF Files and "Adobe PDF Creator" PDF Files.
    thanks
    ibrahim

    I believe that the converter internal to the system is based on a specific release of the adobe software, whatever was current at the time of release.  In newer releases, the converter is probably upgraded to the newest release of adobe.
    Regards,
    Rich Heilman

  • I download firefox 5.0 and now I'm having trouble dragging and dropping PDF files into Google Docs and I can't view the PDF once uploaded. I had no problems with this in the previous verion of Firefox

    With firefox 5.0 I can't drag and drop pdf files in the google docs screen. When I do eventually get a pdf file uploaded I can't view it. I get "no preview available". In my previous verion of firefox (4.something) I had no problems with this and I was able to drag and drop and after uploaded I could view the entire file.

    Thanks one again. I know you helped me the last to. I do have the Deja Vu font set in my folder. I downloaded and the last time. So I don't know if there is supposed to be more or not, but those were installed with Windows-XP after my reformat.
    This is really driving me nuts. as I've done several re-formats on my computer and several friends computers and even upgraded hardware so I am not necessarily a software or programming expert, I am somewhat advanced when it comes to computers in general and can usually diagnose the problem but these font's are the problem and they never were before.
    I did see in another forum that if you had a Dell Computer and did the Microsoft update for the onboard video card driver that it could be the culprit, but I have that disabled being I have a much better graphics card so the updates from Microsoft for the onboard video weren't installed.
    It' a Dell Dimension 3000 with an Intel(R) 82865G Graphics Controller so I don't believe it is the culprit being it is disabled. The actual video card that I am using is a PCI Nvidia GeForce 9400 GT with 1 GB Memory. And I didn't have any problem before.
    I appreciate the help. But still can't get things to work. Live Help Chat doesn't open for another two hours so maybe they can do "Remote Access" or something and can check setting and help me. But if you come up with other suggestions, they would be greatly appreciated.
    Thanks again.
    Susan

  • Uploading an Adobe 9.1 pdf file

    I am trying to upload a file created from a Word document to a pdf file using Adobe Reader 9.1. The document is approx. 10 meg in size. When I initiate the upload everything appears to be going fine for about 2 mins. and the status bar appears to be at 100%:  then my program (Website Baker) reverts back to its previous state. I get no error message nor do I get any indication the file was uploaded. I have uploaded smaller pdf files.
    I am using a Mac Powerbook (OS 10.4.11)

    The PDF file in and of itself shouldn't be a problem (I assume website baker is either a content manager app of FTP client). It's simply a file like any other you may upload.
    You may try the website baker folks to see if there is a limitation for file size or something else going on. At any rate, there won't be a fix that requires doing anything with Adobe Reader.

  • Downloading and storing pdf file in a Local holder

    I generated a pdf file with desk top PC and uploaded it to Adobe Acrobat DC through the Acrobat.com. I can preview it in a Document Cloud by opening the Adobe Acrobat installed in the iPad.
    Question: How can I download the file and store it in a Local holder of the iPad?

    Hi Kishida-san,
    Unfortunately, there's is no such option but once you download the file from cloud, a copy of it is saved on the device which you can access without internet connectivity.
    Moreover, You can't copy the file from cloud to a specific folder on device however you can copy a file from local storage on device to the cloud.
    Also, This Link seems relevant to your query: https://forums.adobe.com/docs/DOC-5782
    Hope that helps
    Regards,
    Rahul

  • You click on a .pdf file; Firefox won't load and says "not a pdf or corrupted," but all other browsers open it normally

    Clicking on a link to a .pdf file in Firefox results in Firefox displaying the box "Format error: not a .pdf or corrupted"
    This has happened for several years with any number of web pages. A link to the latest event is below, but it typically happens almost every time I click on a link to a .pdf

    Upgrade your browser to Firefox 9 and check
    * getfirefox.com

  • When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....

    When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....
    Could some one give help and let me know where I can probably find the settings option that allows me to change and switch to previous situation where it was possible to decide time to time how to proceed either opening the file or saving it ??
    Thanks in advance
    David

    What is your operating system?
    Open a PDF from where?  If online, in what browser?

  • Function module to fetch pdf file from App. Server and print/email?

    Hi all,
    Is there any function module to fetch a PDF file from APPLICATION SERVER and print the PDF file or send it as an attachment in an email?
    Please help..
    Thanks in advance.
    Sandeep.

    Hi Sandeep,
    Is there any function module to fetch a PDF file from APPLICATION SERVER
    1) As far as i know there are no FMs to read a file from App server, you can do the same using *OPEN/READ/CLOSE dataset ABAP statements - There are tons of examples for this on the net.
    and print the PDF file or send it as an attachment in an email?
    You can send the file read from the app server(by the suggested method above) and use CL_BCS to send it as an attachment.
    Again there are many examples on the net on how to use CL_BCS for the same.
    Regards,
    Chen

  • I am getting messages that I can't download and read .pdf files since I have the wrong Adobe reader. I know about their security disasters of course, but I downloaded the latest version of Adobe Reader from the Adobe web site and I have other ,pdf file re

    I am getting messages that I can't download and read .pdf files since I have the wrong Adobe reader. I know about their security disasters of course, but I downloaded the latest version of Adobe Reader from the Adobe web site and I have other ,pdf file readers as well, and for some reason they won't work either. I have 5 computers running top end processors and RAM. By this I mean I have one, this one which I am using that has an AMD Phenom Black 3.2 Quad-core with 8 GBs of Corsair top DDR2 RAM, my other two AMD have either an Athlon II triple core with 4 GBs of DDR2 Corsair RAM, one with the Phenom X4 965 3.4 GHz Quad-core with 8 GBs of their best DDR2 RAM, and two Intels with the i7 920 Processors using the triple channel 1366 socket processors and one with 8 GBs of low latency DDR3 RAM and the other with 4 GBs of the same RAM. I am getting the message on this one, which has a fresh install of XP Pro X64 operating system, as do the other 4 as well. I have run Avast Business Pro Anti-virus on this one, which I am getting the message on with a single result which I deleted, and also both Spybot Search and Destroy, which came back clean as well as Malwarebytes Antimalware, which got a lot of tracing cookies now removed, and SuperAntiSpware which also found a few cookies also now deleted. Can you tell me what I need to do to get these files to show as .pdf files rather than as a clean blank page. One other issue is that I wish to know how to turn off my downloads so they are saved and Mozilla will give me the option of returning them instead of me losing them all together as it does now. Thanks for your assistance. If there is another Adobe reader I should download and install, could you provide me with the link to it? I appreciate your assistance here
    == When I download and try to read a .pdf file and when I am asked to turn off all Firefox files and if I do, I lose them since I need to know how to save them without rebooting my computer.

    Brilliant! Problem solved! Thanks so much.

  • I am programming a DVD-Rom in DVD Studio Pro 4 and need to display and open pdf files, any suggestions?

    I am programming a DVD-Rom in DVD Studio Pro 4 and need to display and open pdf files, any suggestions?

    http://documentation.apple.com/en/dvdstudiopro/usermanual/index.html#chapter=22% 26section=9%26tasks=true

  • How to embed and open PDF files within excel

    I constantly need to embed PDF files onto Excel documents as well as extract/open/view PDF files from Excel documents. I am unable to do so with a macbook, i know that there is a workaround but it's such a tedious process. Is there a software i can buy or setting that i can do so that i can embed and open PDF files easily as i need to view these files multiple times a day for work.
    please advise

    Download and install Adobe Reader: Adobe Reader Install for all versions
    Open the PDF file using it. If security restrictions don't prevent it you could also print it.

  • I am new to the Apple world and yesterday i bought an APPLE IPAD (4th Gen) .. My Question is "Can we connect a flash drive to the IPAD4 and transfer pdf files to and fro"??

    Hi all,
    I am a newbie to the Apple World and Yesterday I bought an APPLE IPAD (4th Generation).. My primary purpose is to read pdf files on IPAD4.
    I have 3 questions ..
    1. Can we connect a usb flash drive to the ipad4 and read pdf files from it?
    2.  I am using windows since 2000 and accustomed to the file explorer and file management in it. Can I get such kind of environment in IPAD4 ?
    3. Do I have to sync the IPAD too often?
    Regards,
    Manikanth

    Sandisk has recently come out with a device
    http://www.sandisk.com/products/wireless/flash-drive/
    Never used it so I can't comment on whether or not it works well. There are very few devices out there that allow file transfer without going through iTunes or via the internet. IMHO, one real weakness of the iPad, great for consuming data, however not very fully featured when it comes to moving data around, especially if that data doesn't come from iTunes or other online source.
    there is also a device called a WiDrive
    http://www.kingston.com/us/usb/wireless
    that is also a wireless drive for iPads.

Maybe you are looking for