XSTRING to PDF -  XSTRING of any file extension

Dear Experts,
I am using class: cl_hrrcf_attachments method: read_attachment to get the xstring of the file uploaded by the applicant in e-recruitment. The file can be in any format - doc, docx, pdf etc. I get the xstring of the file.
For filetype, pdf, I am using the function module SCMS_XSTRING_TO_BINARY and using GUI_DOWNLOAD to get the pdf file. I have to convert all files to PDF.
I am facing the problem doing the same for .docx. Can anyone suggest how do I change xstring to pdf. Irrespective of the filetype. I am using the below code.
  check lo_attach is bound.
  CALL METHOD lo_attach->read_attachment
    EXPORTING
      attachment_record  = ps_atta
    IMPORTING
      attachment_content = lv_content
      attachment_mime    = lv_content_type.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      BUFFER                = lv_content
    IMPORTING
      OUTPUT_LENGTH         = lv_output_length
    TABLES
      BINARY_TAB            = lt_binary_data
CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                        = 'C:\Test\Testing.pdf'
      FILETYPE                        = 'BIN'
    TABLES
      DATA_TAB                        = lt_binary_data
*     FIELDNAMES                      =
   EXCEPTIONS
     FILE_WRITE_ERROR                = 1
     NO_BATCH                        = 2
     GUI_REFUSE_FILETRANSFER         = 3
     INVALID_TYPE                    = 4
     NO_AUTHORITY                    = 5
     UNKNOWN_ERROR                   = 6
     HEADER_NOT_ALLOWED              = 7
     SEPARATOR_NOT_ALLOWED           = 8
     FILESIZE_NOT_ALLOWED            = 9
     HEADER_TOO_LONG                 = 10
     DP_ERROR_CREATE                 = 11
     DP_ERROR_SEND                   = 12
     DP_ERROR_WRITE                  = 13
     UNKNOWN_DP_ERROR                = 14
     ACCESS_DENIED                   = 15
     DP_OUT_OF_MEMORY                = 16
     DISK_FULL                       = 17
     DP_TIMEOUT                      = 18
     FILE_NOT_FOUND                  = 19
     DATAPROVIDER_EXCEPTION          = 20
     CONTROL_FLUSH_ERROR             = 21
     OTHERS                          = 22
Regards,
Abdullah

Hiii...
Check these links..
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
http://wiki.sdn.sap.com/wiki/display/ABAP/CL_ABAP_ZIPusage-ZippingABAPreportoutput
http://www.sapnet.ru/viewtopic.php?t=588
These links will be helpful..
Regards,
Jhings

