Using BAPI_DOCUMENT_CREATE2 from BSP Application

I am trying to add a document in DMS from a BSP application. The bapi_create_document2 works except that it will not upload a file from the client PC. The exact same code with the exact same parameters supplied works from within an ABAP program. I assume that this is because the web server is the presentation server in the BSP application and does not have access to the files on the PC.
I know that I can use the  <htmlb:fileUpload> tag to move a file from the PC to the data object type ref to CL_HTMLB_FILEUPLOAD. The contents would then be in data->content. I am wondering if there is then some way to add the original file from the object using this BAPI or another one.

I can tell you what we did.  When you use BAPI_DOCUMENT_CREATE2 you can specify a SAPFTP or SAPHTTP destination.  These are RFC destinations where the sapftp or saphttp executable can be found.  We setup an SAP gateway installation on each of our global content and cache servers.  We then use the client IP address to determine the closest SAP Content server to the client.  We use JavaScript (and the filesystem object - note your server must be in the trusted zone in IE for this to work) to copy the file from the client machine to the nearest Content Server.  Then when we call the BAPI we specify the correct RFC Destination where the file is located and it is checked in correctly.
Now if you don't use the Content and Cache Servers and only want to upload into the R/3 database repository, then I would just use the fileUpload and write the file to a local directory on the server.  Then point to the SAPFTP/SAPHTTP RFC that would have access on that server.

