BSP FIle upload

Hi,
I searched but could not find an answer...I am working on a program that itseems worked till the last few days...not sure why it stopped working suddenly. I was able to fix it now, but am wondering how to retrieve the old attachments uploaded using this app.
This BSP app is used to store documents.
Step-1:Simple BSP form upload. In the event handler, the cData is read using cl_http_entity->get_cdata. This is stored in a table as a string along with filename, file type etc.
Step-2: To download the document from Step-1, the string from Step-1 is converted to xstring using SCMS-STRING-TO-XSTRING and then the response is set using:
runtime->server->response->set_data( data = lxstringdata length = xstrtlen ).
This no longer works - it gives garbage data...
I converted it to read binary data while uploading (cl_http_entity->get_cdata) and it works fine now - but any idea on how I can read the files that have been created so far? I was told that it was working atleast a few days back..
Thanks in advance.
JH

Any help from the gurus?

Similar Messages

  • Using BAPI functions BSP file upload

    Hello,
    Can anyone clarify me  that ' can I upload a file form front end using BSP to the BP as backend to store e the image using the BAPI functions. All this is to get each BP photo in the Solution manager.
    or I have use  the datasets for the file upload. Please help me out.
    With best regards,
    Suneetha

    Hi,
    Uploading LOGO in SAP
    http://www.sap-img.com/ts001.htm
    Upload graphics on
    The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into individual standard text.
    <b>ws_upload</b>
    Transfer files from the frontend to the application server.
    Rgds,
    Prakash

  • File Upload in BSP Applications and store in Application server

    Hi we have requirement to store the attachments from BSP application into the external/internal storage space connected to application server.
    I search for weblogs and all talking about <a href="http://help.sap.com/saphelp_me21sp2/helpdata/en/eb/8c683c8de8a969e10000000a114084/content.htm">File Upload in BSP Applications and store in MIME Repository</a>.
    But our requirement is upload and store(no need to read the file content) attachments from BSP page into file server, and then make a link back in BSP page to open.
    I know we can handle documnets in R/3 using DMS, but our system is SRM.
    Please give a suggestion and solution.
    Thanks,
    Giri

    Hi,
    I faced a similar problem some time ago (uploading a file via BSP, storing it to the application server and then linking the archived document to a business object.
    Here is the coding I used:
    when 'SubmitUploadFile'. "OnInputProcessing
        DATA: data_fileupload TYPE REF TO CL_HTMLB_FILEUPLOAD,
              l_filename type string,
              l_archiv_doc_id type SAPB-SAPADOKID,
              l_content type string,
              l_file_ixos(100) type c value '/transfer/PV2/aus/IXOS/',
              l_file(200) type c,
              tbl_bin TYPE STANDARD TABLE OF tbl1024,
              wa_bin type TBL1024,
              l_xstring type xstring,
              l_arc_doc_id type SAPB-SAPADOKID,
              l_doctype type TOADD-DOC_TYPE,
              l_filename_e type DRAW-FILEP.
    upload the file from the BSP web interface (e.g. file C:TempSUTestPDF_SU.pdf)
        data_fileupload ?= CL_HTMLB_MANAGER=>GET_DATA(
                                           request = runtime->server->request 
                                           name    = 'fileUpload'
                                           id      = ‘InputFieldFileUpload’
        IF NOT data_fileupload IS INITIAL.
          l_filename         = data_fileupload->file_name.
          l_content      = data_fileupload->file_content.
          l_content_type = data_fileupload->file_content_type.
        ENDIF.
    The uploaded file is returned as XSTRING, so we have to convert it to BINARY
    (or STRING alternatively)!
        l_xstring = l_content.
        CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            BUFFER          = l_xstring
            APPEND_TO_TABLE = 'X'
          TABLES
            BINARY_TAB      = tbl_bin.
    split path for storing the file to the application server
        l_filename_c = l_filename.
        CALL FUNCTION 'CV120_SPLIT_PATH'
          EXPORTING
            PF_PATH  = l_filename_c
          IMPORTING
            PFX_FILE = l_filename_e.
    write the uploaded file to the application server
        l_filename = l_filename_e.
        concatenate l_file_ixos l_filename into l_file.
        open dataset l_file for output IN LEGACY BINARY MODE.
        loop at tbl_bin into wa_bin.
          transfer wa_bin-line to l_file.
        endloop.
        close dataset l_file.
    store the uploaded file on the IXOS-archive
        l_doctype = l_content_type.
        CALL FUNCTION 'ARCHIVOBJECT_CREATE_FILE'
          EXPORTING
            ARCHIV_ID                = '2T'
            DOCUMENT_TYPE            = l_doctype
            PATH                     = l_file_arc
          IMPORTING
            ARCHIV_DOC_ID            = l_arc_doc_id
          EXCEPTIONS
            ERROR_ARCHIV             = 1
            ERROR_COMMUNICATIONTABLE = 2
            ERROR_UPLOAD             = 3
            ERROR_KERNEL             = 4
            OTHERS                   = 5.
    link the archived document to the business object ‘DRAW’
        CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
          EXPORTING
            ARCHIV_ID                   = '2T'
            ARC_DOC_ID                  = l_arc_doc_id
            AR_OBJECT                   = 'DRW'
            OBJECT_ID                   = g_object_id_arc
            SAP_OBJECT                  = 'DRAW'
           DOC_TYPE                    = l_extend
         EXCEPTIONS
           ERROR_CONNECTIONTABLE       = 1
           OTHERS                      = 2.
    Remark: It´s vital to convert the uploaded file from XSTRING to BINARY. Otherwise the file cannot be stored/archived properly.
    The archived document can then be displayed by inserting the (IXOS-web client-)link to the BSP page (e.g. http://193.228.208.78:4060/archive.dll/get?arc=2T&doc=44439F1B4F701E65E1000000C1E4D00A).
    Hope this helps!
    Regards,
    Ulli

  • Bps file upload error in Bsp

    hi marc,
    i need a small help from you.i am uploading file into bps web,i followed your pdf guide.it is working fine.in my scenario,i had developed a screen design and in that i wants to incorporate the file upload functinality.when we generate the bps application corrsponding bsp will be generated and in bsp, the page design will be in the views not in the layout,here iam getting the problem,when i write the code in the oninputprocessing the below code is not responding,when i try to do change in the layout my original design is getting disturbed.my code is as follows in the oninputprocessing plz advice me.
    iam getting dump at the bolded line below as null value is passed.plz help me out.
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    CONSTANTS:
    c_memory_id_file_upload TYPE memory_id VALUE 'Z_SEM_BPS_FILE_UPLOAD'.
    DATA:
    lv_objname TYPE lxeobjname,
    lr_page TYPE REF TO if_http_entity,
    l_content_path TYPE string,
    l_content TYPE string,
    l_subrc TYPE sy-subrc,
    ls_bapiret TYPE bapiret2,
    lt_bapiret TYPE STANDARD TABLE OF bapiret2,
    ls_mesg TYPE upc_ys_mesg,
    lt_mesg TYPE upc_yt_mesg,
    request1 type ref to IF_HTTP_REQUEST.
    DATA: event TYPE REF TO CL_HTMLB_EVENT.
    REFRESH lt_mesg.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
    event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
    IF event->name = 'button' AND event->event_type = 'click'.
    DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
    button_event ?= event.
    ENDIF.
    endif.
    case event->id.
    when 'upload'.
    lv_objname = request->get_form_field( 'file' ).
    lr_page = request1->get_multipart( 1 ).
    <b>l_content_path = lr_page->get_header_field( '~content_filename' ).</b>
    l_content = lr_page->get_cdata( ).
    IF l_content IS NOT INITIAL.
    Export file contents to memory
    EXPORT content FROM l_content TO MEMORY ID c_memory_id_file_upload.
    endif.
    endcase.
    create statistic node for performance measurements
    type-pools: upcst.
    cl_upwb=>statistic_open( i_node_name = upcst_c_web_input_proc
    i_page = page
    i_request = request ).
    call input processing here
    call method application->inputProcessing(
    event_id = event_id
    runtime = runtime
    page = page
    request = request
    navigation = navigation
    version = 300
    close the statistic node
    cl_upwb=>statistic_close( i_node_name = upcst_c_web_input_proc ).

    Hello Bharan,
    the file upload must run in its own BSP application. Otherwise the header for the file content is not filled properly. You can use an iframe to embed the upload application into a BPS web interface for example.
    Regards,
    Marc
    SAP NetWeaver RIG

  • Flat file Upload BSP page

    Hi Marc,
    I am following the July version of how-to. When generating the BSP page, I am told checkbrowser.htm and js.htm are not available. When I create a checkbrowser.htm and point the include to js3.htm, which is one of the page fragment available, there are a few other errors coming out. What am I missing?

    Do you already know if the flat file upload is possible from a multi planning area? Because I get the error message that my multi planning area does not exist when executing the function.
    Thnx.

  • How to modify the field lengh of file upload

    Hi All,
       I am facing a problem with u201Cuploadu201D filed length in BSP application.
    When we upload the file in BSP page, the path displayed should be the full path (i.e. from where the file is being upload the file)
    Now this field is appearing 20 char length
    Now I want to increase the length of the upload field (Input field) to be 100 char so that the path is visible.
    In the current application the file upload is being done through a structure (attributes)
    In this structure the fields are like this
    PAGE_NAME
    ID
    FOR
    TAGS
    ROW_INDEX
    COLUMN_INDEX
    OTR_NAME
    REQUIRED_NAME
    MAXLENGTH
    SIZE
    TABLE_NAME
    ON_SELECT
    VALUE
    DISABLED
    ONCLICK
    TEXT
    TYPE
    Using this method:
    CALL METHOD cl_htmlb_fileupload=>factory
              EXPORTING
                Id      = ls_form_save-id
              RECEIVING
                Element = lv_fileup.
            bee_table->add ( level = 2 element = lv_fileup ).
    This cl_htmlb_fileupload is named as class interface.
    Which has the CLG_HTMLB_FILEUPLOAD (it is a class) it is defined in attributes.
    In this class it has the attribute u201CSIZEu201D by default string 20.
    Now I need to change this attribute length from 20 to 100
    For this I copied the standard class CL_HTMLB_FILEUPLOAD into ZCL_HTMLB_FILEUPLOAD.
    This ZCL_HTMLB_FILEUPLOAD contains all attributes of the standard class CL_HTMLB_FILEUPLOAD
    Including the one class (CLG_HTMLB_FILEUPLOAD), this is defined as an attribute (ABOVE MENTIONED?)
    This class is appearing in non editable mode, so   I have copied this class into zclass (ZCLG_HTMLB_FILEUPLOAD).but still I am not able to edit the attribute called u201Csizeu201D
    And also I am not bale to add the zclass in place of the ZCLG_HTMLB_FILEUPLOAD
    Kindly tell me how to modify the length of the field u201Csize u201Cand also how to add the zclass in the attributes of one class (syntax)
    Thanks in advance
    Rambabu.A

    Hi,
    Class CLG_HTMLB_FILEUPLOAD is a class automatically generated when a BSP Element is created. You should not change/create such a class, unless by creating your own BSP Element.
    As per your requirement, you can use the SIZE parameter of method factory:
    ls_form_save-size = '100'.
    CALL METHOD cl_htmlb_fileupload=>factory
    EXPORTING
    Id = ls_form_save-id
    Size = ls_form_save-size
    RECEIVING
    Element = lv_fileup.
    Regards,
    Tanguy

  • BSP File Download  - .TIF problems

    Dear all!
    I haven't been able to fix this problem,
    please see my post for further information. I am using SAP.help coding to display files in BSPs (6.20, "BSP with flow logic" pages used). See the coding below.
    Somehow .tif files can not be displayed. Every other mime type works fine.
    Thanks,
    Chris
    Dear all!
    In a quite complex file upload and download scenario which works fine we use the following coding to display files received from the backend in our page.
    OnInitialization: receives file backend data such as filesize, content(xstring) and mimetype.
    This works all fine. Mimetype is delivered correctly.
    OnInputProcessing:
    This has been taken from the help.sap.com documentation -
        runtime->server->response->set_data( mycontent ).
          runtime->server->response->set_header_field(
            name   = 'Content-Disposition'
            value = lv_downname ).
        runtime->server->response->set_header_field( name  = 'Content-Type' value = mymimetype ).
        runtime->server->response->set_header_field( name  = 'Content-Length' value = myfilesize ).
        runtime->server->response->delete_header_field( name = 'Cache-Control' ).
        runtime->server->response->delete_header_field( name = 'Expires' ).
        navigation->response_complete( ).
    RESULT:
    the file is displayed fine. When trying to save the displayed file locally on the hard disc, the mimetype is not available. The system (Windows XP) provides only .bmp as file type. Also the context menu entry "Properties" of the displayed file shows NOT AVAILABLE as mimetype.
    Is this a common problem? How can I achieve to have the mimetype information available for a save?
    Thankx,
    Christoph
    Message was edited by: Christoph Aschauer
    Message was edited by: Christoph Aschauer
    Message was edited by: Christoph Aschauer
    Message was edited by: Christoph Aschauer

    Hi,
    I am getting an error, when I try to download the document from the bsp-page.
    I have uploaded the document to the server-cache as mentioned above. If I test it on the standalone machine, everything works fine. But when I have to connect to the BSP-Application through an EP I am getting the error:
    BSP Exception: Das Objekt test.doc in der URL /sap(bD1kZSZjPTEwMCZwPTM1MjUwJnY9NiUyZTQmaT0xJnM9U0lEJTNhQU5PTiUzYWR0aXRtZXpfVE1FXzA3JTNhLUVVb2Y3MHRUN2JnMGFYMUNLeUVPakRRWmZBTTJVVE5aS21Lc0FRQi1BVFQ=)/bc/bsp/sap/zportal_rueckme/test.doc?sap-syscmd=nocookie ist nicht gültig.
    Test.doc is the name of the document I wish to download.
    Here comes the sample code.
      DATA: cached_response TYPE REF TO if_http_response.
      CREATE OBJECT cached_response
        TYPE
          CL_HTTP_RESPONSE
        EXPORTING
          add_c_msg        = 1.
      cached_response->set_data( l_document_x ). " l_document_x is a xstring
      cached_response->set_header_field( name  =   
                                        if_http_header_fields=>content_type
                                                              value = l_mime_type ).
      cached_response->set_status( code = 200 reason = 'OK' ).
      cached_response->server_cache_expire_rel( expires_rel = 180 ).
      CONCATENATE
                  RUNTIME->application_url
                  '/' l_file_name INTO e_url.
        cl_http_server=>server_cache_upload( url      = e_url
                                             response = cached_response ).
    Later I navigate to that URL:
            NAVIGATION->GOTO_PAGE( URL = e_url ).
    Any suggestions are appreaciated!
    Regards,
    Max

  • Uploading multiple documents using file upload option

    Hi,
      I am new to BSP in file upload.Here i am trying to upload documents and Archiving the documents.At one time i am able to uplaod one document.Is there anyway of uploading of multiple documents from the same File upload control in the same session.and keeping the documents that uploaded in the page.
      Hope you will answer.Need urgent reply.
        Regards
       Usman

    before answering your question, a request
    can you reply/award points/close previous thread opened by you.
    coming to your question, check out the below given link.
    http://www.15seconds.com/issue/990723.htm
    Regards
    Raja

  • File Upload 7.0

    Dear all,
    I have created a planning area using BPS0. I have create da BSP page for the file upload. (new version with htmlb)
    When testing I get the following error:
    The following error text was processed in the system:
    An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause
    Exception class: CX_SY_REF_IS_INITIAL
    Program CL_O24BCVK5TG5265CJ96LKBM7M9JCCP
    Include CL_O24BCVK5TG5265CJ96LKBM7M9JCCM005
    ABAP Class CL_O24BCVK5TG5265CJ96LKBM7M9JC
    Method _ONLAYOUT
    BSP Application Z_KPI_LOG
    BSP Page Z_KPI_LOG2.HTM
    Line 137 
    Long text An attempt was made to execute a dynamic method callon an initial(NULL-) object reference. The reference must refer to an object.
    Can you please help me?
    Points will be assigned
    Thank you
    Ramona L.

    Dear Ramona,
    to find out what is going wrong you can try to debug the application.
    Therefore please open the application Z_KPI_LOG  in SE80 (BSP-Application) and go to page Z_KPI_LOG2.HTM. Here you need to set an external-Breakpoint. Now start the application. During debugging of the page look out for objects which are not instantiated (= initial). As soon as a method should be called for and inital object you get your error message.
    Please note: if you have many objects (e.g. textitems) on the page, it way take some time for you to find out in the debugger which object is initial (= not instantiated).
    The typical reasons for this kind of error in WebInterfaces is:
    - a method for an object should be called, but the object is not instantiated
    The reason why the object is not instantiated could be (in your case):
    - a text for an text element is missing
    - there is an error in the transport (So please compare page Z_KPI_LOG2.HTM in your development system and your system where you are getting the error) or try to transport the application again. Also checked if parts of the application are locked in another transport request.
    Hope this helps.
    Matthias Nutt
    SAP Consulting Switzerland

  • Can we upload more than 1000 records with BPS file upload pf

    We are using file upload functionality in BPS. Can we use this function to upload around 80,000 records at a time.
    We are unable to upload more than 1000 records because throws a time out error. Is there a setting that we can change to resolve this?

    Hi,
    Can you check the following note  about BW system parameters :
    [https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=192658]
    Check the work Process time set for your BW system
    Is your application web based ?
    Pratyush

  • BASIC: Flat File Uploads to Web Reports - Notification Status

    Hi,
    I have excel based Notifications (Some legal cases) with their status in text format.
    I would like to show them on a WAD based report.
    Kindly suggest how I can do the same.
    Thanks in advance
    Pranab

    Pranab,
    you could upload them as documents if required and display the same.
    Otherwise - you can upload the same into MIME repository and use the template to display the same using the document Web Item.
    Otherwise you can have a BSP that uploads the data into MIME - the user could do this and then display the same in a BSP page instead.
    If security is not a big concern then you could upload the same into sites like zohocreator and expose the links on the web template - here the user can also update the status / change the excel files if required - something like Google spreadsheets..
    Arun
    Assign points if useful

  • File Upload Scenario

    Hi All,
    Can anyone give me some resources for creating a File Upload application ??
    TXT file to Internal Table.
    (new to BSP)
    Thanks in Advance
    Chemmanz

    They are useful but i need to SAVE that i uploaded file to SAP.
    But i think that applications hold files in cache.
    I want i can download file when i want.
    Thanks
    ibrahim
    Message was edited by: Ibrahim UGUR

  • File Upload on Visual Composer

    Dear colleagues,
    I need to build the functionality to do a File upload on Visual Composer. The user should be able to select a file from his local PC and upload it into a table or DSO.
    I have created a function module that uses the function 'GUI_UPLOAD' to do the upload. If I execute the FM from transaction SE37 it works fine, selects the file and loads the data into the table. However, if I embed that FM into Visual Composer it does not work anymore.
    Is it because it uses GUI technology that cannot be called from java environment of VC?
    Anybody has a hint on how to solve this? Is there any standard functionality to do it?
    Thanks,
    Salvador Gimeno

    Hi,
    Salvador  Gimeno wrote:
    Dear colleagues,
    I need to build the functionality to do a File upload on Visual Composer. The user should be able to select a file from his local PC and upload it into a table or DSO.
    I have created a function module that uses the function 'GUI_UPLOAD' to do the upload. If I execute the FM from transaction SE37 it works fine, selects the file and loads the data into the table. However, if I embed that FM into Visual Composer it does not work anymore.
    Is it because it uses GUI technology that cannot be called from java environment of VC?
    Yes, the GUI_UPLOAD relies on the "SAP Gui connection" which is not possible in a Web environnement like the Visual Composer.
    In languages such as Web Dynpro (Java or ABAP) or BSP, you can upload file to the server.
    You might have to "mix" technologies to provide upload and still keep using VC.
    Salvador  Gimeno wrote:
    Anybody has a hint on how to solve this? Is there any standard functionality to do it?
    I think this upload functionality is about to be released with Ehp1

  • How to popup file upload tag when we click on a button?

    Hi All,
    In BSP, How to popup the file upload tag when we click on a button?
    Let us Assume that when we click on open button as mentioned in the below 1st screen shot one popup should open like the below mentioned screen shot2 in the same page?
    Screen Shot1
    Screen shot 2
    Please help me on this.
    Thanks

    if you're using a document class ascircle, that should something like:
    package{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class ascircle extends MovieClip{
    public function ascircle(){
    init();
    private function init():void{
    stage.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    Circle.play();
    // if you're adding code to the main timeline, you would use:
    stage.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    Circle.play();

  • Error "A web exception has occurred during file upload" when trying to import ESXi image file into Update Manager

    I'm encountering this error and not sure how to fix, I'm quite new to vCenter so please bear with me.
    I'm trying out vCenter 5.1 with Update Manager 5.1 right now.  No license key has been entered and I still have 50 odd days to try it out.
    2 ESXi hosts are being managed by this vCenter, and they're both running ESXi 4.0
    I'm looking to use Update Manager to try to upgrade the ESXi 4.0 hosts to ESXi 5.1
    I downloaded the image file VMware-VIMSetup-all-5.1.0-799735.iso from VMWare website, and is looking to import it using the Update Manager so I can update the ESXi hosts, but I keep on getting the error:
    File name:     VMware-VIMSetup-all-5.1.0-799735.iso
    Failed to transfer data
    Error was: A web exception has occurred during file upload
    I tried importing it by using vSphere client to connect to vCenter server both remotely and locally, with firewall disabled.
    I've read http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1026602
    I've disabled firewall, and there is no anti-virus program on the server.  I've also restarted the machine several times, to no avail, I didn't reinstall update manager because the whole Windows and VCenter installations are clean from scratch.
    I logged into the vSphere Client using Active Directory credentials, and I've made all Domain Admins (which my account is a member of) part of the administrator group on the vCenter server. I can't log in using admin@System-Domain because it tells me I don't have permissions for it, I still haven't really had the chance to figure out why that is and not sure if that makes a difference.
    Also, I'm fairly certain I'm using the right image file, as I've burned some DVD's used that image file to upgrade some other ESXi hosts.  Unless there's a special image file I need to download?
    I'm at lost on what I can do to make it work.  Please advise.
    Thanks.

    The ISO file you mentioned is the one for vCenter Server. What you need is the "VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso" (or VMware-VMvisor-Installer-201210001-838463.x86_64.iso) for the ESXi host.
    André

Maybe you are looking for

  • CLOB Datatype with JDBC Adapter

    Hi, we try to fill a Clob Datatype to JDBC Database. We try 2 ways with the JDBC Adapter: action="SQL_DML" with an SQL Statment and $placeholders$ But how can i say the key element that it is a CLOB type? He used this a VARCHAR and there a not more t

  • Calling a package from shellscript

    Hello, I am trying to run open interface for GL. I am a newbie to oracle apps. The flow and steps i am following are 1. Load some sample data into staging table using sqlldr. 2.Validate and insert the data into gl_interface using pl/sql package. 3. W

  • How do I use an XML file to stream information to a Webapp?

    I am trying to use XML generated by an event calander application to set it up with an image slider on the sites webpage. I need it to read in event info and use a picture so that the slider can show "Upcomming Events". It would have a picture, date

  • MPN on MAC OS 10.6.2

    Hello everyone, I am trying to find the MPN to register Iphoto. when I follow the instructions, which are : "if you are using a version of Mac OS X: Click Finder in the Dock. Choose "Applications" from the Go menu. A Finder window appears with a list

  • How to Read data From Excel File in Labview 8.5?

    We can read it from xls file, but it is encrypted..... we need exact data...