UPLOAD and GUI_UPLOAD

Hi,
We have just upgraded to ERP2005 from 4.5B and would like to know how I can change the program from calling the function 'UPLOAD' to use 'GUI_UPLOAD'.
It seems that 'GUI_UPLOAD' doesn't prompt user for the file to be upload. Which function should I call so that the user will be prompt for selecting the file to be upload.
Many Thanks in advance
Francis

Hey Francis,
you can use the following logic so that the user will be prompt for selecting the file to be uploaded.
*& Report  ZKUN_FILE1                                                  *
REPORT  ZKUN_FILE1                              .
tables : zkunal1.
data : begin of itab1 occurs 0.
      include structure zkunal1.
data:       end of itab1.
data : begin of gv_itab occurs 0.
      include structure zkunal1.
data:       end of gv_itab.
*data : begin of gv_itab occurs 0,
       fname like zkunal1-fname,
       lname like zkunal1-lname,
       place like zkunal1-place,
      end of gv_itab.
data : gv_file type string.
*SELECTION SCREEN                                               *
SELECTION-SCREEN BEGIN OF  BLOCK b1 WITH FRAME TITLE text-001.
<b>PARAMETERS: p_file LIKE ibipparms-path obligatory.</b> " For file selection
SELECTION-SCREEN END OF BLOCK b1.
*AT SELECTION SCREEN                                            *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
<b>CALL FUNCTION 'F4_FILENAME'
EXPORTING
   PROGRAM_NAME        = SYST-CPROG
   DYNPRO_NUMBER       = SYST-DYNNR
  FIELD_NAME          = ' '
IMPORTING
   FILE_NAME           = p_file.</b>
*START OF SELECTION *                                            *
START-OF-SELECTION.
P_FILE is not compatible with the FM GUI_UPLOAD, so pass it to
GV_FILE.
  gv_file = p_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = gv_file
     FILETYPE                      = 'ASC'
     HAS_FIELD_SEPARATOR           = '#'
    HEADER_LENGTH                 = 0
    READ_BY_LINE                  = 'X'
    DAT_MODE                      = ' '
    CODEPAGE                      = ' '
    IGNORE_CERR                   = ABAP_TRUE
    REPLACEMENT                   = '#'
    CHECK_BOM                     = ' '
  IMPORTING
    FILELENGTH                    =
    HEADER                        =
    tables
      data_tab                      = gv_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
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
*FIELD-SYMBOLS: <fs_zco001> TYPE zco001.
select * from zkunal1 into table itab1. "#EC CI_NOWHERE
loop at gv_itab.
write : / gv_itab-fname, gv_itab-lname, gv_itab-place.
endloop.
Regards,
Kunal.
Message was edited by: Kunal Kumar

