Upload local TRU file with GUI_UPLOAD in ECC6

Hi all,
i need to upload a file with no "CR/LF" characters in a migration project from 46C to ECC6 system
in 46C, the FM WS_UPLOAD is working well :
  CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
  CODEPAGE                      = ' '
    filename                      = input_f1
    filetype                      = 'TRU'
  HEADLEN                       = ' '
  LINE_EXIT                     = ' '
    TRUNCLEN                      = '300'
  USER_FORM                     = ' '
  USER_PROG                     = ' '
  DAT_D_FORMAT                  = ' '
IMPORTING
  FILELENGTH                    =
    TABLES
      data_tab                      = ITAB_IN
    EXCEPTIONS
This FM is obsolete in ECC6 and the GUI_DOWNLOAD FM populates only one line of the internal table. It means only 300 characters
and all the remaining file is ignored :
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
   FILENAME                      = input_f1
   FILETYPE                      = 'ASC'
  HAS_FIELD_SEPARATOR           = ' '
  HEADER_LENGTH                 = 0
   READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
  CODEPAGE                      = ' '
  IGNORE_CERR                   = ABAP
  REPLACEMENT                   = '#'
  CHECK_BOM                     = ' '
  VIRUS_SCAN_PROFILE            =
  NO_AUTH_CHECK                 = ' '
IMPORTING
  FILELENGTH                    =
  HEADER                        =
  TABLES
    DATA_TAB                      = ITAB_IN
EXCEPTIONS
Can any one tell me how can i read such file entirely in my internal table??
Thank you

Try changing your code as this sample code snippet:
TYPES: BEGIN OF ex_upload,
      record(800) TYPE c,
      END OF ex_upload.
DATA: ex_itab TYPE STANDARD TABLE OF ex_upload,
      wa_upload TYPE ex_upload.
CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = v_file1
      filetype                      = 'ASC'
*       HAS_FIELD_SEPARATOR           = 'X'
    TABLES
      data_tab                      = ex_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

