Error uploading large txt file using GUI_UPLOAD

Hi everyone.
The situation is as follows: I have to process (batch input) an extremely large text file, of about 80 MB. As you can imagine, all I receive when I run my program is a dump somewhere inside the GUI_UPLOAD function routine due to excessive memory usage.
Does anybody know of a way to deal with this kind of files? Is there any function that allows partial processing or something like that?
Thanks a lot,
Fernando.

If you have to process it all at once, you can have basis FTP it to your application server and then use OPEN DATASET and TRANSFER rather than GUI_UPLOAD. this would probably be the quickest solution.
Rob

Similar Messages

  • 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

  • Can TXT file with separater ',' be upload to internal TBL using GUI_UPLOAD?

    hello, experts,
    I have a problem with data transfer. I need to upload TXT file to SAP internal table, data in TXT file are separated by ',' and more than one line records are contained in the file. I tried to use FM GUI_UPLOAD as below to upload the file and transfer the data to internal table, however it comes out error. SY-SUBRC is UNKNOW ERROR, error message shows: Cannot interpret date in file.
          CALL FUNCTION 'GUI_UPLOAD'
               EXPORTING
                    FILENAME                = FILEPATH
                    FILETYPE                = 'DAT'
                    HAS_FIELD_SEPARATOR     = ','
                    READ_BY_LINE            = 'X'
               TABLES
                    DATA_TAB                = TAB_X3
               EXCEPTIONS
                    CONVERSION_ERROR        = 1
                    FILE_OPEN_ERROR         = 2
                    FILE_READ_ERROR         = 3
                    INVALID_TYPE            = 4
                    NO_BATCH                = 5
                    UNKNOWN_ERROR           = 6
                    INVALID_TABLE_WIDTH     = 7
                    GUI_REFUSE_FILETRANSFER = 8
                    CUSTOMER_ERROR          = 9
                    OTHERS                  = 10.
    Thank you.

    HAS_field_separator can have only SPACE or X.
    upload the file using GUI_UPLOAD and then in the program you split the lines by comma.
    Data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    DATA: begin of itab1 occurs 0, 
              matnr type mara-matnr
          werks type marc-werks
          lgort type marc-lgort,
          end of itab1.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = FILEPATH
    FILETYPE = 'DAT'
    HAS_FIELD_SEPARATOR = 'X'
    READ_BY_LINE = 'X'
    TABLES
    DATA_TAB = TAB_X3
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10.
    loop at itab.
    split itab-rec at ',' into itab1-matnr itab1-werks itab1-lgort.
    append itab1.
    endloop.

  • Error!! uploading .txt file using WS_upload

    Hi Friends,
       I am trying to upload a .txt file with 5 fields into a ztable using WS_upload. In debug mode i see that the internal table itab has all the fields clustered together seperated by a # symbol. How do i remove this # symbol so that i can upload it into ztable properly .
    For eg the error i m getting is
    ibm#1042#krj#04-19-2006#PS. All these 5 fields get clustered under material column and not in their respective columns.
    Your opinion and advice is greatly appreciated .
    Thank you

    Suppose you have the data from the file in i_text and i_vendor is a structure similar to the database, then you use the following logic to split the text with hash as delimiter.
    loop at i_text.
    split i_text-text at '#' into i_vendor-lifnr
                                  i_vendor-ekorg
                                  i_vendor-ktokd
                                  i_vendor-name1
                                  i_vendor-sortl
                                  i_vendor-land1
                                  i_vendor-spras
                                  i_vendor-waers.
    append i_vendor.
    clear :i_vendor,
           i_text.
    endloop.
    Let me send you a sample code. Let me know if this helps.
    Award points if the answer helped you !
    Session Method: ( Batch Input)
    3 Function Modules are there.
    1)     BDC_OPEN_GROUP
    2)     BDC_INSERT
    3)     BDC_CLOSE_GROUP
    Instead of all the Call Transactions we use the Function modules here.
    1)     Go for MK01
    2)     Go for recording.  M4567,0001,0001 enter; test1, abcd, us, en, enter; usdollars; save.
    3)     Save and come back.
    4)     Select Vendor and Click on PROGRAM button . Stest_01
    5)     Select Transfer from recording button.
    6)     Save as local object
    7)     Copy the code into a Report program and execute it.
    Example:
    1) Create a text field having the following entries
    t3456,0001,0001,testt3456,abcd123,US,E,USD and save the entries for 4-5 lines of these type.
    2) Create a Program.
    Report ZBDC_MK01.
    *& Report  ZBDC_MK01
    REPORT  ZBDC_MK01.
    * Internal table for file
    data : begin of i_text occurs 0,
           text(255) type c,
           end of i_text.
    * Internal table for MK01 Transaction
    data : begin of i_vendor occurs 0,
           lifnr(10) type c,
           ekorg(4) type c,
           ktokd(4) type c,
           name1(40) type c,
           sortl(10) type c,
           land1(3) type c,
           spras(1) type c,
           waers(3) type c,
           end of i_vendor.
    * Internal table for BDCDATA
    data i_bdcdata like bdcdata occurs 0 with header line.
    data : v_repid like sy-repid.
    parameters p_file like rlgrap-filename.
    INITIALIZATION.
    v_repid = sy-repid.
    at selection-screen on value-request for p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = v_repid
    *   *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_file
    start-of-selection.
    * Get the data from file to internal table
    perform get_data.
    * Open the session
    perform open_session.
    * Process the bdcdata
    perform process_bdcdata.
    * Call the close_group
    perform close_group.
    *&      Form  get_data
    *       WS_UPLOAD FM
    FORM get_data .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    *   CODEPAGE                      = ' '
       FILENAME                      = p_file
       FILETYPE                      = 'ASC'
    *   HEADLEN                       = ' '
    *   LINE_EXIT                     = ' '
    *   TRUNCLEN                      = ' '
    *   USER_FORM                     = ' '
    *   USER_PROG                     = ' '
    *   DAT_D_FORMAT                  = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = i_text
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
    loop at i_text.
    split i_text-text at ',' into i_vendor-lifnr
                                  i_vendor-ekorg
                                  i_vendor-ktokd
                                  i_vendor-name1
                                  i_vendor-sortl
                                  i_vendor-land1
                                  i_vendor-spras
                                  i_vendor-waers.
    append i_vendor.
    clear :i_vendor,
           i_text.
    endloop.
    endif.
    free: i_text.
    ENDFORM.                    " get_data
    *&      Form  open_session
    *       text
    FORM open_session .
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
    *   DEST                      = FILLER8
       GROUP                     = 'VENDOR_MK01'
    *   HOLDDATE                  = FILLER8
       KEEP                      = 'X'
       USER                      = sy-uname
    *   RECORD                    = FILLER1
    *   PROG                      = SY-CPROG
    * IMPORTING
    *   QID                       =
    EXCEPTIONS
       CLIENT_INVALID            = 1
       DESTINATION_INVALID       = 2
       GROUP_INVALID             = 3
       GROUP_IS_LOCKED           = 4
       HOLDDATE_INVALID          = 5
       INTERNAL_ERROR            = 6
       QUEUE_ERROR               = 7
       RUNNING                   = 8
       SYSTEM_LOCK_ERROR         = 9
       USER_INVALID              = 10
       OTHERS                    = 11
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " open_session
    *&      Form  process_bdcdata
    *       BDCDATA
    FORM process_bdcdata .
    loop at i_vendor.
    perform bdc_dynpro      using 'SAPMF02K' '0107'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  i_vendor-lifnr.
    perform bdc_field       using 'RF02K-EKORG'
                                   i_vendor-ekorg.
    perform bdc_field       using 'RF02K-KTOKK'
                                  i_vendor-ktokd.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-NAME1'
                                 i_vendor-name1.
    perform bdc_field       using 'LFA1-SORTL'
                                  i_vendor-sortl.
    perform bdc_field       using 'LFA1-LAND1'
                                  i_vendor-land1.
    perform bdc_field       using 'LFA1-SPRAS'
                                    i_vendor-spras.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPMF02K' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFM1-WAERS'
                                  i_vendor-waers.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    * Call the transaction code.
    perform bdc_insert.
    refresh i_bdcdata.
    endloop.
    ENDFORM.                    " process_bdcdata
    *&      Form  bdc_dynpro
    *       text
    *      -->P_0264   text
    *      -->P_0265   text
    FORM bdc_dynpro  USING    p_prog
                              p_scrn.
    clear i_bdcdata.
    i_bdcdata-program = p_prog.
    i_bdcdata-dynpro = p_scrn.
    i_bdcdata-dynbegin = 'X'.
    append i_bdcdata.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    *       text
    FORM bdc_field  USING    p_fnam
                             p_fval.
    clear i_bdcdata.
    i_bdcdata-fnam = p_fnam.
    i_bdcdata-fval = p_fval.
    append i_bdcdata.
    ENDFORM.                    " bdc_field
    *&      Form  bdc_insert
    *       text
    FORM bdc_insert .
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
       TCODE                  = 'MK01'
    *   POST_LOCAL             = NOVBLOCAL
    *   PRINTING               = NOPRINT
    *   SIMUBATCH              = ' '
    *   CTUPARAMS              = ' '
      TABLES
        DYNPROTAB              = i_bdcdata
    EXCEPTIONS
       INTERNAL_ERROR         = 1
       NOT_OPEN               = 2
       QUEUE_ERROR            = 3
       TCODE_INVALID          = 4
       PRINTING_INVALID       = 5
       POSTING_INVALID        = 6
       OTHERS                 = 7
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " bdc_insert
    *&      Form  close_group
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM close_group .
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    * EXCEPTIONS
    *   NOT_OPEN          = 1
    *   QUEUE_ERROR       = 2
    *   OTHERS            = 3
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " close_group
    4)     Save and activate.
    5)     Go to SM35 and see the session created. Vendor_MK01 (group name which was given)
    6)     Need to go to SM35. Select the Session name and Click on Process. Select BACKGROUND.
    7)     Click on PROCESSED Tab.
    8)     For seeing the log file select the session and click on LOG. Click on Display.
    Difference between Call Transaction and Sessions Method.:
    1) In CT if mode is ¡¥A¡¦ then there wont be log messages. In sessions method we can get log messages in Foreground and Background too.
    2) In session method until and unless session Is created it wont update the data. But in CT data is updated immediately.
    3) In CT for log messages have to write BDCMSGCOLL structure and Format_Messages function module. Logs are created automatically in Session method.
    4) Data UPDATION in CT is Asynchronous. In Session method its Synchronous.
    5) In CT we have to split the file. In Session method we need not split the file.
    6) In CT we use BEND in Session we have to use END
    Real time most of the times its SESSION Method.
    Use CT method when: 
    a)     Run time Validation.  Example: We are creating a sales order. Here we are validating when selecting Payment Terms etc.
    DIRECT INPUT Method:
    If anything modified in SAP transaction don¡¦t use DI method. Updation is very fast.
    There is no Restart mechanism in DI method.
    Ex: have 10 records. 6,7 are error. In session method we needent go to the file. We have to go to BI and process again. Process in Foreground and during this time change at run time.
    We need to go for the file. Delete the first files, last files and then upload the data and run again.
    Main Transaction Code for DI is SXDB
    1)     Click on GoTo-----„³ DX Tools
    2)     Object type---Select G/L Account ; Task type: Load Data; Program type: Batch Input; Program: RFBISA00 .
    Q) How to copy files from SAP server to local?
    Ans) Bcos we don¡¦t get authorization for AL11 transaction. If we know file directory and File name. We can see structure.
    In SXDB.
    1)     Click on GoTo-----„³ DX Tools
    2)     Object type---Select G/L Account (BUS 3006) ; Task type: Load Data; Program type: Batch Input; Program: RFBISA00 .
    Go for Copy file. Give the Application Server file name and also he presentation server name and location.
    *& Report  ZBDC_MM01
    REPORT  ZBDC_MM01.
    * Constants
    constants : c_x type c value 'X'.
    * Internal table for file
    data : begin of i_text occurs 0,
           text(255) type c,
           end of i_text.
    * iNTERNAL TABLE FOR MATERIAL LOAD
    DATA : BEGIN OF I_MATERIAL OCCURS 0,
           MATNR(18) TYPE C,
           MBRSH(1) TYPE C,
           MTART(4) TYPE C,
           MAKTX(40) TYPE C,
           MEINS(3) TYPE C,
           MAKTL(3) TYPE C,
           END OF I_MATERIAL.
    * INTERNAL TABLE FOR BDCDATA
    DATA I_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    * internal table for for logs
    data i_bdcmsg like bdcmsgcoll occurs 0 with header line.
    * Report id
    data : v_repid like sy-repid,
           v_msg(255) type c.
    * Internal tabel for log records
    data : begin of i_log occurs 0,
           text(255) type c,
           end of i_log.
    * Selection-screen
    selection-screen : begin of block blk with frame title text-001.
    parameter p_file like rlgrap-filename.
    selection-screen : end of block blk.
    * fill the defaut value
    INITIALIZATION.
    v_repid = sy-repid.
    * F4 value for File
    at selection-screen on value-request for p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = v_repid
    *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_file
    start-of-selection.
    * get the data from file to internal table
    perform get_data_itab.
    * tO PROCEESS BDCDATA
    PERFORM PROCESS_BDCDATA.
    end-of-selection.
    * Process the data into file
    perform download_file.
    *&      Form  get_data_itab
    *    ws_upload
    FORM get_data_itab .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    *   CODEPAGE                      = ' '
       FILENAME                      = P_FILE
       FILETYPE                      = 'ASC'
    *   HEADLEN                       = ' '
    *   LINE_EXIT                     = ' '
    *   TRUNCLEN                      = ' '
    *   USER_FORM                     = ' '
    *   USER_PROG                     = ' '
    *   DAT_D_FORMAT                  = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = I_TEXT
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
    LOOP AT I_TEXT.
    SPLIT I_TEXT-TEXT AT ',' INTO I_MATERIAL-MATNR
                                  I_MATERIAL-MBRSH
                                  I_MATERIAL-MTART
                                  I_MATERIAL-MAKTX
                                  I_MATERIAL-MEINS
                                  I_MATERIAL-MAKTL.
    APPEND I_MATERIAL.
    CLEAR : I_MATERIAL,
            I_TEXT.
    ENDLOOP.
    ENDIF.
    ENDFORM.                    " get_data_itab
    *&      Form  PROCESS_BDCDATA
    *      bdcdata
    FORM PROCESS_BDCDATA .
    LOOP AT I_MATERIAL.
    * First Screen
    perform f_get_program using 'SAPLMGMM' '0060'.
    perform f_get_field   using 'BDC_CURSOR' 'RMMG1-MATNR'.
    perform f_get_field  using 'BDC_OKCODE' '=AUSW'.
    perform f_get_field  using 'RMMG1-MATNR' i_material-matnr.
    perform f_get_field  using 'RMMG1-MBRSH' i_material-mbrsh.
    perform f_get_field  using 'RMMG1-MTART' i_material-mtart.
    * Second screen
    perform f_get_program using 'SAPLMGMM' '0070'.
    perform f_get_field   using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'.
    perform f_get_field  using 'BDC_OKCODE' '=ENTR'.
    perform f_get_field  using 'MSICHTAUSW-KZSEL(01)' c_x.
    * third screen
    perform f_get_program using 'SAPLMGMM' '4004'.
    perform f_get_field   using 'BDC_CURSOR' 'MAKT-MAKTX'.
    perform f_get_field  using 'BDC_OKCODE' '=BU'.
    perform f_get_field  using 'MAKT-MAKTX' i_material-maktx.
    perform f_get_field  using 'MARA-MEINS' i_material-meins.
    perform f_get_field  using 'MARA-MATKL' i_material-maktl.
    ** call transaction
    call transaction 'MM01'
         using i_bdcdata
         mode 'N'
         messages into i_bdcmsg.
    refresh i_bdcdata.
    * Log message
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = SY-MSGID
       LANG            = '-E'
       NO              = SY-MSGNO
       V1              = SY-MSGV1
       V2              = SY-MSGV2
       V3              = SY-MSGV3
       V4              = SY-MSGV4
    IMPORTING
       MSG             = v_msg
    EXCEPTIONS
       NOT_FOUND       = 1
       OTHERS          = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    i_log-text = v_msg.
    append i_log.
    clear: i_log,
           v_msg.
    ENDLOOP.
    ENDFORM.                    " PROCESS_BDCDATA
    *&      Form  f_get_program
    *       Program ,Screen no, Dynbegin
    *      -->P_0206   text
    *      -->P_0207   text
    FORM f_get_program  USING   p_prog
                                p_scrn.
    clear : i_bdcdata.
    i_bdcdata-program = p_prog.
    i_bdcdata-dynpro = p_scrn.
    i_bdcdata-dynbegin = c_x.
    append i_bdcdata.
    ENDFORM.                    " f_get_program
    *&      Form  f_get_field
    *      field name ,field value
    *      -->P_0217   text
    *      -->P_0218   text
    FORM f_get_field  USING   p_fnam
                              p_fval.
    clear i_bdcdata.
    i_bdcdata-fnam = p_fnam.
    i_bdcdata-fval = p_fval.
    append i_bdcdata.
    ENDFORM.                    " f_get_field
    *&      Form  download_file
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM download_file .
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    *   BIN_FILESIZE                  = ' '
    *   CODEPAGE                      = ' '
       FILENAME                      =
       'C:Documents and SettingsAdministratorDesktoplog.txt'
       FILETYPE                      = 'ASC'
    *   MODE                          = ' '
    *   WK1_N_FORMAT                  = ' '
    *   WK1_N_SIZE                    = ' '
    *   WK1_T_FORMAT                  = ' '
    *   WK1_T_SIZE                    = ' '
    *   COL_SELECT                    = ' '
    *   COL_SELECTMASK                = ' '
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = i_log
    *   FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " download_file

  • Error uploading Document: "This file is empty" when it's not.

    Hi all!
    We're using an on-prem SP2013 farm.
    We've recently received reports of an error received when trying to upload a document to a library.  Specifically the error reads: 
    "This file is empty and needs content to be uploaded"
    This occurs most often when using Chrome and the drag/drop feature to upload the doc.
    However, the file is not empty, and if the user tries again a few minutes later, or manually uploads the doc, it works fine.
    Any suggestions on how to resolve this as it's starting to really irritate our users?
    Thanks!

    Hi,
    According to your description, my understanding is that the error occurred when you uploaded documents to SharePoint using drag/drop feature in chrome.
    Per my knowledge, we can upload office documents such as word, excel which are empty to SharePoint. But if we upload empty txt files to SharePoint, the error will occur.
    Did you try to upload txt files to SharePoint?
    Before you upload the files, I recommend to check the size of the files.
    I also recommend to check the ULS log located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS to see if anything unexpected occurred.
    Best regards.
    Victoria
    Victoria Xia
    TechNet Community Support

  • I would like to upload a excel file using jsp

    Hi,
    I would like to upload the excel file using jsp in my netbeans ide. Please help.
    I don Know what is the error in this jsp file. It is not showing any thing and the file is also not getting uploaded.
    Please gothru the code below.
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ page import="java.io.*" errorPage="err.jsp"%>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<html:rewrite page="/design.css" />" rel="stylesheet" type="text/css">
    <title>Upload Page</title>
    </head>
    <body onKeyDown="DisablingBackFunctionality()" onLoad="DisablingBackFunctionality()">
    <html:form action="download" >
    <div style="position:absolute; left:100;top:200;">Select an excel File :<input type="file" name="uploadfile"></div>
    <div style="position:absolute; left:190;top:250;"><input type="submit" name="Submit" value="Read"></div>
    <div style="position:absolute; left:336;top:250;"><input type="reset" name="Reset" value="Clear"></div>
    mainmenu
    </html:form>
    </body>
    </html>
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength) {
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String file = new String(dataBytes);
    //out.println("<br> file :"+file);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    //out.println("<br> savefile :"+saveFile);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    //out.println("<br> now file1 :"+saveFile);
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1, saveFile.indexOf("\""));
    //out.println("<br> now file2 :"+saveFile);
    //out.print(dataBytes);
    String ext = "";
    if (saveFile.indexOf(".") != -1) {
    ext = saveFile.substring(saveFile.lastIndexOf("."));
    int lastIndex = contentType.lastIndexOf("=");
    //out.println("<br>lst index of"+lastIndex);
    String boundary = contentType.substring(lastIndex + 1, contentType.length());
    //out.println("<br> boundary"+boundary);
    //out.println("<br> file :"+file);
    int pos;
    pos = file.indexOf("filename=\"");
    //out.println("<br> now 0 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 1 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 2 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 3"+pos);
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream("D:\\" + saveFile);
    //FileOutputStream fileOut = new FileOutputStream(saveFile);
    //fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    session.setAttribute("fil", saveFile);
    //out.println("File saved as " +saveFile);
    %>
    <script type="text/javascript" >
    function DisablingBackFunctionality()
    var URL;
    var i ;
    var QryStrValue;
    URL=window.location.href ;
    i=URL.indexOf("?");
    QryStrValue=URL.substring(i+1);
    if (QryStrValue!='X')
    window.location=URL + "?X";
    </script>
    Please let me know the result as soon as possible. Its my very urgent.
    Thanking Yu,
    Muthu Kumar.R

    No.
    Mylenium

  • Uploading Large videos Files to SharePoint 2010

    Uploading Large video  Files to SharePoint 2010  for employee training portal
    Saidireddy

    Hello ,
    The default maximum file size for SharePoint Lib is 50 MB. You can change the maximum file upload size in SharePoint 2010 .However;
    a large volume of very large files can affect farm performance.
    Ref to change maximum file upload size 
    http://aryannava.com/2011/05/30/how-to-change-the-maximum-file-upload-size-in-sharepoint-2010/
    I would suggest you that instead of uploading large files to SharePoint, you can Upload those files to File server or
    media steaming server and Share those links to SharePoint server.
    You can embed those links to SharePoint Silver Media player in .mp4 or .wmv formats. 
    Best Regards Kuldeep Verma
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it
    was useful.

  • Work around to display large .txt files in Nanos?

    I'd like to read a large .txt file on a Nano...breaking the .txt file into 4k increments isn't feasible.
    Anyone know how to display a large .txt file on a Nano's screen -- from the Notes folder, or, elsewhere?
    Thanks!

    Hmmmm. Not so sure about that one.
    Actually, it might be worth checking through the iPod + iTunesdownloads page to see if there are any useful widgets and whatnot for that there. (There's a few notes-related items showing up there too, which might work better than my suggestions about performing unnatural acts with your lyrics tags.)
    http://www.apple.com/downloads/macosx/ipod_itunes/

  • 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.

  • How to retrieve IndividualStrings from a txt file using String Tokenizer.

    hello can any one help me to retrieve the individual strings from a txt file using string tokenizer or some thing like that.
    the data in my txt file looks like this way.
    Data1;
    abc; cder; efu; frg;
    abc1; cder2; efu3; frg4;
    Data2
    sdfabc; sdfcder; hvhefu; fgfrg;
    uhfhabc; gffjcder; yugefu; hhfufrg;
    Data3
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    i need to read the data as an individual strings and i need to pass those values to diffarent labels,the dat in Data3 i have to read those values and add to an table datamodel as 6 columns and rows depends on the data.
    i try to retrieve data using buffered reader and inputstream reader,but only the way i am retrieving data as an big string of entire line ,i tried with stringtokenizer but some how i was failed to retrive the data in a way i want,any help would be appreciated.
    Regards,

    Hmmm... looks like the file format isn't even very consistent... why the semicolon after Data1 but not after Data2 or Data3??
    Your algorithm is reading character-by-character, and most of the time it's easier to let a StringTokenizer or StreamTokenizer do the work of lexical analysis and let you focus on the parsing.
    I am also going to assume your format is very rigid. E.g. section Data1 will ALWAYS come before section Data2, which will come before section Data3, etc... and you might even make the assumption there can never be a Data4, 5, 6, etc... (this is why its nice to have some exact specification, like a grammar, so you know exactly what is and is not allowed.) I will also assume that the section names will always be the same, namely "DataX" where X is a decimal digit.
    I tend to like to use StreamTokenizer for this sort of thing, but the additional power and flexibility it gives comes at the price of a steeper learning curve (and it's a little buggy too). So I will ignore this class and focus on StringTokenizer.
    I would suggest something like this general framework:
    //make a BufferedReader up here...
    do
      String line = myBufferedReader.readLine();
      if (line!=null && line.trim().length()>0)
        line = line.trim();
        //do some processing on the line
    while (line!=null);So what processing to do inside the if statement?
    Well, you can recognize the DataX lines easily enough - just do something like a line.startsWith("Data") and check that the last char is a digit... you can even ignore the digit if you know the sections come in a certain order (simplifying assumptions can simplify the code).
    Once you figure out which section you're in, you can parse the succeeding lines appropriately. You might instantiate a StringTokenizer, i.e. StringTokenizer strtok = new StringTokenizer(line, ";, "); and then read out the tokens into some Collection, based on the section #. E.g.
    strtok = new StringTokenizer(line, ";, ");
    if (sectionNo==0)
      //read the tokens into the Labels1 collection
    else if (sectionNo==1)
      //read the tokens into the Labels2 collection
    else //sectionNo must be 2
      //create a new line in your table model and populate it with the token values...
    }I don't think the delimiters are necessary if you are using end-of-line's as delimiters (which is implicit in the fact that you are reading the text out line-by-line). So the original file format you listed looks fine (except you might want to get rid of that rogue semicolon).
    Good luck.

  • How to upload an excel file using ABAP.

    Hi,
    Can anyone please help me in understanding how to upload an excel file using ABAP.
    Thanks!!

    http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table/
    check the link
    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&#8242;
    i_begin_row             = ‘2&#8242;  “Do not require headings
    i_end_col               = ‘14&#8242;
    i_end_row               = ‘31&#8242;
    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&#8242;.                              “First name
    wa_record-name1 = itab-value.
    when ‘0002&#8242;.                              “Surname
    wa_record-name2 = itab-value.
    when ‘0003&#8242;.                              “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.

  • How do i search for a string in a txt file using java??

    How do i search for a string in a txt file using java??
    could you please help thanks
    J

    Regular expressinos work just fine, especially when
    searching for patterns. But they seem to be impying
    it's a specific group of characters they're looking
    for, and indexOf() is much faster than a regex.If he's reading from a file, the I/O time will likely swamp any performance hit that regex introduces. I think contains() (or indexOf() if he's not on 5.0 yet) is preferable to regex just because it's simpler. (And in the case of contains(), the name makes for a very clear, direct mapping between your intent and the code that realizes it.)

  • Replace the text numbers string in a txt file using C++.. Help Me..

    Read a Document and replace the text numbers in a txt file using c++..
    For ex: 
    Before Document: 
    hai hello my daily salary is two thousand and five and your salary is five billion. my age is 
    twenty-five. 
    After Document: 
    hai hello my daily salary is # and your salary is #. my age is #. 
    All the text numbers and i put the # symbol.. 
    I am trying this code: 
    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;
    ifstream myfile_in ("input.txt");
    ofstream myfile_out ("output.txt");
    string line;
    void find_and_replace( string &source, string find, string replace ) {
    size_t j;
    for ( ; (j = source.find( find )) != string::npos ; ) {
    source.replace( j, find.length(), replace );
    myfile_out << source <<endl;
    cout << source << endl;
    int main () {
    if (myfile_in.is_open())
    int i = 0,j;
    //string strcomma ;
    // string strspace ;
    while (! myfile_in.eof() )
    getline (myfile_in,line);
    string strcomma= "two";
    string strspace = "#";
    find_and_replace( line , strcomma , strspace );
    i++;
    myfile_in.close();
    else cout << "Unable to open file(s) ";
    system("PAUSE");
    return 0;
    Please help me.. Give me the correct code..

    Open the file as a RandomAccessFile. Check its length. Declare a byte array as big as its length and do a single read to get the file into RAM.
    Is this a simple text file (bytes)? No problem. If it's really 16-bit chars, use java.nio to first wrap the byte array as a ByteBuffer and then view the ByteBuffer as a CharBuffer.
    Then you're ready for search/replace. Do it as you would in any other language. Be sure to use System.arraycopy() to shove your bytes right (replace bigger than search) or left (replace smaller than search).
    When done, a single write() to the RandomAccessFile will put it all back. As you search/replace, keep track of size. If the final file is smaller than the original, use a setLength() to the new size to avoid extraneous data at the end.

  • How to upload a image file using JSP

    hello to all.
    i am in the learning stage please help me to upload a image file
    using jsp. give the explanation to the code also if possible.
    thanks in advance
    sincerely
    Chezhian

    You may find the following articles useful for the JSP/Servlet part:
    Uploading files: http://balusc.blogspot.com/2007/11/multipartfilter.html
    Downloading files: http://balusc.blogspot.com/2007/07/fileservlet.html

  • Minimum version required to upload and download files using Netweaver Gateway

    What is the minimum service pack required to use the feature of Upload and download files using netweaver gateway. I already have a SP05

    Hi,
    as per this blog How to Read Photo from SAP system using SAP Gateway this should be possible with SP05.
    also refer How To Upload and Download Files Using SAP NW Gateway SP06
    Regards,
    Chandra

Maybe you are looking for

  • Reset form to null values...except readonly fields.

    I need the ability to set all of my checkboxes to a state where they are not Checked...and my dropdowns to a value of zero....and non-readonly text boxes to null string. However, I have several text boxes with information I want to retain. They are s

  • ASA 5505 L2TP client connect problem

    I am trying to connect MS l2tp clients to asa 5505 and am unsuccessful. I have tried the ASDM VPN Wizard as well as CLI and missing something. I have attached my current config. My client hits the interface and logs an error 713048 Error processing p

  • Sharing two computers on the same network

    I have a mac mini and a mac air and wish to synch/share the entire Itunes with each other.  I have turned on home sharing but do not see the devices listed with each other.  They are both on the same network and can be seen by apple tv.

  • Limit to Number of Connections in an AIR Application?

    Is there a limit to the number of simultaneous connections in an AIR application?  I use URLLoader to make connections to a server.  If more than 2 connections are opened the rest get "Error #2032: Stream Error.".  Where is the limit and how do I cha

  • Missing Download Due to iTunes Crash

    I purchased Jimmy Eat World's album "Futures", and in the middle of the download iTunes crashed and I was forced to restart my computer. Upon resuming the download, I realized one song was missing. Track #7 "Drugs or Me", is neither in my iTunes libr