Upload function

Hi,
in ecc6 when i call upload function then a system message appears that "upload function is obselete-do not use". what should i use?
Thanks.

hi,
CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename                      =  'D:\FILEINTERFACE\file.txt'
*    FILETYPE                      = 'ASC'
     has_field_separator           = 'X'  " Use this flag if you have tabbed delimited file
*    HEADER_LENGTH                 = 0
*    READ_BY_LINE                  = 'X'
*    DAT_MODE                      = ' '
*    CODEPAGE                      = ' '
*    IGNORE_CERR                   = ABAP_TRUE
*    REPLACEMENT                   = '#'
*  IMPORTING
*    FILELENGTH                    =
*    HEADER                        =
    TABLES
      data_tab                      = t_kna1  " Internal table with similar structure of file
*  EXCEPTIONS
*    FILE_OPEN_ERROR               = 1
*    FILE_READ_ERROR               = 2
*    NO_BATCH                      = 3
*    GUI_REFUSE_FILETRANSFER       = 4
*    INVALID_TYPE                  = 5
*    NO_AUTHORITY                  = 6
*    UNKNOWN_ERROR                 = 7
*    BAD_DATA_FORMAT               = 8
*    HEADER_NOT_ALLOWED            = 9
*    SEPARATOR_NOT_ALLOWED         = 10
*    HEADER_TOO_LONG               = 11
*    UNKNOWN_DP_ERROR              = 12
*    ACCESS_DENIED                 = 13
*    DP_OUT_OF_MEMORY              = 14
*    DISK_FULL                     = 15
*    DP_TIMEOUT                    = 16
*    OTHERS                        = 17
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
Thanks
Sharath

