ABAP Class to download a JPEG file

Hi experts,
I'm trying to use class cl_gui_frontend_services (method gui_download) to download a file in the pc.
The problem is that i have a XTRING field (binary string with thousands of characters) and this method, with filetype 'BIN', only accepts X fields (65000 characters aprox).
Is there any other class i can use?
Best regards.
Valter Oliveira.

I filled the data table, spliting the XTRING into n X variables, USING THIS DO STATEMENT:
TYPES: BEGIN OF ty_file,
         line(65000) TYPE x,
       END OF ty_file.
DATA: out TYPE xstring,
      wa TYPE ty_file,
      lenght TYPE i,
      data_tab TYPE STANDARD TABLE OF ty_file WITH DEFAULT KEY INITIAL SIZE 0.
DO.
  lenght = STRLEN( out ).
  IF lenght GT 65000.
    wa-line = out(65000).
    out = out+65000.
    APPEND wa TO data_tab.
  ELSE.
    wa-line = out(lenght).
    APPEND wa TO data_tab.
    EXIT.
  ENDIF.
ENDDO.
... CALL METHOD cl_gui_frontend_services=>gui_download
Best regards.
Valter Oliveira.

Similar Messages

  • HT4101 downloading only JPEG files using SD card reader

    I am new to Apple-iPad world,, mostly working on WinXP.
    I am looking to buy a tablet to view photos while I'm on vacation and traveling. I shoot both RAW and JPEG files of each image. When I connect my SD card to an iPad Mini, I'd like to be able to download only the JPEG files, since the RAW files are too large and would quickly fill up my device.
    I've been told that when you plug in the Apple SD card reader, it treats the RAW and JPEG files of an image as one, so when you download you have no choice to just select the JPEGs. Seems like a huge oversight on Apple's part, to offer camera and card connection, but then be so controlling about it, that it doesn't work for people. None of the 3-4 Apple sales reps I've spoken to know of a way around this.
    At this point, I'm lookng at an Android tablet instead, since it doesn't have this limiting feature--though I much prefer the look and size of the iPad Mini screen.  .
    Has anyone else run into this issue? Any thoughts on a work-around?
    (Two solutions that I've thought of--though I don't know if they will work--are: 1) download all of the images, then bring them up in a program like Snapseed, where I can save (really a 'save as') a new JPEG version of my image, then delete the original files that I downloaded, or 2) see if I can download a file manager app that would let me view the different files by size and by type (to identify the RAW files), then delete just these from me iPad)  
    Best, David.

    Thanks Tom, at last an answer!
    So it seems I would need to first download the image files to my tablet--including RAW files--(or whatever the constraits are in working with the Apple SD card reader), and then after the fact, use PMP to delete just the RAW files.
    I assume then that PMP can view the 'standard' photo folders (called 'Albums on my iPod) created by the Apple photo app (or by the iOS, I'm not sure), is that correct?
    This might be an acceptable work-around for me.
    Best, David.  

  • Firefox downloads pictures as plain text files, i need to download a jpeg file in windows xp

    if i download the jpeg image from google images in firefox, save as type in text document only appear. not jpeg or other format not appear. i want to save as type in jpeg format only. pls help us.

    Right click on the image and choose "save image as"
    If your in image.Google.com then it save as .html file only
    open the image file in new tab and save it.

  • Use of Cl_ABAP_ZIP Class to download multiple pdf file as a zip folder.

    Hi All,
    My requirement is like based on the user input multiple number of Invoices will be created as a pdf file and then a zip folder  will be downloaded which contain all those pdf files. I have developed a code for this requirement. When I am trying to unpack the zip folder I'm getting error that the folder is corrupted.
    If anybody have gone  through such a requirement, then kindly put some light.
    Thanks in advance.
    Regards,
    Sarbajit.

    Hi Sarbajit,
    please have a look at the below thread and check whether it will help.  it has part of code for unzipping the file.
    [http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c6b79908-0a01-0010-8ca0-b77aff37726d]

  • How to download a jpeg file from a webpage, daily, automatically

    Hello,
    do you know any app or Automator script that allows me to download an image from a webpage, everyday at the same hour, and without doing any action?
    I need that the Mac will do it automatically.
    Thanks.

    Well, first it would depend on DRM protection (copyrights of the author) whether you can legally download it at all.
    Aside from that, you would also have to automate your Mac to be on that very specific website, connected to the internet, with the mouse choosing which specific image you want to download (as websites can contain many images).

  • "JPEG File" instead of "PictureViewer document"

    I use Internet Explorer; and QuickTime 6. Usually when I download a Jpeg file from the Internet, it gets downloaded as a "PictureViewer document."
    Lately, the Jpeg files get downloaded as "JPEG File," and it opens by way of my browser, Internet Explorer. What should I do to download the Jpeg files mentioned above, as
    a "PictureViewer document," instead of a "JPEG File?"

    How 2000. OS 9 and Internet Explorer.
    If you Control-click on your downloaded .jpg files you can choose the "open with" application. You don't need to use your browser to open them.
    When you move up to OS X you'll find that the "Picture Viewer" app (part of your QuickTime install) has grown up to become "Preview".

  • Download ABAP Class in 46C?

    Hi,
    Anyone know a tool for downloading ABAP class method codes/ attribute definitions to a local PC file for release 46C?
    I know Direct Download, but for 46C version it's not possible to download Classes:-(
    I know that via menu Goto-> Protected/Private/Public section I can dowload the generated class, but it's not really easy for several class.
    Thanks in advance,
    Peter

    Hi,
    Got from a link
    Downloading ABAP code to your local PC
    Creating Z* test programs is a popular method for conducting tests. However, when an environment is about to get shut down, keeping your test programs becomes tricky. You have to launch se38/37/24/80, select your programs one by one, and choose system -> list -> save -> local file, or use function module WS_DOWNLOAD. This is a lengthy procedure that does not even enable you to save screens, tables, or structures.
    An ABAP program available for free download at http://www.dalestech.com/ can help you save your test programs.
    Choose home -> R/3 entreprise -> direct download entreprise 1.2
    download the .ZIP file,
    Unzip
    Cut and paste in an ABAP program
    Compile and run
    All your projects (including multiple classes, programs, function groups, screens and tables) can be saved in less than one minute.
    If you want to backup your work in order to keep a certain stable version while you are programming, it might be preferable use a tool that is already embedded in the Workbench: in se38/37/24/80, choose utilities -> versions -> generate version
    Thanks & Regards,
    Judith.

  • Warning while downloading an Excel file from WD ABAP

    Hi folks,
    In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner.
    We achieved this with Simple Transformations.
    Now the question is while downloading the excel file, the framework/other  is throwing an Warning like
    " The file you are trying to open, 'info.xls', is in a different format than specified by the extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? "
    Note: All the users of my client are using MS Office 2002 / 2003.
    I am using the following code........!
    *------ Call Transformation for Excel OUTPUT
      CALL TRANSFORMATION ZEXCEL_OUTPUT
          SOURCE
                 t_dates     = t_dates
                 t_info        = t_info
          RESULT XML l_xml_string.
    REPLACE ALL OCCURRENCES OF '<?xml version="1.0" encoding="utf-16"?>'  l_xml_string WITH '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>'.
    **-- Call Function Module for converting string data to XSTRING
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          text           = l_xml_string
          mimetype = 'application/xml'
        IMPORTING
          buffer      = l_xml_xstring
        EXCEPTIONS
          failed   = 1
          OTHERS   = 2.
      CALL METHOD cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename       = 'info.xml'
          i_content        = l_xml_xstring
          i_mime_type   = 'application/vnd.ms-excel'.
    With this code I am generating a file of type XML SPREADSHEET 2003. While opening this file I am getting the above message which the user unwanted......
    Can any one help me on this -
    > How to avoid this warning?
    Thanks and Regards,
    Aneel Danda
    Edited by: danda aneel on Jul 13, 2010 1:43 PM

    Firstly, Thanks for Your quick Response, Thomas.
    Even though what ever may be the file name I am passing either info.xml or Info.xls , In error info.xls is coming.
    Kindly provide me an alternative on this  XML doesn't seem like it would match the 'application/vnd.ms-excel'.
    what is the supported format.?
    Similarly, It is not considering the UTF-8 / UTF-16 for xml.........same result is appearing in the output.
    Edited by: danda aneel on Jul 14, 2010 7:52 AM

  • How to download a text file using classes

    Hi Guys
    I want to download a text file using classes.
    Any idea how to do it ?
    Thanks
    Sameer

    HI sameer,
       It is no different from using a Function module.
    example:
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                  = w_fpath
        append                    = SPACE
          write_field_separator     = 'X'
        CHANGING
          data_tab                  = it_download
        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
          not_supported_by_gui      = 22
          error_no_gui              = 23
          OTHERS                    = 24
    Regards,
    ravi

  • File to Proxy Scenario using ABAP Class and DB Multi Connect

    Hello Friends,
    I have a scenario below and a proposed solution. I would like some input as to whether i am headed the right way.
    Scenario: Thousands of records come in from the legacy accounting system. The fields of these records need to be mapped to SAP fields using cross-reference tables stored in DB2. Finally, summarize the records by deleting a few fields and feed to R/3.
    Solution i proposed:
    (1) File Adapter is used to send the file
    (2) Although JDBC adapter comes first to mind but since i need to access the DB2 tables multiple times for each record i propose to use an ABAP class for the mapping. Within the ABAP class the intent is to open an database connection to DB2, read the relevant cross tables using native SQL and finally generate the output XML.
    (3) Reciever is Proxy which feeds this generated XML to SAP for creating posting via BAPI_ACC_DOCUMENT_POST
    Question: Is the above solution correct or is there a better method to implement this scenario?
    Please let me know.
    Thanks,
    Minhaj.

    Looks fine. Few observations -
    1. Whether it is ABAP class or Mapping in RFC lookup, you are making multiple trips to the database.
    2. It looks like PI is being used only for reading the file and converting it to XML.
    3. If using PI is not mandatory, then a complete ABAP class on ECC it self would be faster than swtching between PI Java, PI ABAP then round trips to DB2 finally data push to ECC.
    If you could look at something like fetching all the required RFC look up data in one go and then map the fields according, might save u on processor and network resources.
    VJ

  • ABAP CLASSES - XI don't create the Target File..

    Hallo,
    I have a problema in XI when I use an ABAP Class.
    This is My FLOW:
    1) R/3 SEND an IDOC DEBMAS to XI un idoc DEBMAS(Customer data)
    2) XI have this Interface Mapping: Interface_Mapping_Anagrafica_Cliente.
    It si composed on:
    - Input: IDOC (DEBMAS)
    - 1° Mapping      ==> named: Message_Mapping_Anagrafica_Cliente
       This mapping, from IDOC DEBMAS, create the message type Message_Type_Anagrafica_Cliente.
    - 2° Mapping      ==> Classe ABAP
       This mapping, from Message_Type_Anagrafica_Cliente create the message type Message_Type_Click.
    - Output: Message_Type_Click
    3) I want that this Message_Type_Click will be in the file.
    But, if I execute the transaction SXMB_MONI in XI, I can see the IDOC OK .. but if I make double click on it, I don't see the Payload for the target file. Infact the target file is not be created by XI...
    I have made debug after my class and I found a Problem in the Trace with type E with message: CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV.
    What is this?
    Can you help me?
    Thanks.
    Monia

    Hi Monia,
    first put your trace to 3: SXMB_ADM, Integration Engine Configuaration, Specific Configuration, Runtime/Trace Level
    Second delete your abap mapping from your interface mapping and look in the monitoring for the output. Is it what you expect? Is it the datatype the abap mapping can work with?
    Copy the result as source for the next test. Now you put the ABAP mapping inside and delete the message mapping from your interface mapping. Test with transaction SXI_MAPPING_TEST. Look to the weblog <a href="/people/sameer.shadab/blog/2005/09/29/testing-abap-mapping ABAP Mapping</a> how to test an ABAP mapping.
    The problem with more than one mapping program in one interface mapping is that you see only the result of both!
    Regards,
    Udo

  • XML to flat File:ABAP Class

    Hi ,
    Please can someone answer my question asap.
    I have to write an ABAP Class which receives an XML Document which has multiple IDOCS.The IDOC has several Segments which can repeat and also the segments have Sub-Segments.
    Please can someone provide me a sample code which can convert the fields of each segment to a line of the output flat file.
    I need a flat file where fields under each segment should come in one line.I mean the control record should come in one line.The fields of 1st segment ex:E1EDK01 should come in 2nd line.....
    Please revert.
    Thanks in Advance,
    Harish.

    You will need to use ABAP ixml technology to parse the content from the xml file:
    You can reference following ABAP mapping.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/15ecdf90-0201-0010-d792-941a3c3c30a4
    or SAP help doc:
    http://help.sap.com/erp2005_ehp_04/helpdata/DE/86/8280d212d511d5991b00508b6b8b11/frameset.htm
    Regards.
    Liang

  • Iphoto 11 is not recognizing jpeg files downloaded from camera and card reader. Nor will it allow me to transfer from image capture

    iphoto 11 is not recognizing jpeg files from either the camera and card reader. Canon Eos rebel dig. Nor will it allow me to transfer images from image capture to iphoto. No problem downloading to image capture.

    Sounds like a damaged card.  Get your photos off the card with Image Capture and then reformat the card in the camera.  Take some pictures and see if the card is recognized by iPhoto and the card reader.
    OT

  • TS1315 when trying to download photos  from my digital cameras I keep getting the message that pics can't be downloaded because of an unrecognizable format. It shows that they are all jpeg files. One camera is a Canon, the other a Panasonic.

    when trying to download photos  from my digital cameras I keep getting the message that pics can't be downloaded because of an "unrecognizable format". It shows that they are all jpeg files. One camera is a Canon, the other a Panasonic. I have had these cameras for a few years and have never had a problem downloading.

    I am having the same problem which has happened very infrequently before. Generally it's one photo and happened when my battery died.
    However today I tried to download six photos.
    None would download including several others for a total of 21 that would not download.
    Since I had just installed a new powered hub and added three new external 4T hard drives, I got concerned that it was the hub. Then got really worried that I'd have problems with the data I have been backing up.
    However following this sequence of events, I've determined it's not the hub, but still don't know what is causing the problem.
    (1) Put a fresh battery in the camera - same results
    (1.5) Used a different port in the new hub - same results
    (2) Put the card in the card slot in the back of my iMac - no problems except that one image I knew about last week. The six new images imported.
    (3) Tried again using the cable - still same error
    (4) Changed cables - my husband has the same camera - still same error
    (4) Put the card in his camera with his cable - still same error
    (5) Put the card in a card reader and used the same slot in the new hub - no problems - same one wouldn't import but message that there are no new photos to import.
    (6) Moved the offending one image to the Trash while the card was in the card reader
    (7) Put the card back into my camera and used my cable. iPhoto had no error and displayed the message there are no new photos.
    Conclusion:
    Not the camera
    Not the cable
    Not the hub
    Must remove bad photo from the card
    However, I have not had to do that before. I went through several imports on vacation when there was one bad image and just ignored it each time.
    Any idea why this is happening now?
    Thank you

  • Export ABAP Classes to File

    How can I export an ABAP class to file? After exporting how can I import an ABAP class from file?
    Thanks
    Rene

    Hello,
    I have the same problem: export and import ABAP classes.
    You said to check out the CL_OO_* classes but I did not
    find a method to export or import classes to or from file.
    I really would be thankful when you could give me a more specific answer.
    Regards,
    Alex

Maybe you are looking for

  • MBAM 1.0 and Windows 8.1

    Hello, Is it possible and supported to install MBAM 1.0 on Windows 8.1 Enterprise? Thanks, Nick.

  • IDOC structure in F4 Help

    Hey Guys I m developing a search functionality where i need to search the message payload based upon a certain value in IDOC(it could be IDOC number,IDOC type,creation date etc etc). My functionality needs complete Xpath for this search(for e.g. IDOC

  • Company code in Spain

    Hi I am going to create a Spanish company code on SAP and I have an SAP document from 2001 that advises on Spain which helps with the legal requirements,  however I wondered if anyone could tell me if there is a later version of this PDF or any other

  • Service packs and hot fixes for  BusinessObjects Enterprise XI 3.1

    Hello Experts. Which is the cronology or order of the service packs and hot fixes for  BusinessObjects Enterprise XI 3.1, or which are tha latest? thanks

  • Keynote to Quicktime export

    I currently have keynote '09 and am having trouble producing a video that works on an HD TV. It does not seem to matter whether I use 1280x720 or 1920x1080 when I export it as a quicktime movie and specify HD the movie never plays right on the TV. It