Similar Messages

  • What is ws_upload, upload and gui_upload?

    while i am doing recording sing fk01   in bdc when i am trying to upload .prn file one message is coming i.e. ws_upload is obsolete use gui_upload? then i used gui_upload but .prn file not uploading?why?

    Hi
    GUI_UPLOAD is the new fm has replaced the WS_UPLOAD, when u uses it u make sure the file is beeing loaded has to be closed in your pc.
    Anyway it's better u post the code where u call that fm.
    Max

  • Change from UPLOAD to GUI_UPLOAD  function module

    pls  let me know that  wat are  the  changes that should be made if  the report  currently using UPLOAD function module and it should be  replaced with GUI_UPLOAD  function module ..
    wat should be the TYPE of  file name and File type ????????  with the respect to changes ....
    thanks . in advance..

    Check out this thread to find the answer
    UPLOAD and GUI_UPLOAD
    Regards,
    Santosh

  • What is the difference  between ws_upload and gui_upload

    what is the difference  between ws_upload and gui_upload
    what is the difference  between ws_download and gui_down load
    pls tell  briefly

    Hi Kuamr,
    UPLOAD and DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. UPLOAD and DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
    The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
    Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • What's the difference between FM 'UPLOAD' and FM 'ALSM_EXCEL_TO_INTERNAL_T'

    What's the difference between FM 'UPLOAD' and FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    thanks!

    hi,
    Generally FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'  is used for reading Excel sheet i.e, either row wise or column wise . where as WS_UPLOAD will read the entire data in to an internal table in a file format.
    for illustration as how it is used check this out
    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.
    http://www.sapdevelopment.co.uk/file/file_upexcelalt2.htm
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        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 NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.
    http://www.sapdevelopment.co.uk/file/file_uptabpc.htm
    Regards,
    Santosh

  • Uploading and view an document in application server from abap

    Dear SDN users,
    I have a similar requirement:
    i need to upload a docuement into SAP  under a particular system generated unique No.
    My basis team has given a file path in application server.
    So i need to upload and view(Not Downloading) that uploaded document at any time in future.
    Note : Each System generated no is having different documents.
    Thanks in advance.
    Regards
    RAJ
    Moderator Message: Do not dump your requirement. Get back to the forums in case you've any specific issues.
    Edited by: Suhas Saha on Jan 14, 2012 3:50 PM

    Dear Prakash,
    As i Said  i have to  upload and Just view the documents.
    its an urgent requirement.
    i want to upload multiple documents and i have to raed with file name.
    Note : currently it is downloading only last uploaded one.
    following is the code:
    DATA: V_DSN(40) VALUE '\usr\reports\fico\',
          V_STR(1673) TYPE C.
    FORM UPLOAD .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = L_FNAME
    FILETYPE = 'BIN'
    IMPORTING
    FILELENGTH = LENGTH
    TABLES
    DATA_TAB = ITAB.
      OPEN DATASET V_DSN FOR OUTPUT IN BINARY MODE..
      LOOP AT ITAB INTO V_STR.
        TRANSFER V_STR TO V_DSN LENGTH 1673.
      ENDLOOP.
      CLOSE DATASET V_DSN.
      IF SY-SUBRC EQ 0.
    MESSAGE S001(ZSD) WITH 'Sucess'.
      ENDIF.
    EndForm.
    FORM DOWMLOAD .
    CLEAR WA_DEMO.
    OPEN DATASET V_DSN FOR INPUT IN BINARY MODE.
    DO.
    READ DATASET V_DSN INTO ITAB-FIELD MAXIMUM LENGTH 1673.
    IF SY-SUBRC = 0.
    APPEND ITAB.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = DWN_FILE
    FILETYPE = 'BIN'
    BIN_FILESIZE = LENGTH
    IMPORTING
    FILELENGTH = LENGTHN
    TABLES
    DATA_TAB = ITAB.
    endform
    Regards
    MNR
    Edited by: mnr4sap on Jan 14, 2012 1:54 PM

  • Class to upload and download images

    is there any class which we can use to upload and download images
    only 1 restrain while downloadin it should NOT ask where to download
      it should directly go to desktop.
         please help
    Edited by: Amit Sawant on Dec 20, 2007 10:45 AM

    You have to call the Static methods of the Class: Cl_GUI_FRONTEND_SERVICES.
    for UPLOAD:
    call Method Cl_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    for DOWNLOAD:
    call Method Cl_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
    You can open this Class Cl_GUI_FRONTEND_SERVICES in Class builder SE24 and find these methods
    Also refer to these links:
    cl_gui_frontend_services
    CL_GUI_FRONTEND_SERVICES
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
    Reward points if found helpful...
    Cheers,
    Chandra Sekhar.

  • Function module upload and download

    Hello All,
    while using Upload and download function modules, how to avoid popup for providing file path, as am already passing it from reading from the selections screen. while running again i dont want to get the popup asking file path.
    thx in advance,
    sippy.

    Hi,
    You can try with
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
        EXPORTING
          FILENAME        = I_DIR
          READ_BY_LINE    = 'X'     " FILETYPE = 'ASC'
        CHANGING
          DATA_TAB        = IT_TEXTO
        EXCEPTIONS
          FILE_OPEN_ERROR = 1
          FILE_READ_ERROR = 2
          BAD_DATA_FORMAT = 8
          OTHERS          = 19.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
      EXPORTING
       BIN_FILESIZE              =
        FILENAME                  = I_DIR2
       FILETYPE                  = 'ASC'
       APPEND                    = SPACE
       WRITE_FIELD_SEPARATOR     = SPACE
       HEADER                    = '00'
       TRUNC_TRAILING_BLANKS     = SPACE
      CHANGING
        DATA_TAB                  = IT_TEXTO.
    Best Regards
    Ana

  • Gui Upload and Line Feed within a CSV cell from Excel

    Hi all,
    I am facing the problem that my CSV file to be uploaded via GUI_UPLOAD is containing cells where the Excel user has split the line within the cell. So there are CRLF at the end of the CSV row and single LF within a cell between the field separators.
    GUI_UPLOAD is not making a difference and splits the line within the cell.
    Is there any solution for this?
    Thanks in advance for hints.
    Axel

    Hi Axel,
    I didn't know that it was considering CRLF and LF the same way. A workaround is to do the job yourself: call GUI_UPLOAD using BIN format (you'll get the characters as bytes), get the frontend encoding (cl_gui_frontend_services=>GET_SAPLOGON_ENCODING), then convert the bytes into characters using CL_ABAP_CONV_IN_CE class (see documentation), and split (statement SPLIT AT) the characters at cl_abap_char_utilities=>cr_lf to get each line, then split each line at cl_abap_char_utilities=>horizontal_tab.
    BR
    Sandra

  • What is the difference between UPLOAD and WS_UPLOAD?

    Hi,
    What is the difference between UPLOAD and WS_UPLOAD?
    Best Regards,
    Gopal

    Hi,
    Both upload and ws_upload does the same functionality, that is transfere data from presentation server to application server or from PC to SAP system(to an internal table).
    There are very few difference between the two.
    1 Upload requires a User Interaction for uploading i.e., user has to respond to the dialog boxes that appear WS_Upload does not. You just need to specify the file location in the function input parameters itself.
    2 upload - u can give the file in run time wsupload - u have to give in Function module
    3 upload is meant to be used by abappers. ws_upload is meant to be called by SAP. It is not a standard ABAP command.
    4 ws_upload is Obsolete : No longer supported by SAP. Use GUI_UPLOAD instead.
    The fm WS_UPLOAD was the first version of fm to get a file from presentation server, now from 4.6 it's obsolete, the new fm is GUI_UPLOAD.
    The fm UPLOAD is the fm used in several applications, like ABAP editor, to upload the file.
    In the some versions (it depends on patch level) UPLOAD can call WS_UPLOAD (or GUI_UPLOAD).
    Last but not the least, 'upload' internally calls 'ws_upload', that's the difference.
    Hope this would be helpful.
    regards,
    Varun.

  • Hi Guys,  I am using the full width video widget on a site. The widget was working perfectly however I have just added additional content to the site and re-uploaded and now the video is not working! Please help I have tried everything and am freaking out

    Hi Guys,
    I am using the full width video widget on a site. The widget was working perfectly however I have just added additional content to the site and re-uploaded and now the video is not working! Please help I have tried everything and am freaking out as this web-site has been payed for by my client.
    Alex

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • WS_UPLOAD,WS_DOWNLOAD and GUI_UPLOAD,GUI_DOWNLOAD.

    Hi,
    Any one Explain difference between WS_UPLOAD,WS_DOWNLOAD and GUI_UPLOAD,GUI_DOWNLOAD.
    Regards,
    Maya

    hi maya,
       ws_upload and gui_upload, will do the same funtionality.
    ws_download and gui_download will do the same functionality.
    but ws* are obsolete.
    Regards....
    Arun.
    Reward points if useful.

  • How do I alter the html in the simple form contact us so it will upload and function on Bluhost?

    All representatives are actively assisting other customers. Your estimated wait time is 7 minute(s) and 0 second(s) or longer. Thank you for your patience.
    All representatives are actively assisting other customers. Your estimated wait time is 6 minute(s) and 30 second(s) or longer. Thank you for your patience.
    All representatives are actively assisting other customers. Your estimated wait time is 6 minute(s) and 30 second(s) or longer. Thank you for your patience.
    All representatives are actively assisting other customers. Your estimated wait time is 7 minute(s) and 0 second(s) or longer. Thank you for your patience.
    All representatives are actively assisting other customers. Your estimated wait time is 6 minute(s) and 30 second(s) or longer. Thank you for your patience.
    All representatives are actively assisting other customers. Your estimated wait time is 6 minute(s) and 30 second(s) or longer. Thank you for your patience.
    All representatives are actively assisting other customers. Your estimated wait time is 6 minute(s) and 0 second(s) or longer. Thank you for your patience.
    You are now chatting with 'Parikshit'
    Parikshit: Hello K.
    Parikshit: I read your issue description.
    Parikshit: The form doesn't upload there. Does the form work fine when you test it on your computer by previewing in browser from Muse?
    k: hello I am examining my page in developer ( source) in safari and I can see lines of tesst that say the server encountered and error.
    k: If I export to my desktop, I can see the form but it does not work. If I upload it does not appear at all, and that is in not what adobe says the form will do. Adobe says the form will APPEAR but not function. It does not appear OR function. I had tried the 3 versions of php.... now I need to see a working form to a usual, commercial host so that I can copy the relevant code.
    k: lines of text
    k: And no, it does not work when I preview in browser
    k: When I preview to browser it does turn red for a while.... but it doesn't do anything.
    Parikshit: Can you publish the site in BC one to check if it works, if it doesn't then there must be some issue with the form itself. It's code.
    k: no. I do not have a subscription and my client does not want BC used at all. I have the new CC muse which is supposed to finally work without having to upload to BC.
    k: I have several cloud subscriptions, when cloud ever starts to work....
    Parikshit: You don't need to work in BC or have it as your host. This is just to test if it works.
    Parikshit: Just a trial site.
    k: but my client refuses to have anythig to do with BC, and I don't blame them. They had bad experiences inthe past and do not want to do anything that involves BC.
    Parikshit: You won't have to pay for the site.
    k: I don't want to involve BC because I promised my client I would not go there. They were very insistant. We were finally going to use Muse because you no longer are required to use BC. BC was the big sticking point. But if I can't do this without using BC, then I am right back to where I was year ago. No better.
    k: I think I have a limited number of occasions when i can use BC, and I don't want to do it now for this simple contact form. What a cheat.
    k: What other functions in Adobe Muse CC won't work unless they are euphemistically " tested" on BC? Save me the time and dissappointment tryig to use this software.
    k: Adobe states that the form will appear when uploaded to a outside site, but not work. The form does not upload, and the form does not appear. I tried version 5.2,5.3, 5.4 and then put php back to version 5.3.
    Parikshit: There is nothing wrong with it. Did you change the code of the form?
    k: no. And there is plenty wrong with it, it does not appear. I did not change the code because I want to look at a sample that has been altered to make sure I alter it the correct way. Where can I find the page source of a page that has the simple contact form widget used and uploaded to a commercial hosting site, and the forem works.
    k: form works
    k: This was a bug that was described last year and the release of this version advertised it had been corrected. It is not corrected.
    Parikshit: It is corrected and several users are able to use it fine.
    k: Then send me a page from one of the ones that is working fine.
    k: who are those several users? Give me names.
    Parikshit: there is either something wrong on the host's end that this doesn't get uploaded. We've already had many users upload it to an external hosts. We don't keep user site URLs with us, and hence I won't be able to provide you with one. But the best method here would be to post this on our forums, and then all our forum members (including users who have successfully implemented this) will be able to see the post and reply to it.
    k: I've seen them all complaining that this still doesn't work. Perhaps you should encourage some of the successful uploaders to post to the forum. Send me a link. I had numerous tech support people at the host check this and there was nothing wrong with their PHP or the upload path.
    Sorry, our chat session has ended due to circumstances beyond our control. Please feel free to contact us again if you need further assistance.

    Can you supply a link?

  • How do I upload and attach the file to Service Request

    [This thread was migrated from the On Demand Developer Forum in the old Siebel Community]
    drangineni
    New Contributor
    Hi,
    I am trying to upload a file and add it to a Service object as an
    attachement. I greatly appreciate if you could provide any code or
    sample...
    Thanks.
    Daya
    Product: CRM OnDemand
    10-21-2006 10:58 AM
    Re: How do I upload and attach the file to Service Request...
    BigSlick
    Valued Contributor
    On Demand doesn't support adding attachments via web services. One
    solution I've seen is depending on the scenario is to create a web link
    field on an object that's based on a custom text field. Your web service
    can populate that custom field and the web link can generate a dynamic
    link to the file in On Demand's UI. However, this depends on where the
    attachment is located and if the user needs some sort of firewall access.
    Hope this helps
    -BigSlick
    10-23-2006 11:43 AM
    ==============================================================================
    Click on the board or message subject at the top to return.

    Yes this still holds ture.
    Bardo

  • Uploading and downloading files from a web app (Urgent!!)

    Hi everyone:
    I'm developing an application in PL/SQL to upload and download files from an HTML webpage. I congured the document table and the parameters necessary in the DAD of my application.
    when I upload the file using my webpage that file info is automatically uploaded to the doc table. This is as far as I have gotten.
    I need to do the following:
    - Place the uploaded file into a column in another table in my database as part of a text message (think of it as an email message), and delete the file from the doc table (as this is thought to be a temp table that holds the file when uploaded from my webpage)
    - Retreive the file so that it can be downloaded from another web page.
    The file can be a PDF, WORD DOC, etc...
    I now that I can do this with InterMedia but I haven't figured out how :(
    Can anyone please point me to an example or some documentation that can guide me through the process.
    DB VERSION: 8.1.7
    IAS VERSION: 1.0.2.2
    Thanks,
    Carlos Abarca

    The idea was for you to look at the code and get an idea of how to access the BLOB in the document table. IF you look at the procedure
    insert_new_photo( new_description IN VARCHAR2,
    new_location IN VARCHAR,
    new_photo IN VARCHAR2 )
    It shows how to access the blob that is stored in the document table. You can then copy this blob to your own table using the DBMS_LOB package.
    Hope this helps,
    Larry

Maybe you are looking for

  • How does Wireless printing from ipad work?

    How can I print wirelessly from ipad? I have a wireless printer but the ipad does not pick it up.

  • Preloader for Feedrequest()

    New to Flex but could not find solution to this after searching for a few hours - both here and on the web. My flex app sends a feed request for dynamically created XML based on a passed in user var - While this is happening, I want to show a "Loadin

  • Trying to install update to iphoto

    I am trying to install the latest iphoto update and when I try to install it it comes up saying that it can't be verified. I tried downloading it again but the same thing happened. Anyone know what to do?

  • Managing photos on the iPad

    I can't get the hang of managing photos on the iPad. I have 2,000 photos and the only choice I see is to delete all of them or keep them? What is the best way of managing the photos?

  • Need to choose/finalize CRM Certification.Plzzz help!!

    Dear All, I am planning to take CRM certification and I am a bit confused as to which submodule in CRM should I opt for. 1.     I have to choose 2 courses out of the following.Kindly guide me which of the following submodules is most sought-after and