Similar Messages

  • Problems uploading a text file with line feed characters from Windows

    Hi,
    I am using the FM GUI_UPLOAD to load a text file in which at the end of each line there is a line feed character. When I upload the file, the FM interprets the entire file as ONE record; it does not recognize the line feed character at the end of each file line. I am using the parameter in the FM "HAS_FIELD_SEPARATOR" and it does not do anything to remidiate this issue.
    The funny thing is that  WS_upload works like a charm and it separates every line in the text file according to the line feed character at the end of each file line.
    Why a FM that is obsolete would work better and with  less effort than the new one? We are on 4.6c and will go to ECC6.0 May 2009.
    Can anybody recommenced a way to process this type of file using GUI_upload?
    The file to process is downloaded from a bank Website into a Windows PC. Sending the file to Unix first is not an option.
    Thanks,
    Pierre Martinez
    Edited by: Pierre Martinez on Aug 15, 2008 1:09 AM

    Hi,
    I have done that and Notepad does NOT interpret the line feed character. The file looks all messed up. Notepad does NOT split the data into records. The Hex character at the end of each file line is 0A.
    The user will download the file into a Windows desktop from the bank's website and from there an ABAP  program needs to read it and parse it. But the ABAP  program can not even catch the entire file with gui_upload. WS_upload can catch it with no issues.
    I tried catching the file into an internal table of data type string using GUI_upload, but it only catches two bytes of the file and nothing else.
    I will try catching the file in some other type of data type for the internal table in gui_upload.
    Once I catch it, I can split the file by the line feed character. I need to catch it  first, but "my glove" is not big enough. Defining the internal table for the gui_upload as character is a guessing game since I really do not know how big the text file is since GUI_upload will put it in a one record.
    Thanks.

  • How to update a dbf file with gui_upload???

    hi friends,
    i would like to know how to update a dbf file with gui_upload???
    as i hve already know that it's easy to convert dbf to tab formatted text fle and thn upload it.but i want the direct uploading way.i don't let my user's bsy with converting existing dbf to txt.so pls help me asap!!!!!i will be thankful to you!!!!!

    its very easy you can search other forum!!!

  • How can I upload and download files with uiXML?

    I want to implement upload and download files with uiXML. In some previouse topic I got answare to look in AbstractPageBroker class in JavaDOC. I did it but this is a very-very little resolution description for this problem. I think for developers YOU (UIX Team) must in very quick time to put some examples on the NET because this is a nice technology but with adecvate samplase and developers guide it will be dead very soon. I digging this forum for information. I see many many people have same problems about this technology. They like it and want to use and try but documentation is very very poor.
    WE WANT EXAMPLES and separate forum for UIX. I think it deserve this.
    If You have any more detailed documentation would be nice to put on the net. I have uixdemo.zip file but this is in very early fase of development. I downloaded it before fwe months. And now I can't find it anymore on youre site. What happend?

    Attila -
    I went back and re-read the JavaDoc for AbstractPageBroker and MultipartFormItem and put together the following sample PageBroker based on the description from the JavaDoc:
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.share.util.MultipartFormItem;
    import oracle.cabo.servlet.xml.UIXPageBroker;
    * An extension of UIXPageBroker which stores all uploaded
    * files in the temporary directory.
    public class UploadingPageBroker extends UIXPageBroker
    * Override of AbstractPageBroker.doUploadFile() which saves
    * all files to the temporary directory.
    protected String doUploadFile(
    BajaContext context,
    Page page,
    MultipartFormItem item) throws IOException
    // Get the location of the file to create in the temp directory.
    // Of course a real application probably wouldn't upload files to
    // the temp directory - just using this contrived example to
    // demonstrate basic uploading support.
    File file = _getFile(context, item);
    if (file != null)
    // Create a FileOutputStream. Of course, a real application would
    // probably want to buffer the output
    FileOutputStream out = new FileOutputStream(file);
    // Write out the file
    item.writeFile(out);
    // Close up the output stream
    out.close();
    // We can return a value here to add to the PageEvent
    // if so desired.
    return null;
    // Gets the File for the item that we are uploading
    private File _getFile(
    BajaContext context,
    MultipartFormItem item
    // Get the file name
    String name = item.getFilename();
    // If we don't have a file, bail...
    if (name == null)
    return null;
    // Get the path to the temporary directory
    File dir = _getTempDir();
    // Return the File object
    return new File(dir, name);
    // Returns the path to the temprary directory
    private File _getTempDir()
    // Get the temporary directory from the ServletContext
    ServletConfig sConfig = getServlet().getServletConfig();
    ServletContext sContext = sConfig.getServletContext();
    return (File)sContext.getAttribute("javax.servlet.context.tempdir");
    In this sample, each uploaded file is simply saved in the temporary directory. You'll want to replace the code that creates the FileOutputStream for the uploaded file to use whatever OutputStream makes sense for your application.
    BTW - I used the following UIX page to test this out:
    <?xml version="1.0" encoding="UTF-8"?>
    <page xmlns="http://xmlns.oracle.com/uix/controller">
    <content>
    <pageLayout xmlns="http://xmlns.oracle.com/uix/ui">
    <contents>
    <form name="uploadForm" usesUpload="true">
    <contents>
    <fileUpload name="uploadedFile"/>
    <submitButton name="upload" text="Upload"/>
    </contents>
    </form>
    </contents>
    </pageLayout>
    </content>
    </page>
    Hope this sample helps with the uploading part of your question. I'll see if I can provide a download sample in a later post.

  • What parameters should i pass inorder to upload an excel file in gui_upload

    what parameters should i pass inorder to upload an excel file in gui_upload
    Thanks in advance.
    Ahmed.

    check below program....
    *& Report  UPLOAD_EXCEL                                                *
    *& Upload and excel file into an internal table using the following    *
    *& function module: ALSM_EXCEL_TO_INTERNAL_TABLE                       *
    REPORT  UPLOAD_EXCEL no standard page heading.
    *Data Declaration
    data: itab like alsmex_tabline occurs 0 with header line.
    Has the following format:
                Row number   | Colum Number   |   Value
         i.e.     1                 1             Name1
                  2                 1             Joe
    TYPES: Begin of t_record,
        name1 like itab-value,
        name2 like itab-value,
        age   like itab-value,
        End of t_record.
    DATA: it_record type standard table of t_record initial size 0,
          wa_record type t_record.
    DATA: gd_currentrow type i.
    *Selection Screen Declaration
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = p_infile
                i_begin_col             = '1'
                i_begin_row             = '2'  "Do not require headings
                i_end_col               = '14'
                i_end_row               = '31'
           tables
                intern                  = itab
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
      if sy-subrc <> 0.
        message e010(zz) with text-001. "Problem uploading Excel Spreadsheet
      endif.
    Sort table by rows and colums
      sort itab by row col.
    Get first row retrieved
      read table itab index 1.
    Set first row retrieved to current row
      gd_currentrow = itab-row.
      loop at itab.
      Reset values for next row
        if itab-row ne gd_currentrow.
          append wa_record to it_record.
          clear wa_record.
          gd_currentrow = itab-row.
        endif.
        case itab-col.
          when '0001'.                              "First name
            wa_record-name1 = itab-value.
          when '0002'.                              "Surname
            wa_record-name2 = itab-value.
          when '0003'.                              "Age
            wa_record-age   = itab-value.
        endcase.
      endloop.
      append wa_record to it_record.
    *!! Excel data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • Upload new pdf file with the same name

    We are trying to upload a pdf file with a specific name (i.e
    file.pdf) that has links to it on many pages of a website. We need
    the pdf file to keep the same name but when we try to upload it,
    Contribute is being 'smart' and changing the name so as to not
    overwrite the file on the server. But we WANT to overwrite the file
    on the server. Any ideas on how we can achieve this in Contribute?
    Thanks so much (in advance) for your help!

    Actually, we have the same problem and I believe the answer
    lies in the abilities that your role has assigned to it. The
    solution that ThinkInk gave works *if you are allowed to delete
    files*. If your role doesn't have that permission, then it will
    just upload another copy of the file and rename it.
    It's rather irritating that there isn't more control over
    this...our server is littered with *thousands and thousands* of
    duplicate files that originate from this situation.
    If your administrator wants you to be able to delete files as
    well, then you could get him/her to give you that permission, and I
    believe this will allow you to overwrite the file by using the
    "Publish file from my computer" option described above.

  • Has anyone been able to upload an ibooks file with audio only files (m4a) in it? I keep getting the following error message during the upload in iTunes Producer: ERROR ITMS-9000: "Files of type audio/x-m4a are not allowed outside of widgets.

    Has anyone been able to upload an ibooks file with audio only files (m4a) in it? I keep getting the following error message during the upload in iTunes Producer: ERROR ITMS-9000: "Files of type audio/x-m4a are not allowed outside of widgets. then it names the file as an m4p file. Everything works beautifully on the iPad through Preview, and validates through iTunes Producer up until the attempted upload. If you've been able to accomplish this, please let me know how you prepared your audio files. Many thanks.

    Hello Fellow iBook Authors!
    Today I received the same error that you all have been discussing.  I tried selecting the DRM
    and this did not work for me, though I'm glad it did for some.  Here's what I did as a work-around. . .
    Since iBooks Author did not have a problem with Videos, I simply used one of my video programs, ScreenFlow to turn the audio into a video file m4v.  I added an image and extended the length or timing of the image to span the length of the audio file.  Then exported as an .mov.  I then opened QuickTime and opened the file and exported the file to iTunes. 
    You can use iMovie, Camtasia or any other progam that will allow you to export the audio as a movie file.  Does this make sense?  I hope this helps, at least in the short-term.
    Michael Williams

  • HTMLLoader - local HTML file with remote access

    Hi,
    I use the HTMLLoader to load a local HTML file. (AIR
    development with Flash)
    In this local HTML file is a remote JavaScript, which I need.
    It doesn't work, because of the sandbox.
    But is it possible to deactivate the sandbox or anything
    else, that I can use the local HTML file with remote access?

    Hi,
    I use the HTMLLoader to load a local HTML file. (AIR
    development with Flash)
    In this local HTML file is a remote JavaScript, which I need.
    It doesn't work, because of the sandbox.
    But is it possible to deactivate the sandbox or anything
    else, that I can use the local HTML file with remote access?

  • Uploading a text file with unknown number of  texts

    Hi ,
    i have a flat file with around  10,000 record's.
    each material number  followed by  different  lengths & unknown number of text's separated by delimiter '$',
    that need to be saved using save_text function module.
    the file is as follows, 
    record 1 :     material1$text1$text2$text3
    record 2 :     material2$text1$text2$text3$text4$text5$text6$.....
    record 3 :     material3$text1$text2$text3$text4$text5
    record 4:      material3$text1
    - - - - - - - - - - - -  so on ....
    i created the following  structure ,  to split and save each text separated by '$'  , to save in TLINE  of save_text function module.
    types : begin of ty_file,
                  matnr type mara-matnr,
                  text1 type string,
                  text2 type string,
                  text3 type string,
                  text4 type string,
                  text20 type string,
               end of ty_file.
    i have uploaded the file and saved in table  it_file type ty_file.
    loop it_file into wa_file.
       split wa_file at '$' in to matnr text1 text2 text3 text4 ....... so on.
    endloop.
    please, suggest me an alternate way to reduce the code, instead of creating a structure like above, so that each splitted text
    stores in a single variable and is passed to TLINE of corresponding material, in save_text function module
    thanks
    viki

    Hi,
    The flat file contains , material No. followed by it's text , each text sepearted by '$' symbol.
    For each material  i have to get all lines of text, and passed to tables paramter of save_text.
    The Number of text' for each material is varying.
    Please kindly suggest me , how many variables i need to create to hold each splitted text and store it in Tline
    I wrote the below program assuming that the material number has  maximum of 20 texts, it's working fine. But, what if the number of texts exceeds 20.
    file :
    4907507$ Druckrolle$ Durchmesser: 218 mm$ Länge: 750 mm$ Rollenwerkstoff: 1.4301/1.4541$ Oberfläche: gummiert$ Stärke Gummierung: 10 mm$ Näscher    E 71224$$$$$$$$$$$$$$                              
    1149598$ Tragrolle$ mit Stützringen$ Norm: ähnlich DIN 22112$ Durchmesser: 89 mm$ Mantellänge: 800 mm$ Form der Achsenden: A2$ Achsdurchmesser: 25 mm$ Achsanflachung: SW 18$ Einlegelänge: 808 mm$ Achslänge: 834 mm$ Lagerbezeichnung: 6305$ Anzahl Stützringe Form A: 6$ Anzahl Stützringe Form B: 4$ Anordnung links: 4$ Anordnung mittig: 6$ Anordnung rechts: 4$ Qualität Stützringe: N$ Durchmesser Stützringe: 159 mm$ Anzahl Zwischenhülsen: 7$ Anzahl Schlussscheiben: 2$ Erbö   3111.800.05.68                                                                      
    file upload
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = gd_file
          FILETYPE            = 'ASC'
         HAS_FIELD_SEPARATOR = 'X'
         HAS_FIELD_SEPARATOR = '$'
        TABLES
          DATA_TAB            = It_data.
      loop at it_data into wa_data.
        split wa_data-line at seperator into matnr_txt text1 text2 text3 text4 text5
                                                   text6 text7 text8 text9 text10 text11
                                                   text11 text12 text13 text14 text15
                                                   text16 text17 text18 text19 text20.
        move matnr_txt to wa_material-matnr.
        move text1 to wa_material-text1.
        move text2 to wa_material-text2.
        move text20 to wa_material-text20.
        append wa_material to it_material.
        clear wa_material.
      endloop.
      loop at it_material into wa_material.
        WA_LINE-TDFORMAT = '*'.
        WA_line-TDLINE = wa_material-text1.
        APPEND WA_LINE TO IT_LINE.
        WA_LINE-TDFORMAT = '*'.
        WA_line-TDLINE = wa_material-text2.
        APPEND WA_LINE TO IT_LINE.
        WA_LINE-TDFORMAT = '*'.
        WA_line-TDLINE = wa_material-text20.
        APPEND WA_LINE TO IT_LINE.
        G_THEAD-TDNAME   = wa_material-matnr. " material number
        G_THEAD-TDID     = pa_id.                           "  'GRUN',
        G_THEAD-TDSPRAS  = pa_langu.                "  EN
        G_THEAD-TDOBJECT = pa_obj.                   "  MATERIAL
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            CLIENT                           = SY-MANDT
            HEADER                        = G_THEAD
            SAVEMODE_DIRECT     = 'X'
          TABLES
            LINES           = IT_LINE
          clear : wa_line, g_matnr.
          refresh it_line.
      endloop.
    Edited by: jvsvijay on Jul 28, 2011 12:51 PM
    Edited by: jvsvijay on Jul 28, 2011 12:53 PM
    Edited by: jvsvijay on Jul 28, 2011 12:55 PM

  • Re: Upload a flat file with multiple field seperators

    HI Experts,
    In my reports program iam trying to  upload  the data with in flat file with multiple seperators
    but data is not uploading can ypu please suggest the solution.
    Is there any function module to upload with multiple field seperators
    Example of flat file:
    E1234     JOHN     BB     HYD     IN     EN
    E1234,BURE,BH,DSNR,IN,EN
    E1236 KIWI KW HYT IN EN
    E1237;BRAD;BW;MSRD;IN;EN
    Thanks & Regards,
    Raghusagar.G

    HI Raghu,
               Use the function module 'GUI_UPLOAD'.
               In that you have to specify the field_separator value = 'X' in export section.
    Regards,
    S.C.K

  • How to upload a .CSV file using GUI_UPLOAD

    Hi Experts,
          In my report, I need to upload .CSV file using GUI_upload..So how to do ....Plz provide solution...

    Hi prashanthishetty,
    this is already answered many times in this forum!
    use forum search or wiki search
    [http://wiki.sdn.sap.com/wiki/display/Snippets/uploadcsvfilesintointernal+table]
    regards
    rea

  • User cannot upload an xlsx file with charts to document library

    I have a number of users who are unable to upload documents to document libraries. When they attempt to upload, it will either just sit there like it's working but never finish or display an Internet Explorer cannot display this page screen. I have narrowed
    it down to the content of the file being the issue. The file is under 1MB in size so it isn't a size issue.
    Specific case:
    1.User trying to upload an xlsx file and it fails.
    2.I try to upload the file (win7 Sp1) and it uploads fine.
    3.I modified the file by removing 5 charts.
    4.User tried to upload the file again and it uploaded fine.
    So based on this it appears that the charts are causing the issue. I remember reading something a while back about SharePoint using different upload protocols based on the complexity of the document but I can't seem to find any info on that anymore.
    This issue has been intermittent over the last few months. It magically resolves itself after a random period of time then comes back.
    Any suggestions will be greatly appreciated.
    SharePoint Environment:
    1 WFE SharePoint 2007 Enterprise SP2 (WIndows Server 2003 Std 32bit SP2)
    1 SQL Server 2005 (Windows Server 2003 Ent 64bit SP2)
    Client PC:
    Windows XP 32bit SP3
    IE8

    Hello diver7,
    Thank you for your question.
    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
    Thank you for your understanding and support.
    Thanks,
    Wayne Fan
    TechNet Subscriber Support
    in forum
    If you have any feedback on our support, please contact
     [email protected]
    Wayne Fan
    TechNet Community Support

  • Can't select local html files with web object in captivate 8

    I can select pdf's via browse, but it I want to add local html files I have to type the path in manually. I'm guessing this is just a bug, I should be able to choose web pages for the web object even if they are local right?

    Fireworks is a graphics editor that can export code; it is not an HTML/code editor.
    If you have exported HTML from Fireworks, you ought to be able to re-import that, but I would think most people who use Fireworks exported code would just modify their Fireworks document and re-export. (Fireworks' code is not robust and it is only intended for mockups and prototypes. Fireworks is not intended for developing and maintaining live Web sites; Dreamweaver is.)
    If your developer used Dreamweaver, then I really don't expect that Fireworks would be able to import that, nor any code that isn't in exactly the format that it can export. If you know your developer used Fireworks, then you need to look for .png files. Fireworks uses an enhanced version of the PNG format for its native document format.
    If you are making small adjustments to your site, then you might be better off working in Dreamweaver. If you're doing a site re-design, then Fireworks is an excellent tool for laying out your design and producing your graphics, but you will, at some point, need to move over to Dreamweaver for coding.

  • Error uploading 100+ Mb file with quota/limit settings adjusted

    Hi,
    We have a SharePoint Site, 2003 on IIS 6.
    We recently encountered an issue where uploading file larger than 100Mb will give us an error message, "An expected error occured".
    We tried uploading within 50Mb files and its successful.
    Got googling for a resolution and found some that might have this issue resolved, on
    http://support.microsoft.com/kb/925083
    We have modified the settings as per mentioned recommendations but still facing same issue. Here's what we did:
    Did we miss something out? or any other cofig needed to be changed?
    May we know as well what are the other configs/settings that are related regarding the issue we encounter?
    Many thanks in advance,
    Jerson.

    Looks like you've missed the Web Application Settings for maximum file upload.  Your screenshot suggests that you're on SharePoint 2007.
    There's a number of links and articles out there but this one should have the info you need: -
    http://www.atalasoft.com/cs/blogs/jake/archive/2009/02/19/changing-maximum-upload-size-in-wss-3-0-and-moss-2007.aspx
    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/

  • Uploading an Excel File with an ITS page

    Hi All,
    how can I do to provide a functionality to Upload Excel or TXT Files in a ITS Page ? I try to use functions GUI_UPLOAD, but it calls a Screen that I doesn't want that apears.
    With another solution I make a BSP aplication that is called from my ITS page, in BSP aplication I use <input file... ...> to get content of File and transfer it to an internal table, but I had problem to transfer back this data to ITS aplication, then I solve this problem using EXPORT DATABASE. I believe that is not the corectly solution.
    Somebony knows another way to solve this problem ?
    Thanks

    Hi Regis,
    When i tried to upload a file it won't allow you to select a file in your local drive.
    If you use the frontend services in SAPGUI for HTML,interim screens are shown because of technical reasons.
    You need <b> Java Applet </b> to be iniated before the page loads.IS Java installed on ur PC ?
    <b> REFER the SAP note : 893567 .</b>
    Rgds,
    J
    Do award pts & close the thread, if you got the soln.

Maybe you are looking for