Similar Messages

  • How to set default file extension in the FileChooser?

    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.
    Here's our piece of code, used for saving file.
    FileChooser fileChooser = new FileChooser();
            File file = fileChooser.showSaveDialog(stage);
            /*User might clicked on the cancel button*/
            if (file != null) {
                try {
                    Writer output = new BufferedWriter(new FileWriter(file));
                    output.write(text);
                    output.close();
                } catch (IOException ex) {
                    logger.error("save file error", ex);
            }Any help would be appreciated! Thanks!

    867511 wrote:
    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?Have you read the API? What's the nested class of FileChooser that's listed immediately after it in the classes list?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?I don't see any API for that. You could file a RFE on kenai.
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.I don't see any API for that either.
    db

  • Double-click any file on desktop, calling JAVA PROGRAM

    hi guys,
    i'm breakin my head on doin this prog....when we double click a file icon of any file extension, my another
    java program should be called.
    how to do this???
    pls send a sample code........asap!!!!!!!!!
    regards,
    Sam...

    If you are using windows you could probably make a file association (for all extension types) to a batch file that in turn fires off 'java YourClass params_here'
    - but if you (can) do this, won't you screw up your desktop - ie doubleclicking on an .xls or .doc will never fire up Excel or Word, unless you change the file extension associations back to what they were before? This would make your pc kind of strange to use...??!!
    hi guys,
    i'm breakin my head on doin this
    doin this prog....when we double click a file icon of
    any file extension, my another
    java program should be called.
    how to do this???
    pls send a sample code........asap!!!!!!!!!
    regards,
    Sam...

  • How to configure file upload restriction by file extension?

    Hi All,
    I want to know if its possible to restrict the file upload for any file extensions in CM Repositories. For example, I want that the users can not upload .avi files. Can I configure that restriction?
    Regards and Thanks,
    Arnau Rovira

    Hi,
    > How can I create a repository service?
    > It's like a web service?
    No. A repository service is a standard pluggable service within the KM framework. Search for "repository service" on SDN for further details.
    > can I copy the upload command
    > from the actual repository service
    The upload command is the upload command is the upload command. It is not bound to any repository service.
    Yes, you can try to extract all implementation classes for the actual upload command and create a new one under a new namespace and modify the interesting parts after decompilation. But be warned: Your questions signal that you are a beginner in the KM framework, and the things described so far are more in the direction "hardcore development"...
    Hope it helps nevertheless
    Detlev

  • Screenshot File Extensions Showing on Tiger Intel

    I've just switched to an iMac Intel 2.8 after years using Tiger on iMac PPCs. Encountering a minor annoyance that I would like to resolve. In the past (i.e. PPC days) screenshots were always saved by name without any file extension showing. On the new Intel machine, despite having "Show file extensions" unchecked in the Finder Preferences, every screenshot has the .png file extension showing. I'm guessing I have missed something obvious to turn this off but cannot find any advice despite searching here and via Google. Would appreciate someone pointing me in the right direction.

    Try this: Click in the desktop and select Finder>Preferences>Advanced tab - deselect 'Show all filename extensions'.

  • CS5 requires file extensions to open files?

    I receieved some image files (jpegs) from a client. For whatever reason, they did not have any file extensions on the file name (no .jpg or .jpeg) They opened perfectly fine in Preview, but Photoshop just said:
    Could not complete your request because Photoshop does not recognize this type of file
    The funny thing is that, in the "Open..." dialog, Pshop displayed the preview image for the file.
    Once I added a .jpg to the filename, Photoshop opened it without a problem. I don't remember Pshop being so dependent on file extensions in the past. It's been a long time since I had to deal with extensionless files, though. Is this normal behavior?

    If the file type and extension don't match, there could be problems.  Photoshop goes with the file type first (as specified by MacOS guidelines).
    If the file has no type, and no extension - then Photoshop has nothing to go on.  Preview does a "best guess".
    (yes, Photoshop needs better guessing code, but it's not as easy as it sounds)

  • Convert pdf xstring to pdf file format

    Hi, All,
    Could anybody know how to convert xstring(hexadecimal format like 255044462D) to pdf file format? I have to output pdf xstring which generated in SAP to XI, then output PDF file. Thanks a lot!
    Marea

    From what I've understood from Michal's blog code, it will depend on the format that you choose for the file to have.
    In his case, he used
    type = if_ai_attachment=>C_MIMETYPE_JPEG
    In your case, you could use the equivalent type for PDF files.
    If you search for the IF_AI_ATTACHMENT interface in SE80 (ABAP Workbench), under Attributes folder you'll be able to see the constants which are defined in the interface. And there you have C_MIMETYPE_PDF (associated to the content-type 'application/pdf').
    I don't know whether it is possible to do the type association using the RFC payload (probably not). The ABAP Proxy attachment seems to be the best approach.
    Regards,
    Henrique.

  • Converting XSTRING into PDF

    I have a function module called ZL_CONVERT_OTF (its a custom built one) It has an output importing parameter of type XSTRING, in which the data, comes up from the smartform that's in question, into a variable of type xstring.
    Any idea on how to print this XSTRING into a pdf document?

    Hi,
          DATA: BEGIN OF xstring occurs 0,
                   xs TYPE Xstring,
                END OF xstring.
    DATA: length TYPE I.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = path
          FILETYPE                         = 'BIN'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = xstring
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                         = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                     = 4
         NO_AUTHORITY                     = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                        = 17
         DP_TIMEOUT                       = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                           = 22.
    Regards
    vijay

  • How to convert Xstring to PDF format and send pdf to multiple user

    Hi to all
    can any one provide me saple code to convert Xstring to PDF format and send pdf to multiple user
    i have searched the SDN , but cant get any proper soulution.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Use function module 'SCMS_XSTRING_TO_BINARY' to convert from XString to a Binary table. Just like this:
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer          = lv_xstring_pdf
          append_to_table = ' '
        TABLES
          binary_tab      = lt_doc_content.
    To send the email in an OO way you should user class CA_SEND_REQUEST_BCS. Take a look to program BCS_EXAMPLE_6 or any of the test programs in package SBCOMS.

  • Pdf file extension missing on export

    That's it really - the pdf file extension is always missing when I export from Pages 09 to PDF. This causes Windows users problems especially when attached to emails. Any way to force Pages to add the extension?

    I repeat:
    I uses MacOS X since 10.3.
    I use iWork since the delivery of iWork '08 then iWork '09.
    I never got a document created by a 'modern' application without the extension name appended.
    So I continue to think that if an extension is missing it's because the user made something wrong.
    Maybe installing a third party component fooling the OS.
    They are a lot of such "enhancers" which introduce oddities in the system behavior but I can't guess what is installed on your machine.
    Just an example.
    I tested on three macIntel machines running 10.5.6 or 10.5.7.
    The menu items Format > Font Bold and Italic are always disabled when TextEdit is using "Plain Text" format.
    On the machine of a correspondant, the items are enabled in such setting.
    I'm quite sure that there is a beast changing the application's behavior but I can't guess which it is.
    Back to the Finder setting.
    It's not designed to Hide all extensions names.
    It it designed to Show all of them or don't show all (which means that some may continue to be displayed).
    As far as I know, the behavior is this one:
    if a document is save when the Finder is set to "Always display the extensions", unchecking the box will not hide the extension.
    if a document is saved when the Finder is NOT set to "Always display the extensions", checking the box will display the extension, unchecking it will hide the extension.
    If you use the Finder with the box checked, the extensions of the files created on your machine will always be displayed.
    Yvan KOENIG (from FRANCE lundi 1 juin 2009 13:03:18)

  • Printing to PDF adds extra characters in file extension (eg. .pdfg)

    Hi.
    I have no idea if this is the right forum for my question, but since pdf creation is -- in a way -- printing, I thought I'd start here.
    When I create PDFs on my MBP (10.5.4) and send the document to my Windows-using colleagues, they cannot open the files since an extra character has been added to the file extension. This is incredibly frustrating, since I haven't managed to track down the problem.
    Is this a problem with the system's in-built PDF-creation tools? Or is it Apple Mail that nefariously adds the unwanted character to the end of attached PDFs? Or might there be some other problem, somewhere?
    On my mac, the PDFs look kosher, and my mac-using colleagues can open the files I send to them.
    I would be very happy for anyone spreading some light on this subject.
    Cheers,
    Andreas

    Yes, it is a problem with Mail when either the message subject or the pdf document (or any other document type) contain accented characters, I believe.
    Until Apple fixes this (which worked in previous Leopard versions), I do not use accented characters when I want to send an attached document via Mail.
    HTH ;-))

  • If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and gi

    If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and give the extension name is plz tell me the way that office files are compatible with it.
    == This happened ==
    Every time Firefox opened
    == when i download the office files

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • Firefox can't read any Bookmark that was imported from my PC with file extension .url. Safari reads them fine. Is there a fix, so I can use Firefox instead of Safari? Many thanks if so. I have the latest version of Firefox

    Firefox can't read any Bookmark on my Mac that was imported from my PC with file extension .url. Safari reads them all fine. Is there a fix, so I can use Firefox instead of Safari? Many thanks if so. I have the latest version of Firefox
    == URL of affected sites ==
    http://anysite.url
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    Hello JF.
    I don't think that extension is supported. I believe Firefox can only read .json and .html.
    You may want to read this though:
    [http://support.mozilla.com/en-US/kb/Importing+bookmarks+and other data from Safari Importing bookmarks and other data from Safari]

  • How to set default .PDF file extension for Form Downloads

    I am trying to find a way of setting the PDF file extension when I download forms.
    I author the forms under a Plus subscription and am then downloading the forms under a basic subscription Collaborator account (diffrent person)
    If I don't include .pdf as the file type when downloading a form with a unique name as the Collaborator, it downloads without a file extension.
    Remembering to continually add the pdf file extension is a pain so I'm hoping there is away of setting this as a defaulet for my 'collaborator' account ?

    Firstly, apologies for multiple posts, I received messages saying my comment hadn't posted and also checked my history before re-submitting.
    Okay, the process is
    1. Log in as the Author account and I can rename the file without having to set the extension
    2. Log in as the Collaboartor account - same PC, browser etc and it doesn't save with a default file extension; HOWEVER, I have done this whilst also being logged in on a diffrent browser as the Author
    3 I have just tried logging out as Author and only being in as the collaborator and the form downloaded with a default PDF.
    4. I had someone else log in as the collaborator from thei PC and browser whilst I was still signed inunder my author account and again they were unable to save as PDF by default
    This has me wondering if there is anything at play when you've got multiple Users?

  • Clicking on PDF files on the internet does not download with file extension

    When I click on a PDF link it downloads the file but does not save it as a ".pdf" file extension. When using the "save as" function in mozilla the ".pdf" file extension is included.

    Current Firefox versions have enabled a built-in PDF Viewer that doesn't have all features that other PDF readers like the Adobe Reader have or may not function properly otherwise.
    You can change the action for Portable Document Format (PDF) from Preview in Firefox to use another application like the Adobe Reader or set to Always Ask in "Firefox > Options/Preferences > Applications".
    You can set the pdfjs.disabled pref to true on the <b>about:config</b> page to disable the build-in PDF viewer.
    You can check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu.
    See also:
    *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them

Maybe you are looking for

  • How to hide data of any column in ALV Display

    Hi , I  am displaying  an  ALV in which i have to display subtotal  of each column but want to hide the data of  that column(only data is to hide ) column should be visiable,. Please let me know i any one have worked with this situation. Thanks in ad

  • DVD Player 5.4 not working on OS 10.6.5 ??

    Hey guys, dvd player 5.4 is not working on snow leopard 10.6.5 Apple should fix it.

  • Properties: how do I read the comments in it?

    I'm using a Properties object to read key-value pairs. But I found I also need to read the comments in the properties file. How can I do that? :)

  • Exporting: wrong color

    Hey every time I export my videos the color is a little brighter and off just a tiny bit than the color in the canvas. I don't know how to fix it! It's really frustrating when you spend hours getting the perfect colouring and it doesn't look the same

  • Ready to step up to HD, advice please...

    Ok, i'm ready to venture out and get a new SONY Z-5 camera, but i'm worried about my processing power to be able to edit HD in real time. I currently have the Non-Intel Dual Power G5 w/ 4G DDR RAM My Mac already seems to be stumbling over very large