Similar Messages

  • GUI_DOWNLOAD and UPLOAD Function Modules?

    Hi All,
    What exactly done by GUI_DOWNLOAD and UPLOAD Function Modules?
    Akshitha.

    What you exactly want know?
    Here is the Sap documentation for both FM:
    FU GUI_UPLOAD
    Short Text
    Upload for Data Provider
    Functionality
    The module loads a file from the PC to the server. Data can be transferred binarily or as text. Numbers and date fields can be interpreted according to the user settings.
    Example
    Binary upload: No conversion or interpretation
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.
    Text upload
               begin of itab,
                     text(255) type c,
               end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype = 'ASC'
                  filename = 'C:\DOWNLOAD.TXT'
               tables
                 data_tab = itab.
    Parameters
    FILENAME
    FILETYPE
    HAS_FIELD_SEPARATOR
    HEADER_LENGTH
    READ_BY_LINE
    DAT_MODE
    CODEPAGE
    IGNORE_CERR
    REPLACEMENT
    CHECK_BOM
    VIRUS_SCAN_PROFILE
    NO_AUTH_CHECK
    FILELENGTH
    HEADER
    DATA_TAB
    Exceptions
    FILE_OPEN_ERROR
    FILE_READ_ERROR
    NO_BATCH
    GUI_REFUSE_FILETRANSFER
    INVALID_TYPE
    NO_AUTHORITY
    UNKNOWN_ERROR
    BAD_DATA_FORMAT
    HEADER_NOT_ALLOWED
    SEPARATOR_NOT_ALLOWED
    HEADER_TOO_LONG
    UNKNOWN_DP_ERROR
    ACCESS_DENIED
    DP_OUT_OF_MEMORY
    DISK_FULL
    DP_TIMEOUT
    Function Group
    SFES
    FU GUI_DOWNLOAD
    Short Text
    Download an Internal Table to the PC
    Functionality
    Data transfer of an internal table form the server to a file on the PC. The Gui_Download module replaces the obsolete modules Ws_Download and Download. The file dialog of the download module is available in the class Cl_Gui_Frontend_Services.
    Further information
    TYPE-POOLS: ABAP.
    Binary download table
    DATA: BEGIN OF line_bin,
             data(1024) TYPE X,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    Ascii download table
    DATA: BEGIN OF line_asc,
             text(1024) TYPE C,
          END OF line_asc.
    DATA: data_tab_asc LIKE STANDARD TABLE OF line_asc.
    DAT download table
    DATA: BEGIN OF line_dat,
             Packed   TYPE P,
             Text(10) TYPE C,
             Number   TYPE I,
             Date     TYPE D,
             Time     TYPE T,
             Float    TYPE F,
             Hex(3)   TYPE X,
             String   TYPE String,
          END OF line_dat.
    DATA: data_tab_dat LIKE STANDARD TABLE OF line_dat.
    Get filename
    DATA: fullpath      TYPE String,
          filename      TYPE String,
          path          TYPE String,
          user_action   TYPE I,
          encoding      TYPE ABAP_ENCODING.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
       EXPORTING
         WINDOW_TITLE         = 'Gui_Download Demo'
         WITH_ENCODING        = 'X'
         INITIAL_DIRECTORY    = 'C:\'
      CHANGING
         FILENAME             = filename
         PATH                 = path
         FULLPATH             = fullpath
         USER_ACTION          = user_action
         FILE_ENCODING        = encoding
      EXCEPTIONS
         CNTL_ERROR           = 1
         ERROR_NO_GUI         = 2
         NOT_SUPPORTED_BY_GUI = 3
         others               = 4.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    IF user_action <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
      EXIT.
    ENDIF.
    Download variables
    DATA: length TYPE I.
    Binary download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'BIN'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_bin
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                         = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                     = 4
         NO_AUTHORITY                     = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                        = 17
         DP_TIMEOUT                       = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                           = 22.
    Ascii download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'ASC'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_asc
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                         = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                     = 4
         NO_AUTHORITY                     = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                        = 17
         DP_TIMEOUT                       = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                           = 22.
    DAT download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'DAT'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_dat
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                         = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                     = 4
         NO_AUTHORITY                     = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                        = 17
         DP_TIMEOUT                       = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                           = 22.
    Parameters
    BIN_FILESIZE
    FILENAME
    FILETYPE
    APPEND
    WRITE_FIELD_SEPARATOR
    HEADER
    TRUNC_TRAILING_BLANKS
    WRITE_LF
    COL_SELECT
    COL_SELECT_MASK
    DAT_MODE
    CONFIRM_OVERWRITE
    NO_AUTH_CHECK
    CODEPAGE
    IGNORE_CERR
    REPLACEMENT
    WRITE_BOM
    TRUNC_TRAILING_BLANKS_EOL
    WK1_N_FORMAT
    WK1_N_SIZE
    WK1_T_FORMAT
    WK1_T_SIZE
    WRITE_EOL
    FILELENGTH
    DATA_TAB
    FIELDNAMES
    Exceptions
    FILE_WRITE_ERROR
    NO_BATCH
    GUI_REFUSE_FILETRANSFER
    INVALID_TYPE
    NO_AUTHORITY
    UNKNOWN_ERROR
    HEADER_NOT_ALLOWED
    SEPARATOR_NOT_ALLOWED
    FILESIZE_NOT_ALLOWED
    HEADER_TOO_LONG
    DP_ERROR_CREATE
    DP_ERROR_SEND
    DP_ERROR_WRITE
    UNKNOWN_DP_ERROR
    ACCESS_DENIED
    DP_OUT_OF_MEMORY
    DISK_FULL
    DP_TIMEOUT
    FILE_NOT_FOUND
    DATAPROVIDER_EXCEPTION
    CONTROL_FLUSH_ERROR
    Function Group
    SFES

  • Every time I try to upload a video to youtube (or pictures to blog services like tumblr) using Firefox, I cannot upload them unless I use the "basic uploader" function. Why and what can be done?

    Every time I try to upload a video to youtube or a pictures to a blog service, such as tumblr, I am unable to do so with the default uploading options (usually something that allows multiple uploads, etc). Instead, I can upload these media using their "basic upload" functions. Why and what can be done?
    == URL of affected sites ==
    http://www.youtube.com; http://www.tumblr.com

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Java-Based Upload Function No Longer Works After KB3021952 is Installed

    Hi there,
    Kindly note that my organization has just deployed the February 2015 Microsoft Security Patches including KB3021952. At the same time we have a Java web-based application that works fine before the February patches were deployed to all users. Upon deployment,
    the upload function for the application started to fail, causing IE to crash (as shown below):
    Event ID 1000 error was logged under Application logs (as specified below):
          Faulting application name: iexplore.exe, version: 11.0.9600.17631, time stamp: 0x54b31a70
          Faulting module name: MSVCR100.dll, version: 10.0.40219.325, time stamp: 0x4df2be1e
          Exception code: 0xc0000417
          Fault offset: 0x0008af3e
          Faulting process id: 0x1728
          Faulting application start time: 0x01d0518d4085f6ae
          Faulting application path: C:\Program Files\Internet Explorer\iexplore.exe
          Faulting module path: C:\Windows\system32\MSVCR100.dll
          Report Id: 9bdee31e-bd80-11e4-95c2-005056c00008
    If I debugged the IE error using Visual Studio 2013 (loading symbols from Microsoft Symbol Servers option is enabled), the process will stuck at the following notification message:
    I suspect that this error might be related to the new iexplore.exe file which being deployed together with KB3021952.
    Another official case will be logged to the vendor of the Java web-based application. Just wanted to know if anybody else experienced the same issue upon the deployment of KB3021952. Additional information on my environment can be specified
    as follow:
          Operating System: Windows 7 Ultimate and Enterprise
          Java Version: Version 7 Update 75
          IE Browser Version: Internet Explorer 9 and 11 (same issues detected on both versions).
    Thanks and regards,
    Syidie77

    Hi,
    According to your description, it's hard to judge this update caused jave problem, you can try to uninstall the update package for test if this is Windows update problem.
    On the other hand, according to the event log, IE crash seems like caused by MSVCR100.dll which refers to Microsoft Visual C++ 2010 SP1 Redistributable Package. Please access to the link below to downlaod and reinstall it for test:
    32Bit: Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)
    http://www.microsoft.com/de-de/download/details.aspx?id=8328
    64Bit: Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
    http://www.microsoft.com/en-us/download/details.aspx?id=13523
    Roger Lu
    TechNet Community Support

  • SRM 4.0 - Upload function of Bid Invitations (Bidding Engine)

    Hello,
    I am currently working on the Bidding Engine in SRM 4.0
    I would very much like to use the Download/Upload function in Bid Invitations, but for now I have the feeling it doesn’t work.
    I tested it by downloading a Bid Invitation and changing just one info like an item quantity or description. I put “U” (for “Update”) in the corresponding cell of the “Change” column. I also held the bid invitation in SRM before returning to it to upload the modified Excel-file.
    When I upload the Excel file, I don’t have any error messages, but no changes are done either.
    Does anyone of you have an idea how I could make it work?
    Thanks!
    Andrea

    Hi,
    Please do the following things.
    Excel updown/download is very flexible functionality.
    (BADI : BBP_PD_DOWNLOAD)
    1. You can change the format (how the document should be downloaded, which fields : Control variants in BBPC_UP_DOWNLOAD table)
    2. You can also upload file (your own format : implement parsing method)
    3. You can add your own fields. (APPEND_UPLOAD_DATA)
    We are working on one such scenario for Contract Upload.
    You can also check the following notes.
    There is a SAP Note on downloading BID file.
    Note 734060 - SRM: Upload and download of documents using MS Excel
    They have given one example in this note.This is a consulting note,you will find it
    Two more notes which can help you
    734060
    734946
    I hope it will help.
    BR,
    Vijay Mittal
    Plz award the points for help.

  • Trial Balance Upload function

    Dear Friends,
    We have developed customized Trial Balance upload function.
    While uploading we are Debit all the TB item which are debit and credit the GL A/c. 9999999901 and same we are credit the all the TB items and debit GL a/c 9999999901 which results GL A/c 9999999901 is become the 0 (Zero).
    After completing upload function we can view entry using T Code u2018FB03u2019 to verify the JV.
    Can anyone please guide me how to extract the Trial balance and is there any other way to kin the opening trial balance manually.
    And also which Item from TB I need to take care while uploading the TB as per my seniors they can help me to take care of e.g. Sundry Creditor, Debtors and Cash in Hand and also any subledgers.
    Thanks in advance.
    Mahendra Dev

    For TB (GL Balances):
    S_PL0_86000030 - G/L Account Balances (New)
    S_ALR_87012277 - G/L Account Balances
    Vendor TB: S_ALR_87012082 - Vendor Balances in Local Currency
    Customer TB: S_ALR_87012172 - Customer Balances in Local Currency

  • Authorization issue with upload functionality

    Hi,
    I have issue with authorization with upload functionality.
    we have country as authorization relavant field. if we are giving some country authorization to user it is giving authorization error at upload functionality.
    But if we give all country authorization than it is working fine.
    Could you guide me how to avoid this situation. We can not give all country authorization to all the users.
    Thanks,
    Naman Shah

    Hi Naman,
    For SAP BPS
    Here while defining a variable you can set the user authorization and can determine which all records can be seen by the user.
    For eg. Create a variable for country with replacement type User-specific values. Here you can assign values to a particular user id.
    Please check for more details:
    http://help.sap.com/saphelp_nw70/helpdata/EN/43/548bafbc0f357ee10000000a11466f/frameset.htm
    For SAP IP
    Please Check: User Authorization in SAP IP
    Regards, Rishi
    Edited by: Rishikesh Sinha on May 6, 2009 8:01 AM

  • Document upload functionality

    Hi,
    I want to know that whether the document upload functionality comes in standard SAP package OR this is a separate module which has to be purchased separately from SAP.
    Please also let me know the Tcodes used for uploading an accounting document from an excel file OR tab delimited file.
    Regards,
    Vijay

    If you are referring DMS then:
    SAP DMS - Document Management System
    http://www.sap-img.com/sap-dms.htm
    http://www.sap.com/solutions/business-suite/plm/pdf/BWP_Document_Management.pdf
    Pls assign points as way to say thanks

  • Content Exchange -- Package Upload function not work.

    I try to upload a zip file from my computer into the repository by using package upload function in portal. The file size export by ice is 1.09 GB is not work it has error The page cannot be displayed but small file size is work. How can i do?

    Hi folks,
    same problem here while trying to transport a large KM package (28GB à 2GB volumes) from EP 7.0 to EP 7.31 SP6. The package upload iView in my target system EP 7.31 crashs with "This page cannot be displayed". I cant find any appropriate exceptions in NWA.
    I guess ICE transport isnt an option at all for transporting KM content from 7.0 to 7.31 (http://scn.sap.com/thread/3249426), but i tryed it also, without any success, same behaviour. As i stringent need all metadata (ACL's for example), WebDAV is probably also not reasonable, as far i know you cant transport KM metadata with this method.
    Unfortunately Detlev`s link dont works, so i cant get any clues from there. I also tryed to split one KMC archive in volumes à 100MB, but it dont works, because the following volumes are not uploaded and i cant see any KM packages at all.
    So, i know i can create smaller KM packages manually, but regarding the data amount its extremly time-consuming. I cant imagine our colleagues from SAP AG are regarding the case of a KM import of large files as realistic, but dont give us a working option to import them. Does anybody have any idea how to handle this issue? Thank you in advance,
    best regards

  • How to Debug Upload Function (ZCL_RSPLF_FILE_UPLOAD)

    Hello,
    We have the standard Upload function customized to call a function module which eventually does some calculations. I need to modify the function module with extra logic. I cant test the FM directly as it doesn't have Test Frame.
    Am stuck at how to debug the Upload function. Is it possible through program RSPLS_PLSEQ_EXECUTE but then how do I create the variant. Cant create it through Modeler.
    Please suggest.
    Thanks and regards
    Gaurav

    Hi Gaurav,
    As per my understanding you are trying to debug the custom planning function created using SE24.Go to this transaction enter the function name and place the externa break point as suggested in interface you want to debug .
    OR go to rsplf1 - specify function and place external break point.
    You can get it triggered two ways.
    If you already have GPS- Planning sequence built ,directly execute it .It will take you in debug mode.
    You can also create new one if required for testing.
    or
    If you are using any layout to load data ,you can also trigger it from there.
    It will take you to debug mode only after you place external breakpoint.
    Do not put break point rgt after intialization....

  • Suggestion for future Match upgrade -- add a "force upload" function

    I've been using the Match service since it went GA, last month.   I have a lot of CD rips, but also some vinyl needledrops and different masterings (i.e. The Beatles in Mono) which the Match functionality really has trouble with.    In the case of the Beatles Mono, it might upload some tracks but "match" others.  So my Beatles album ends up becoming half mono / half stereo in iCloud.
    This is undestandable given the technology being used, but is still very frustrating. So my suggestion to Apple developers is to create an "force upload" function to their Cloud service, with the next Match revision.  This doesn't need to be enabled by default, but make part of the dropdown for a song or album to alow the user to use their specific local version, if the Match process doesn't work to their satisfaction.
    What do you think?  Good idea or waste of developer resources?   I've already called Apple support with this suggestion, but I'm assuming that they are hesitant as it might give users the ability to eat up a ton of storage space on Apple's end, if it's abused.

    The idea has merit, though a reluctance on Apple's part to implement, as you pointed out, might be argued based on additional server commitment. However, my guess is that as the matching process improves (crossing my fingers here), the storage requirement for the same number of users would go down, not up.  We read a lot more from people who want the songs to match for one reason or another than want the ability to eat up hours uploading.  I suppose Apple could put some hard limit on how much could be uploaded without the user paying more, if it really came to that.
    On another subject, while you've gone through pieces of it in other posts, I would like a chance to pick your brain regarding your Audacity workflow, i.e. turntable/cartridge used, phono stage/preamp, A/D converter - well the whole ball of wax.  I've learned what I know through reading and by applying what I learned in radio & TV studios eons ago, so I'm sure having a dialogue with an actual human who's had better success than I in getting vinyl to match would be very helpful.
    Because until I read some of your postings, I was under the assumption my limited success was better than what most were achieving, I detailed my process here. 
    https://discussions.apple.com/message/16838585#16838585

  • Help, what's wrong with my upload function

    Hi,
    I want to write a java Bean (FileUploadBean) to upload the image files. I use a very simple txt file to test my Bean code, I've already know the syntax of the entity body of httpServletRequest object, it's like below:
    "-----------------------------7d327203032e
    Content-Disposition: form-data; name="toefl_form"; filename="C:\transfer\Picasso_ljm\jakarta-tomcat-4.0.1\webapps\junmin\image\test.txt"
    Content-Type: text/plain
    hi, this is a test;
    -----------------------------7d327203032e--
    My original test.txt file is only a line without '\r', '\n'.
    "hi, this is a test."
    But after call my upload function, the saved file is:
    hi, this is a test.
    There are 4 more bytes than the original file. Below is my FileUploadBean file, does anyone can figure out what's wrong in my upload function? Does the readLine read the return carriage and new line charactor too? Thank you very much!
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.ServletInputStream;
    import java.util.Dictionary;
    import java.util.Hashtable;
    import java.io.PrintWriter;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.FileOutputStream;
    import java.io.IOException;
    public class FileUploadBean {
    private String savePath, saveFilename, filepath, filename, contentType;
    // private Dictionary fields;
    public String getFilename() {
    return filename;
    public String getFilepath() {
    return filepath;
    public void setSavePath(String savePath) {
    this.savePath = savePath;
    public void setSaveFilename(String saveFilename) {
    this.saveFilename = saveFilename;
    public String getContentType() {
    return contentType;
    private void setFilename(String s) {
    if (s==null)
    return;
    int pos = s.indexOf("filename=\"");
    if (pos != -1) {
    filepath = s.substring(pos+10, s.length()-1);
    // Windows browsers include the full path on the client
    // But Linux/Unix and Mac browsers only send the filename
    // test if this is from a Windows browser
    pos = filepath.lastIndexOf("\\");
    if (pos != -1)
    filename = filepath.substring(pos + 1);
    else
    filename = filepath;
    private void setContentType(String s) {
    if (s==null)
    return;
    int pos = s.indexOf(": ");
    if (pos != -1)
    contentType = s.substring(pos+2, s.length());
    public void doUpload(HttpServletRequest request) throws IOException {
    ServletInputStream in = request.getInputStream();
    // read boundary
    byte[] line = new byte[256];
    int i = in.readLine(line, 0, 256);
    if (i < 3)
    return;
    int boundaryLength = i - 2;
    String boundary = new String(line, 0, boundaryLength); //-2 discards the newline character
    String newLine = new String(line, 0, i);
    if (newLine.startsWith("Content-Disposition: form-data; name=\""))
    if (newLine.indexOf("filename=\"") != -1) {
    setFilename(new String(line, 0, i-2));
    if (filename==null)
    return;
    //this is the file content
    i = in.readLine(line, 0, 256);
    setContentType(new String(line, 0, i-2));
    // blank line
    i = in.readLine(line, 0, 256);
    // read the first byte of the file
    i = in.read();
    FileOutputStream fo = new FileOutputStream((savePath==null? "" : savePath) + saveFilename);
    while (i != -1) {
    // if this byte is equal to the first byte of the boundary, then first mark this place, and
    // go ahead to check if it encounter the ending boundary. If it belongs to the file, then reset
    // the read position and reread.
    if( (char)i == '\r') {
    in.mark(256);
    i = in.read();
    char c1 = (char)i;
    i = in.read();
    char c2 = (char)i;
    i = in.readLine(line, 0, 256);
    // if it is the end of request body, then close the OutputStream. Since the first byte is
    // read already, then the final boundary size if +3
    if ( (c1 == '\n') && (c2 == '-') && (i==boundaryLength+3) // + 3 is eof
    && (new String(line, 0, i).startsWith(boundary.substring(1)))) {
    i = in.read();
    else {
    // it is not the eof, then write this byte into the outputStream and reset the read position
    fo.write(i);
    in.reset();
    i = in.read();
    } // end if
    // else if (char)i != '-', then write directly to the fileOutputStream
    else {
    fo.write(i);
    i= in.read();
    } // end while
    // close the fileOutputStream
    fo.close();
    }// end function

    HI,
    I find a bug myself. I add a line "i = in.read(line, 0, 256);" in doUpload function in the following position:
    String boundary = new String(line, 0, boundaryLength); //-2 discards the newline character
    i = in.read(line, 0, 256);
    String newLine = new String(line, 0, i);
    But still, when I was trying to read a image file, it even didn't finish reading and quit already! Still has bugs, need help!
    Junmin

  • Gui upload Function module

    hi,
    when i upload a file using gui upload Function module , the dot in the excel sheet gets converted into 'e' . is there any other Function module i can use to do that .
    Thanks,
    Amit

    HI,
    You need to USe the FM <b>'ALSM_EXCEL_TO_INTERNAL_TABLE'</b>
    *& 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.
    See the Below wxamples to uploa the excel file
    http://www.sapdevelopment.co.uk/file/file_upexcel.htm
    http://www.sap-img.com/abap/upload-material-master-finish-goods.htm

  • Upload Functionality for creating Screens in SE51

    Hi Experts,
    I am working in 4.7
    I successfully downloaded the screen from 4.6 into a text file but when i went to 4.7; upload functionality is disabled.
    Is there any other way or  standard program available to create Screens in SE51 if we have downloaded files for the screen .>??
    Thanks in Advance,
    Harkamal

    Thanks for ur reply ARS..
    but in my case Upload is grayed out in case of this particular program even if I am creating a dummy screen
    My program already exist in SE38 in 4.7 and i have to copy screen from 4.6 . So I was looking for some simple tool like UPload /Download ..
    I dont know why Uplaod is inactive in case of this program
    Thanks,
    Harkamal

  • Batch Input Recording - GUI Upload Function

    Hello,
    i want to record a batch input.
    Within the recording a Gui Upload Function is called, so that the user have to select a file from the local disk, which should be uploaded into the system. That step wasn't recorded by the bach input recording.
    Is there any soluion for that?
    Regards,
    TomSd

    As Suhas said, these kind of UI dialogs cannot be handled by batch input technology.
    Sometimes transactions allow the batch input by displaying another kind of UI dialog that is allowed. Try to record using "simulate background mode", maybe the program will display another UI dialog. Make sure also to untick the "no BI mode" checkbox.
    But maybe this transaction isn't planned to be used in batch input at all (which transaction do you need to record?). In that case, the only solution is maybe eCATT (with external tool connected as I am aware).

Maybe you are looking for