Similar Messages

  • How to use GUI_DOWNLOAD inside BSP Application event

    Hi All,
    I am facing one issue while using GUI_DOWNLOAD inside BSP Application. When the processing goes at GUI_DOWNLOAD it gives me unknown error where as the same code is working when used in report program. My requirement is to save password into excel file at my local machine. I am using FM MS_EXCEL_OLE_STANDARD_DAT to save password in excel file but this function module fail when it reach at GUI_DOWNLOAD . Can you please help me out.
    Thanks and Regards
    Pradeep Kr. Rai

    Dear Pradeep,
    Find the below link which explains a simple data download to excel from a table view.
    www.sapt echnical.com/Tutorials/BSP/Excel/Index.htm
    Try to avoid the way your using in the BSP application and it is abdicable to use the standard methods / class available like "cl_bsp_utility"
    Hope this will be helpful.
    Regards,
    Gokul.N
    Edited by: Gokul on Oct 8, 2009 9:57 AM

  • Call ITS from BSP Application

    i have created a ITS screen which in turn calls a Abap report
    I want to call this ITS screen from a BSP application .
    Could you please provide some sample code which is used to call ITS from BSP application..
    Useful answers will be rewarded
    Thanks

    Since it is related to both ITS and BSP i thought i can post it in both. and also i didnt get answers for the queries..... for a long time. Anyhow i will take your suggestion for my future query.
    i hv done using iframe to call my ITS application.
    I can able to call the Bsp application whichin turn calls its screen abap program.
    while executing ,  the selecting the directory from the file browse pop up doesnt work for downloading the file
    becos the client , they will not change the settings related to applet in the internet browser for security reasons.
    I hav to make it some how to make it work in the portal which calls this BSP application..
    at the moment i mapped this BSP application to the user role in the SUS Portal . but it appears in the SUS portal . but i m not able to click the application and also handsymbol is not seen while bringing the mouse to that area.
    Could you please tell me , how to use Action_id for that particular application, Authorisation profile settings.
    Kindly  give your suggestions asap.

  • PDF download from BSP application

    hi all,
    With the bellow code i am able to download to PDF from BSP application
    Issue is when i click on the download button waiting popup window is not disappearing even after PDF displayed.
    Please help me to resolve how to stop this waiting popup window.
    response->delete_header_field( name = 'Cache-Control' ).  "#EC NOTEXT
      response->delete_header_field( name = 'Expires' ).        "#EC NOTEXT
      response->delete_header_field( name = 'Pragma' ).         "#EC NOTEXT
    Deactivated because of Note 904314 and Kompression in Kernel
      response->set_compression( options = '4' ).
      response->set_header_field( name  = 'content-type'
                                  value = 'application/pdf' ).
      response->set_header_field(
                         name  = 'cache-control'
                         value = 'max-age=0' ).
        response->set_header_field(
                           name  = 'content-disposition'
                           value = 'attachment; filename=candidate.pdf' ).
      l_pdf_len = XSTRLEN( l_pdf_xstring ).
      response->set_data( data   = l_pdf_xstring
                          length = l_pdf_len ).
      navigation->response_complete( ).
    Any help on this is highly appreciated.
    Thanks,
    Ravi

    May be you can navigate to another page AFTER the response_complete() method and show the message that 'PDF is downloaded successfully'
    or something meanful message. so that it will get a response back from server and 'wait...Processing' message might disappear.
    I'm not sure and didnt try..may be you can give it a try and let us know..
    navigation->response_complete( ).
    navigation->goto_page(....)

  • Master Table for Work Items from BSP Application

    hello guys,
    just want to ask if there is a master table for work items (and other details) from BSP application?

    Hi,
          Ya its true but i want to connect my customized application to UWL in Enterprise Portal and there after approval i want my workitems to be punched in R/3 system.Is there any source code available,so that my application directly contact UWL in sap enterprise Portal as a link or workitems where user should have an option to approve or reject.
    If u have any idea plz let me know.
    Thanks in Advance
    Regards
    Santosh Saraf

  • Calendar appointments from BSP application

    Do you anyone have an idea on how to create Calender appointments from BSP applications?
    Any inputs would be helpfull.
    Srinivas

    Hello,
    calendar items are specially formatted mail items. They do not have textual body, only an attachment with extension
    .ics
    Here is an example how it should look like:
    BEGIN:VCALENDAR
    PRODID:-//COMPANY//R/3-640//D
    VERSION:2.0
    METHOD:REQUEST
    BEGIN:VEVENT
    ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;ROLE=CHAIR;CN="aaa.bb@ccc.
    com":MAILTO:[email protected]
    ATTENDEE;PARTSTAT=ACCEPTED;RSVP=TRUE;ROLE=CHAIR;CN=""Sender, aaa"":MAILTO:sender.
    [email protected]
    ORGANIZER:MAILTO:[email protected]
    DTSTART:20060308T090000Z
    DTEND:20060308T093000Z
    LOCATION:
    UID:[email protected]
    STATUS:CONFIRMED
    DTSTAMP:20060310T122435Z
    SUMMARY:test4
    CATEGORIES:Keine Terminart ausgewählt
    CREATED:20060310T122435Z
    SEQUENCE:0
    TRANSP:OPAQUE
    PRIORITY:5
    CLASS:PUBLIC
    DESCRIPTION:test 4
    END:VEVENT
    END:VCALENDAR
    I hope it helps you to create your own calendar items.
    Regards,
    Dezso

  • BW Report execution from BSP application

    Hi,
    I am developing a web interface using BSP. One of the application in that is exposing BW reports in web through BSP. Using "How-To NetWeaver '04", I constructed the URL in the format -
    http://<BW Server>:<Web AS port>/sapbw/bw/BEx?sap-language=EN&bsplanguage=EN&CMD=LDOC&TEMPLATE_ID=<Template>
    This URL gives me the output and I am able to call this from my BSP application.
    But while executing this report, I am getting popup to enter user id and password. In actual scenario, user will be logging in using one of the BSP application in R3and from there there will be a link to get this report. All my other application are in R/3 (like sales order / R3 reports) and only this report is from BW. What I did is I created a BSP application in BW and provided the report link there and I called this BW BSP application from R3 BSP application. In SICF for BSP application, I have provided my user id and password.
    Everything works fine except for the popup box. This popup appears even if I try to execute directly in BW server. BSP Webpage in BW is appearing with out any issues(so my SICF for BSP is working fine) and once I click the link to my report, the popup is coming. Kindly suggest how to suppress it.
    Note:  I posted this in Portal Development also
    Thanks,
    Krish

    I solved this by creating an Alias and also by changing the SICF for Mime object under BW. 
    Thanks,
    Krish

  • Download Text file to Local drive from BSP Application

    Hi Guys,
    I am new to BSP, and I am doing a BSP application in which i want to download a text file to local drive C: on click of button. For that I am having a data in Internal table and Onclick event, in model class method DO_HANDLE_EVENT i want to download text file to local machine drive.
    Can anybody provide me full code with all data declaration and all?
    Your help would be appriciable. Thanks in Advance.

    Hi Jessy ,
    You can download the file from BSP pages using the method
    CL_BSP_UTILITY=>download.
    Please follow the below mentioned steps.
    1.Convert the text to a text table ie Internal table with a line type char255 or some others.
    2.Convert the text table into a string.
    3.Convert the string to XSTRING.
    4.Download that XSTRING as text file using the method
       CL_BSP_UTILITY=>download.
    Parameters:
    OBJECT_S    - XSTRING data
    CONTENT_TYPE  =  ' application/download'
    CONTENT_DISPOSITION = 'attachment; file=test.txt'
    RESPONSE                   = runtime->server->response
    NAVIGATION                   = navigation
    OBJECT_T
    I dont have system to give a programatical explanation to u.
    If you have any doubt kindly post.
    Reward for every useful solutions..
    Best Regards
    Renga

  • How to upload image in MIME repository  from bsp application

    Hi,
    I want to upload Image in MIME repository from my BSP Application. I want to access again or reuse uploaded image later in my BSP application. Can you please help me how to do this?
    I already go through http://help.sap.com/saphelp_nw2004s/helpdata/en/eb/8c683c8de8a969e10000000a114084/frameset.htm.
    but this is not helpful in my case. It only uploads in cache (temporary) not in MIME repository.
    Thanks

    Hi Prashant,
    In Layout...
    <%
    data: icon_save   type string.
    icon_save   = cl_bsp_mimes=>sap_icon( id = 'ICON_SYSTEM_SAVE' ).
    %>
    For using image globally...
    If you need to upload an image to MIME Repos Go to transaction se80> MIME Repository>
    sap->bc->bsp->sap->public->bc->bsp->icons ---> right click on icons folder --> import mime objects
    Regards,
    Anubhav

  • Calling web query from BSP application: Session handling

    I would like to call a BI 7.0 web query from a BSP application.
    Therefore, I generate a link like http://<server>:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=CR_M_0001_SALESFORECAST_0&VARIABLE_SCREEN=X
    Now, I have the problem that I have to log in again.
    The BSP application is embedded in the portal. SingleSignOn works for the BSP application, but not for the following link to the query.
    Anybody know how to execute the query w/o login again?

    i guess this is more related to ITS.
    which ITS are you using?
    integrated or standalone.
    i checked in both (using standard webgui service) i dont see any problem using /n or /<transaction>
    Regards
    Raja

  • Bring view from BSP application into CRM 7.0?

    How to add a custom view from a BSP application in CRM 5.0 to CRM 7.0. I tried to use it as a URL ( in transaction launcher ) and gave controller class . It does not work. Am I missing something here?

    Hello CRM_2007,
    May you please elaborate on what doesn't work?
    Do you see your link created via transaction launcher?
    Did you manage to create a link to some URL like "google.com" that is working fine, or every kink that you create doesn't work at all ?
    Kind regards,
    Nicolas Busson.

  • SESSION_MANAGER access from BSP application

    Hello there!!
    We've developed a Customer Interaction Center Z BSP application, which is used as a customer location cockpit: It's been developed over a CRM system and it performs calls to several backend transactions via ITS (which are always opened in a new Internet Explorer window, meanwhile "central BSP window" (the cockpit one) keeps always opened)...
    But we just can't reach backends SESSION_MANAGER transaction (SAP initial screen) because, when we type '/N' in backend's transaction bar, system closes Internet Explorer backend window!!
    We've tried it following several ways but, unfortunately, we always reached the same outcome: BACKEND INTERNET EXPLORER WINDOWS IS CLOSED BY THE SYSTEM (only the BSP cockpit, the non-backend window, keeps opened)...
    -No way by typing '/N' in navigation bar
    -No way by calling a Z transaction which executes a report which calls SESSION_MANAGER transaction
    -No way by using S000 transaction
    -No way by using SAPMSYST report (dynpro 0040)
    Any help would be (kindly) appreciated.
    Thanks in advance, greetings from Madrid.

    i guess this is more related to ITS.
    which ITS are you using?
    integrated or standalone.
    i checked in both (using standard webgui service) i dont see any problem using /n or /<transaction>
    Regards
    Raja

  • Callng a RFC from BSP application

    Hi Everyone,
    I am calling a RF function from a BSP function through a destination.
    The BSP application is running on a SRM server and FM is in R3 server.
    In the BSP application ,the function call has just only exporting parameters.
    No need ti return any values back.
    The destination is working fine..
    I tried for  two modes of call to RFC FM
    1. with detination
    2. with detination and background run.
    but it is not traversing into remote Fm.
    Can any one propose the solution.
    Bye,
    satish

    Hi Satish,
    there are a few things that can cause issues:
    Does the user that is used to logon to the remote system has sufficient authorization to execute the function module?
    In case you are using trusted RFC-connections has the user in the remote system sufficient authorization to log on via this trusted connection?
    Is there an authorization required to use the specified RFC-destination and if so does the user performing the call have this authorization?
    In case you want to debug into the remote system the RFC-User used for logon into the remote system needs to have authorization to execute the function module remotely, debug in the remote system and log on as dialog user.
    The use of destination executes it in synchronous mode, the use of destination + background performs the rfc asynchronously. For synchronous call always define the 2 exceptions described in the online help for RFC-calls (system_failure communication_failure) so that you can react on errors during the rfc such like the remote system not being available.
    Hope that helps to dig into this in more detail.
    Best Regards
    Michael

  • Calling of Sapscript program from BSP Application

    Hi,
       I have a requirement to display the sapscript output in PDF throgh BSP.
       In the Application program I am taking the output in PDF format.
       Now While calling the Driver program in BSP it is giving dump.
       I am using Submit 'Prog_name'  and return.
      Pls help.

    Hi Thanuja,
    You cannot call the program using SUBMIT PROGRAM in BSPs.
    You can create PDF from a Smart Form. <i>I have no idea of SAPSCRIPTS calling from BSPs.</i> You can do one thing, you can migrate your SAPSCRIPTS to SMARTFORMS and try the below code.
    You can call the the below three FMs in the following sequence.
    1)
      call function 'SSF_FUNCTION_MODULE_NAME'
        exporting
          formname           = l_form_name
        importing
          fm_name            = l_function_module_name
        exceptions
          no_form            = 1
          no_function_module = 2
          others             = 3.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    2)  call function l_function_module_name
    3)  call function 'CONVERT_OTF'
    Thanks,
    Sreekanth

  • Calling a subroutine from BSP application

    Hi
    i want to know how to call a subroutine/form in another package in same R/3 system in my BSP application.
    Is there any way to implement this. ?
    What if the subroutine has furhter LOCAL forms called inside it. will they be used as well while calling from my BSP application.
    PLease help.

    you can do that.
    perform p1 IN PROGRAM ('Y_P_TEST') IF FOUND  .
    do you have problem in doing this? what issues are you facing.
    Regards
    Raja

Maybe you are looking for

  • Itunes problems with Vista

    Has anyone run into a problem with Itunes not being able to play audio tracks from cd, and not able to import from a cd? (Using Vista Ultimate)I can play existing audio files, but not from a disc and it won't import. I have tried uninstalling vers. 7

  • WCF Error: The remote server returned an error: Not Found

    I have a windows phone8 app that utilizes a azure WCF service. I added the Servicereference to my project,when i call the service method it executes fine but getting the following error after executing: System.ServiceModel.CommunicationException: The

  • Date field - User Override

    I have a date/time field on my form that uses a FormCalc script to default to the current date, as shown below, in the Layout:Ready event: $.rawValue = Concat(Num2Date(Date(), "YYYY-MM-DD")) How do I configure this field so that it allows the user to

  • HT201210 i have locked my ipod with a passcode and cannot remember it. how can i reset it?

    i have locked my ipod with a passcode and cannot remember it. how can i reset it?

  • JDeveloper 10G Portlet Wizard Add-in

    I downloaded JDeveloper 10G as well as the Portlet Builder Wizard Add-in in order to create custom portlets for AS 10G but I cannot get the wizard to show up in the web tier list. I placed it in the correct directory. Is there anything else I should