Attachment in BSP Page

If I use <htmlb:fileUpload> tag for creating attachment and upload the file, where is the file getting saved ?
How to extract the file from that storage location?

Hi,
The data is in variables and u can use it the way u want.
Check sample code:
ONINPUTPROCESSING:
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
Optional: test that this is an event from HTMLB library.
IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
See if upload is triggered from button
  DATA: event TYPE REF TO CL_HTMLB_EVENT.
  event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
  IF event->id = 'submitButton' AND event->event_type = 'click'.
    DATA: data TYPE REF TO CL_HTMLB_FILEUPLOAD.
    data ?= CL_HTMLB_MANAGER=>GET_DATA(
                                       request = runtime->server->request
                                       name    = 'fileUpload'
                                       id      = 'myFileUpload1'
    IF data IS NOT INITIAL.
      name         = data->file_name.
      content      = data->file_content.
      length       = data->file_length.
      content_type = data->file_content_type.
    ENDIF.
  ENDIF.
ENDIF.
ONLAYOUT:
<%@page language="abap"%>
<%@ extension name="htmlb" prefix="htmlb"%>
<htmlb:content>
  <htmlb:page title = "BSP Extension: HTMLB / Element: fileUpload">
    <htmlb:form method="post" encodingType="multipart/form-data">
      <htmlb:fileUpload   id      = "myFileUpload1"
                           size    = "50"
                           accept  = "true"
       />
      <htmlb:button       id      = "submitButton"
                           text    = "Upload"
                           onClick = "HandleUpload"
       />
    </htmlb:form>
    <htmlb:textView text="Uploaded: " />
    <htmlb:textView text="<%= name %>" />
    <htmlb:textView text="Content-Type: " />
    <htmlb:textView text="<%= content_type %>" />
    <htmlb:textView text="Length: " />
    <htmlb:textView text="<%= length %>" />
  </htmlb:page>
</htmlb:content>
Hope it'' help.
Cheers
Ankur

Similar Messages

  • To add attachment in BSP page

    Hi all,
    we have a requirement where we have to attach a doc in our BSP page. Please let me know how it can be achieved and in future how this doc can be retrived.
    Thanks in advance.
    Regards,
    Vithalprasad

    As Thomas suggested you should use <htmlb:fileUpload> to allow files to be attached to service tickets from BSP page. And the same can be stored either in a Ztable or in SAP DMS.
    for file upload - check out SBSPEXT_HTMLB/fileupload.bsp
    alos check out this weblog.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    BSP FAQ
    /people/brian.mckellar/blog/2003/10/23/bsp-trouble-shooting-frequently-asked-short-questions
    Regards
    Raja

  • Maintaining External Alias for BSP Pages in EBP lauchpad

    Hello,
    Below is the problem mentioned :
    Our SRM production system is installed on a AIX server that has
    svuni299.its.it as fully qualified domain name.
    When we connect to the system using the url
    http://svuni299.its.it:8052/sap/bc/gui/sap/its/bbpstart
    everything works fine.
    Instead, when we use the alias:
    http://sapienssrm.fiat.com:8052/sap/bc/gui/sap/its/bbpstart
    we have some problems with the logon to the CCM, because the system
    asks the password again.
    In the attachment problem.doc you can see how to reproduce the error.
    We have seen that in both case, in the left menu of the SRM, all the
    entry contains always a call to an absolute url like this:
    javascript:parent.launchSrvc
    ('','BSP_APPLICATION','http://svuni299.its.it:8052/sap/bc/bsp/ccm/cat_cd
    c/container.htm?sap-client=100&sap-sessioncmd=open&sap-
    language=I','menu')
    instead of having a relative url like this:
    javascript:parent.launchSrvc
    ('BBPSC18','IAC','/sap/bc/gui/sap/its/bbpsc18/!?
    client=100&language=IT&~logingroup=SPACE','menu')
    My Questions:
    Q1.Where can one maintain an external alias to access BSP pages from EBP launch pad.
    Q2.Should relative URL be called or absolute URL?
    Cheers,
    Rohan.

    Hi Rohan,
    You can maintain external aliases using Tcode- sicf.
    There on application toolbar you will find a push button <b>External Alias</b> click on that and then select your virtual host and press create new button and enter the required informations.
    Cheers!
    Narinder

  • How to validate image at the time of uploading image in BSP page

    hi
    I have created a BSp page in which i have created attachment option with browse button , so please tel me that how to validate at the time of clicking save button , attachment should me image (jpeg,gif)
    thanks

    To provide f4 help for the input field, we have to add showHelp and onValueHelp attributes to the inputField tag. Provide the values to those attributes as shown below.
    You need to check after transferring the value fo object if the object  contains .jepg then return = true else return = false and call the error page and display the error message 'choose only the .jepg image' and on the error page also give the button to return to the previous page.
    hope this will help u.

  • Modifying standard BSP pages

    Hello,
    I would like to add some functionality (precisely some Javascript code) to a standard BSP page. As it is a SAP standard, the system doesn’t allow to modify it as normal BSP page. Is there any possibility to attach some code or functionality to BSP page without modifying the code, I mean something similar to, for example, enhancements, user-exits in R/3 so that we could activate and insert the code?
    Thanks in advance for any hint.
    Regards,
    Anna

    Hi,
    I would not recommend to change standard SAP BSP pages. When there is an update or upgrade concerning this pages, you will get problems and will need to SPAU till the end of days (see also http://help.sap.com/saphelp_nw2004s/helpdata/en/60/d6ba7bceda11d1953a0000e82de14a/frameset.htm) and eventual modify things again, which isn't a pleasant job at all.
    I would say that you make a copy to a Z application and work further on that one.
    Eddy
    PS. Reward the useful answers and you will get <a href="http:///people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourself">one point</a> yourself!

  • Can we code to import MIME object(Image)  on bsp page

    hi
    can we code to import MIME object(Image)  on bsp page
    i have one bsp webpage like employee page , in which i have option to attach image so , i want that user attach image and image shuld be go in sap mime object.
    thanks

    Hi,
    save the image into ur system.
    Right click on object name->create->MIME object->import.
    Then select hte image which u want to import and save it.
    Then in the layout write code as
    <html>
    <img height="130" src="image.bmp ">
    </html>
    Regards,
    jaya

  • Send Email with Attachment in BSP?

    Hello,
         I have trouble about sending Email in BSP .
         I don't know how to <b>Send Email with attachment in BSP</b> . Please give me some advice .
        Thank you very much!

    Here is a sample application..
    <b>Layout</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="Send Mail with Attachment " >
        <htmlb:form id           = "form1"
                    encodingType = "multipart/form-data" >
          <htmlb:label for  = "MAILTO"
                       text = "Mail to" />
          <htmlb:inputField id    = "MAILTO"
                            size  = "20"
                            value = "<%= mail_to %>"
                            type  = "string" />
          <htmlb:fileUpload id          = "myUpload"
                            onUpload    = "HandleUpload"
                            upload_text = "Attach"
                            size        = "90" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>Page attributes:</b>
    mail_to     TYPE     ADR6-SMTP_ADDR     E-Mail Address
    <b> Event handler OnInputprocessing..</b>
    DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD,
          file_content TYPE XSTRING,
          file_length TYPE STRING,
          file_mime_type TYPE STRING,
          file_name TYPE STRING.
    fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(
                           request = request
                           id      = 'myUpload'
                           name    = 'fileUpload' ).
    if fileUpload is not INITIAL.
      file_name      = fileUpload->file_name.
      file_mime_type = fileUpload->file_content_type.
      file_length    = fileUpload->file_length.
      file_content   = fileUpload->file_content.
      mail_to = request->get_form_field( `MAILTO` ).
    * Send mail part..
      CLASS cl_bcs DEFINITION LOAD.
      DATA:
            lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
      lo_send_request = cl_bcs=>create_persistent( ).
    * Message body and subject
      DATA:
            lt_message_body TYPE bcsy_text VALUE IS INITIAL,
            lt_att_content_hex type solix_tab,
            lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
      APPEND 'Dear Vendor,' TO lt_message_body.
      append ' ' to lt_message_body.
      APPEND 'Please find the attached report.'
      TO lt_message_body.
      append ' ' to lt_message_body.
      APPEND 'Thank You,' TO lt_message_body.
      lo_document = cl_document_bcs=>create_document(
      i_type = 'RAW'
      i_text = lt_message_body
      i_subject = 'Visit report' ).
      data: data_tab type solix_tab,
      p_data type XSTRING.
    * Pass the data of the document we have uploaded..
      p_data = file_content.
      call function 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer     = p_data
        TABLES
          binary_tab = data_tab.
      DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
      TRY.
          lo_document->add_attachment(
          EXPORTING
          i_attachment_type = 'PDF'
          i_attachment_subject = 'Visit Report'
          i_att_content_hex = data_tab ).
        CATCH cx_document_bcs INTO lx_document_bcs.
      ENDTRY.
    * Add attachment
    * Pass the document to send request
      lo_send_request->set_document( lo_document ).
    * Create sender
      DATA:
      lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
      l_send type ADR6-SMTP_ADDR value '[email protected]'.
    * Set sender
      l_send = mail_to.
      lo_sender = cl_cam_address_bcs=>create_internet_address( l_send ).
      lo_send_request->set_sender(
      EXPORTING
      i_sender = lo_sender ).
    * Create recipient
      DATA:
      lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
      lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
    ** Set recipient
      lo_send_request->add_recipient(
      EXPORTING
      i_recipient = lo_recipient
      i_express = 'X' ).
      lo_send_request->add_recipient(
      EXPORTING
      i_recipient = lo_recipient
      i_express = 'X' ).
    * Send email
      DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
      lo_send_request->send(
      EXPORTING
      i_with_error_screen = 'X'
      RECEIVING
      result = lv_sent_to_all ).
      COMMIT WORK.
    endif.
    Hope this will be helpful.
    Raja T

  • How to create an url for bsp page to access in IE?

    hi friends,
    I am new to BSP topic.
    I have created 4 BSP pages. and 1 Main BSP page. Now in Main BSP page i attached all the 4 BSP pages links.
    Now when i test the Main BSP page it will show all the 4 BSP page links. All are working fine.
    But the end user has to access this through IE by typing Main BSP page full path. It's some what becoming critical to enter full path. It will be access in internally(intranet) only not outside.
    For this i want create an URL like http://empess.
    When the user type this URL http://empess in IE and press enters then my main BSP page has to open.
    How to do this. any helps will appreciate...
    Regards,
    Shree.

    hi,
    As u said i created External Alias as /ITCESS to my BSP application.
    And i select my BSP application name from the Target Element tab. Then i selected the alias name i right clicked on it, i selected TestExt. Alis option. It's working fine.
    But now the problem is, i want this to display in IE direclty, when user type the /ITCESS in Internet Explorer addres bar.
    Regards,
    shankar.

  • Unable to capture the Idle time for BSP page

    Hi Experts,
    I want to capture the Idle time of my BSP page. If that is 5 mins then i have to display the pop up displaying the remaining time.
    Please let me know how to capture the IDLE TIME. not the time after the page is loaded.
    Any suggestion will be helpful.
    Aready checked in SDN but unable to get the solution so posting it.
    Thanks in advance.
    Sravanthi.V

    hi,
    After capturing the idle time iam giving the warning popup to user before 5mins of expiry.Now my requirement is if the user clicks on OK button of popup the page should get refresh. i.e.Idle time should of system should break and we have to get one more hour for expiry.
    Thanks in advance,
    Sravanthi.V

  • Field value on BSP Page

    Hi,
          I have a requirement to show previous entered values in an input  field on BSP Page. for example suppose I enter value '0998' in an input field say 'XYZ'  and then I close or refresh the browser. again i open the page in browser and click the input field then system should suggest me the previous entered value i.e. '0998'.   does anyone have idea how we can do it?
    Regards
    Amit kumar
    Edited by: amitku1201 on Jan 8, 2010 12:19 PM

    Hi Amit,
    I saw your code..
    <htmlb:form id="Form1" method="POST" autoComplete = "TRUE">
    <bsp:findAndReplace find = "ON" replace = "ON">
    In the link I provided
    <bsp findAndReplace find = "off" replace = "on">
    I dont see the closing tag
    </bsp:findAndReplace>
    anywhere in your code.
    The tag should be not used immediately after the FORM tag instaed it is used just before the tag for particular element.
    Like in your case if you want to used it for the inputfield i_case , it should be done as
    <bsp findAndReplace find = "off" replace = "on">
    <htmlb:inputField id="i_case" value="<%=i_case%>" type="string" maxlength="12" width="100"/>
    </bsp:findAndReplace>
    The inputfield tag will be used between find and replace tags.
    I hope this will help you solve the issue.
    Regards,
    Anubhav

  • Assign a value from dropdownlist to input field value on BSP page

    Hi,
    I'm new to SAP and ABAP. We have a CRM project in which I have to maintain BSP pages.
    Now, coming to my problem: I have a input field with
    value = "//BTAdminH/HeaderInfo"
    This field is normally maintainable. The required function is now to set this field as not maintainable/readonly. Then, the value should be set automatically to an value, which will be selected from a dropdownListBox. After saving, the value HeaderInfo should have the same value like the selected value from the dropdownListBox.
    How can I now set the field as readonly (this should be the easier part) and
    how can I set the value for the HeaderInfo to the value of the selected value from the dropdownListBox?
    If I set it directly like this
    value = "//BTActivity/Priority"
    it is shown on the BSP page correclty, but it is not saved as HeaderInfo.
    Please help me.
    Enja

    Hello Gokul,
    test was only for test purposes! I am using as a separator the plus sign!
    But this is not the problem!
    In debugging, the local variable has the concatenated value! So, this is working!
    oncatenate ls_ddlb1-value ls_ddlb2-value ls_ddlb3-value into lv_headerinfo SEPARATED BY ' + '.
    But when I assign the value of my set_headerinfo to the local variable, then it is returning only the separator sign!!!
    if BTAdminH->GET_HEADERINFO( 'HEADERINFO' ) is initial.
        BTAdminH->SET_HEADERINFO( attribute_path = 'HEADERINFO' value = lv_headerinfo ).
      endif.
    If I declare the local variable as one of the dropdown values, then it is getting populated also for set_headerinfo
    lv_headerinfo  =ls_ddlb1-value.
    So, the assigning is also working! But it is not working, when the local variable equals more than one value! I hope that I could explained it in the right way for you!!!!
    So. why is the value for set_headerinfo not the same as the one for the local variable! The local variable has the correct value after the concatination.
    Regards
    Enja

  • Message not getting refreshed in bsp pages.

    Hi experts,
    An error message which is getting displayed should be removed on leaving the page. I mean the meassage area is not getting refreshed on leaving the page. Everytime i need to refresh the page to remove it. Please help.
    Abhi.

    hello Friend,
    Please clear the internal table / work are used to show message in OnInitialization method of the BSP page.
    now It is not getting cleared at the time leaving the page and data stays in memory...
    Thanks
    K.

  • In portal blank bsp page is displaying

    Hi Experts,
    Iam having an issue in BSP i.e, regarding appraisal template the bsp page is working fine at R/3 side
    but, in portal for one user the data is comming and for other user the blank bsp page is comming
    please can u help me in this
    waiting for u r responses,
    Regards,
    Shilpa.
    Edited by: pasumarthi shilpa on Dec 15, 2008 7:40 AM
    Edited by: pasumarthi shilpa on Dec 16, 2008 5:16 AM

    Hi,
    Check the user Authorization in R/3 and Portal also..
    In portal, Content Administration-->Portal Content -->Your folder(i.e. Role) -->Give a Every one Group Permissions with Read to that folde and check the Enduser check box.
    Thnx
    Suriya

  • How to return values from a BSP page to Javascript

    Hi All,
    I want to call a BSP page which reads a single value from a table and returns that value I want the Javascript in the HTML code to get the value from the BSP page.
    Can you kindly let me know how I can return the value from the BSP page to JavaScript.
    Kindly please provide me a simple code of a BSP page and the Javascript
    Thanks
    Karen

    Hi,
    you need 3 elements to make the javascript code read the value in any field in the table: table´s name, line and column. This is how your code could look like:
    script language="javascript>
       var row = 0;
       function display(){
          row = row + 1;
          campo = 'tabla1_' + row + '_4';                 " <-- table, line, column
          valor = document.getElementById(campo).value;
    </script>
    ROW works as a counter. You have in variable valor the value of the field and can do with it what you want, perhaps display it with ALERT. I am reading the values from field 1 to n in column 4 in table TABLA1. Pay attention to the '_' in the concatenation of field´s name. The table in my BSP is very simple:
    <htmlb:tableView id                = "tabla1"
                           table             = "<%= mytable %>"
                           width             = "100%"
                           allRowsEditable   = "X"/>
    and somewhere I must call function display in my javascript code:
    <htmlb:button  id="boton" text="Texto aqui" onClientClick="display()" />
    So, give it a try.

  • How to call a BSP page or webdynpro from a WAD Template button

    Hi All,
    I want to implement a button on a web template which when called involes a BSP page or a web dynpro and displays the BSP page or webdynpro in a popup window.
    Thanks
    Karen

    Hi Karen,
    What you could do is create a bsp application which receives workbook id as url parameter.
    From WAD create a link to this BSP page and pass the wbook id in the url.
    Within the BSP you can then read the excel as binary string like below
    Select * from rsrwbstore into table wb_tab where workbookid = wbid.
    You can then set wb_tab-clustd as the response of the page with mime type to 'application/vnd.ms-excel'. which will open as excel
    Take a look on this weblog,
    /people/durairaj.athavanraja/blog/2006/02/06/read-sap-table-data-from-bw-webtemplate-ajax-in-bw-webtemplate
    Hope it Helps,
    Regards,
    Amit

Maybe you are looking for

  • Handling Threads and Memory

    I'm sorry if this is a cross post to my StringBuffer problem. I have run a test that instantiates the object in question and the memory gets collected so I don't think it's that. My question is on how memory pertaining to Threads is handled. In my ap

  • Need Urgent help Error while retrieving a password for credential: ReaderRi

    I am receving the following error while deploying my web dynpro application containig a adobe form .The issue is that when i perform teh following test Enter the following URL in the browser http://<server>:<port>/AdobeDocumentServices/Config The web

  • Configure postfix to accept inbound mail only from Google

    I like to host my own email on a Mac Mini running OS X Server.  I’ve also looked for solutions that allow filtering out SPAM before the mail gets sent to my server.  For many years I used Postini’s spam filtering service to clean incoming email befor

  • How do you deactivate a license on a failed computer?

    I have a computer that suffered a hardware failure that has a licensed copy of LabVIEW 8.6. I would like to deactivated that machine and install the software on another working machine. How do I do that? Solved! Go to Solution.

  • My program hangs while i open a file.

    Using multiple threads, would be able to resolve this.However, i don't know anything about it. Please provide me with resources in labview that will allow me to do this.