PDF from bsp application

Dear All,
I am new to this blog.
I currently working on BSP's.  My requirement is like below.
In my company portal, when an employee logins to portal under ESS tab,
he can get Employee verification letter ( PDF ) from his manager under whom he is working.  This PDF he can print and get the signature from his manager.
On first page he will have 3 questions ...
1) Whether you want base salary in letter ( PDF )  . answer: Yes or No radio button
2)  Whether you want ssn  number in letter ( PDF ) answer: Yes or No radio button
similarly third quesion.
When employee clicks on print preview button on the same page,  then he will get PDF form with follwing matter:
Company  Name,
addresses, Logo,
Mr XXXXXXX is our employee since. His SSN no.......
XYZZZZ
Hr Manager,
Pls let me know how to solve the above.
I got an RFC for my BSP for getting employee details.  my question is how work on above in BSP.
Regards,
Kishan

Hi Sharmila ,
Thanks for reply.
I tried with smart form.
I created a smartform with only one text on smartform for just testing.
    i developed the BSP application .  when i press the butten "printpreview' on first page it should open PDF page with out put of smart form.
the code is as below... but it is not working...it is not giving any result.. just remains in first page.
generated result: PDF format
  data: l_pdf_xstring  type xstring,
        lt_lines       type table of tline,
        ls_line        type tline,
        l_pdf_len      type i.
  data: output_options      type ssfcompop,
        control_parameters  type ssfctrlop,
        output_data         type ssfcrescl,
        devtype             type rspoptype.
  data: lt_sys type table of mara.
  DATA: cached_response TYPE REF TO if_http_response.
  DATA: guid TYPE guid_32.
data : runtime type c.
  DATA : display_url type string.
DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD.
  control_parameters-langu = sy-langu.
  control_parameters-no_dialog = 'X'.
  control_parameters-getotf    = 'X'.
  select * from mara into table lt_sys.
  call function 'SSF_GET_DEVICE_TYPE'
    EXPORTING
      i_language             = sy-langu
    IMPORTING
      e_devtype              = devtype
    EXCEPTIONS
      no_language            = 1
      language_not_installed = 2
      no_devtype_found       = 3
      system_error           = 4
      others                 = 5.
set device type in output options
  output_options-tdprinter = devtype.
  CALL FUNCTION '/1BCDWB/SF00000010'
    EXPORTING
     CONTROL_PARAMETERS         = control_parameters
     OUTPUT_OPTIONS             = output_options
     USER_SETTINGS              = space
     ZTRNO                      = '5657'
   IMPORTING
     JOB_OUTPUT_INFO            = output_data
   EXCEPTIONS
     FORMATTING_ERROR           = 1
     INTERNAL_ERROR             = 2
     SEND_ERROR                 = 3
     USER_CANCELED              = 4
     OTHERS                     = 5
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  call function 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
    IMPORTING
      bin_filesize          = l_pdf_len
      bin_file              = l_pdf_xstring
    TABLES
      OTF                   = OUTPUT_DATA-OTFDATA
      LINES                 = LT_LINES
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      err_bad_otf           = 4
      others                = 5.
  if sy-subrc EQ 0.
    CREATE OBJECT cached_response TYPE CL_HTTP_RESPONSE EXPORTING add_c_msg = 1.
    l_pdf_len = xstrlen( l_pdf_xstring ).
    cached_response->set_data( data   = l_pdf_xstring
                        length = l_pdf_len ).
    cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                       value = 'application/pdf' ).
    cached_response->set_status( code = 200 reason = 'OK' ).
    cached_response->server_cache_expire_rel( expires_rel = 180 ).
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        ev_guid_32 = guid.
    CONCATENATE  'runtime->application_url' '/' guid '.pdf' INTO display_url.
    cl_http_server=>server_cache_upload( url      = display_url
                                         response = cached_response ).
  ENDIF.
  RETURN.

Similar Messages

  • 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(....)

  • Can't Print to PDF from any application in Windows 8 with Acrobat V8

    Can anyone help me?  Adobe doesn't prvoide support for Acrobat 8 anymore.  I used to be able to print to Adobe PDF from other applications before I upgraded to Windows 8.  Now it never works, just gives me an error message that says "printer is in error state."  I am using Acrobat V8.0.0.  Thank you for any help you can give.

    Acrobat 8 is not compatible with Windows 8, so such errors are to be
    expected.

  • 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

  • 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.

  • 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

  • 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

  • Download internal table from BSP application to C:\ drive of the user

    Hi,
    How do we download a internal table data from a BSP application to the C:\ drive of the user. Have tried GUI Download, but it doesn't work. Also don't want a pop up to appear while this is happening. The code has to there in 'OnInputProcessing' event.
    Regards,
    Jaison

    Hi Raja,
    I went through few of the blogs and wrote the below code for downloading data. My requirement is that in the InputProcessing event i need to write a subset of data to the users C:\ drive. But even after doing the below change i'm unable to get the requirement done. Can you please tell me as to what i'm missing. I'm new to BSP development and help would be highly appreciated.
    if not it_messages1[] is initial.
      clear wa_messages1.
      loop at it_messages1 into wa_messages1.
       clear temp_string.
       concatenate wa_messages1-PROJECT wa_messages1-FILENAME.......
       into temp_string separated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
       concatenate main_string temp_string into main_string separated by
       CL_ABAP_CHAR_UTILITIES=>CR_LF.
      endloop.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
      EXPORTING
        TEXT                 = main_string
        MIMETYPE        = 'APPLICATION/MSEXCEL;charset=utf-16le'
      ENCODING       =
    IMPORTING
       BUFFER         =  xmain_string.
    EXCEPTIONS
      FAILED         = 1
      OTHERS         = 2
    CALL METHOD cl_bsp_utility=>download
    EXPORTING
        object_s = xmain_string
        content_type = 'APPLICATION/MSEXCEL;charset=utf-16le'
        content_disposition = 'attachment;filename=test.xls'
        response = mresponse
        navigation = navigation.
    Edited by: Jaison Yohannan on Jun 3, 2009 2:16 PM

  • Download File from BSP-Application

    Hello !
    i hope i can get some help for my problem.
    from my BSP-Application i want to download an internal table to p:\eigenedateien\bv.txt (always the same filename)
    the internal table ist type table of string.
    i read that gui_download doesn't work in my BSP
    so i went through this weblog 756
    but it is really hard.
    i put some code from the weblog in my application:
    concatenate 'attachment; filename='
    w_para-pwert = p:\eigenedatieen\bv.txt
                w_para-pwert into dl_pathfile.
    Download der Datei
    Create the cached response object that we will insert our content into
    dl_xstring = 'Test'. "nur zum testen
                CREATE OBJECT CACHED_RESPONSE TYPE CL_HTTP_RESPONSE
                       EXPORTING ADD_C_MSG = 1.
    set the data and the headers
                CACHED_RESPONSE->SET_DATA( DL_XSTRING ).
                CACHED_RESPONSE->SET_HEADER_FIELD( NAME  =
                                        IF_HTTP_HEADER_FIELDS=>CONTENT_TYPE
                                                   VALUE = 'text/html' ).
    Set the filename into the response header
           CACHED_RESPONSE->SET_HEADER_FIELD( NAME  = 'Content-Disposition'
                                       VALUE = DL_PATHFILE ).
    Set the Response Status
                CACHED_RESPONSE->SET_STATUS( CODE = 200 REASON = 'OK' ).
    Set the Cache Timeout - 60 seconds - we only need this in the cache
               CACHED_RESPONSE->SERVER_CACHE_EXPIRE_REL( EXPIRES_REL = 60 ).
    Create a unique URL for the object
                CALL FUNCTION 'GUID_CREATE'
                  IMPORTING
                    EV_GUID_32 = GUID.
                CONCATENATE RUNTIME->APPLICATION_URL '/' GUID INTO URL.
    Cache the URL
                CL_HTTP_SERVER=>SERVER_CACHE_UPLOAD( URL      = URL
                                               RESPONSE = CACHED_RESPONSE ).
    Ende Download
    now it should be cached.
    but hot can i start the download to p:\eigenedateien... now?
    thanks very much for your help
    Helmut

    Hi,
    Could you try adding at the end:
    navigation->response_complete( ).
    and/or
    data: guid type guid_32,
          display_url TYPE string.
    call function 'GUID_CREATE'
    importing
    ev_guid_32 = guid.
    concatenate runtime->application_url '/' guid into display_url.
    cl_http_server=>server_cache_upload( url = display_url response = cached_response ).
    Best regards,
    Guillaume
    Message was edited by: Guillaume Garcia

  • To Display PDF from BSP

    Hi,
    Im calling a method in my BSP application which gives me PDF output.
    CALL METHOD ref->******
      EXPORTING
        lv_vbeln      = lv_vbeln
      IMPORTING
       l_header      = l_header
       wa_head_right =
       message       =
       l_vbeln_text  =
       with_hold     =
       with_hold_n   =
       g_flag        =
       l_pricekey    =
         formout  = formoutput.
    My formoutput-PDF has the xstring, and to call this PDF file i have written the below code
    l_pdf_xstring = formoutput-pdf.
    CREATE OBJECT cached_response TYPE cl_http_response
                            EXPORTING add_c_msg = 1.
    data = l_pdf_xstring.
    l_pdf_len1 = XSTRLEN( l_pdf_xstring ).
    CALL METHOD cached_RESPONSE->SET_CONTENT_TYPE
      EXPORTING
        CONTENT_TYPE = 'application/pdf'.
    cached_response->set_cdata( data   = data
                                length = l_pdf_len ).
    CALL METHOD cached_response->if_http_response~set_status
      EXPORTING
        code   = 200
        reason = 'OK'.
    CALL METHOD cached_response->if_http_response~server_cache_expire_rel
      EXPORTING
        expires_rel       = 180.
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        ev_guid_32 = guid.
    v_guid = guid.
        call method cl_http_ext_csif=>access_info_get
          changing
            crep_http = lv_crep_http
          exceptions
            failed    = 1
            others    = 2.
        if lv_crep_http-http_port is not INITIAL.
          write lv_crep_http-http_port to lv_crep_http-http_port no-zero.
        else.
          write lv_crep_http-http_sport to lv_crep_http-http_sport no-zero.
        endif.
    CONCATENATE runtime->application_url '/' v_guid '.pdf' INTO display_url.
    cl_http_server=>server_cache_upload( url      = display_url
                                         response = cached_response ).
        if lv_crep_http-http_port is not INITIAL.
          concatenate 'http://' lv_crep_http-http_serv ':'
          lv_crep_http-http_port display_url into display_url.
        else.
          concatenate 'https://' lv_crep_http-http_serv ':'
          lv_crep_http-http_sport display_url into display_url.
        endif.
        data: lv_url1 type string.
        lv_url1 = display_url.
    When I open the generated link, its giving that my PDF file is damaged or cannot be displayed. I have found the same code in many forums, its not working in this particular program. Please help me out with this.
    Thanks in advance.

    With the help of some other posts and blogs.. am able to display the pdf now.
    However, the default magnification(zoom) is always 44.5%. Any ideas as to how this can be increased or set to a default value.
    Sri

  • 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.

  • Can not print to PDF (From any application)

    I print to PDF's on a regular basis, and my mac has stopped me randomly from having that function.
    When I go to Print from any application, and select "Adobe PDF 7.0" from the Printer drop down an grey stop/error sign appears next to that drop down.
    Then the print queue appears with a red error and the item that i was printing gives a status of "-" and the comment of "Jobs Stopped"
    If I press the "Start Jobs" button I get a progress bar and the status changes to "Printing" ... the progress bar doesn't move and then the status returns to "-" and the item remains un-printed in the queue.
    Please help.
    Thanks.
    MacBook Pro 2.16 GHz Intel Core Duo   Mac OS X (10.4.8)  

    I managed to fix the problem by deleting the folder "com.adobe.print.AdobePDF7" from /Library/Preferences/
    And printed to a PDF

  • Printing to acrobat pdf from other application in Leopard

    Hi,
    I've upgraded to Leopard and to Adobe CS3. Whenever I want to print from any application to Acrobat pdf (for instance from Word 04), the acrobat printer pauses and the pdf is not created.
    Is this one of the known issues that will be fixed when Adobe releases the Leopard-proof update of CS3?
    Thanks,
    johan

    Is the ESR version of Mozilla Firefox?  If not, then try that version to see if the issue persists. 
    BTW the ESR version of Mozilla Firefox IS the supported version of Mozilla Firefox.
    http://www.adobe.com/products/acrobatpro/tech-specs.html
    Internet Explorer 7, 8, 9, or 10; Firefox Extended Support Release; or Chrome

Maybe you are looking for

  • I can not see all "Divisions" in BP Rel.--Partner Function Assignment

    Hi, When I edit "Partner Function Assignment" in BP reliationship such like BUR011("Employee Responsible"), I can not see all "Divisions" in list which I can see in configuration via SPRO-->Customer Relationship Management->Master Data->Orgnizational

  • Any way to display a message when Flash is not found on the iPad?

    Apple is obviously rejecting Flash to protect it's 'App' revenue.  I've  been on Android phones that run Flash and display all my content  perfectly smooth.  It can be quite frustrating how they are trying to  bury it when I still have yet to see HTM

  • Unable to log-in to Lync 2013 on my Samsung Note 3

    I have been using Lync (first with 2010 and then with 2013) for almost 2 years now.  The latest phone that I installed the app on was my Samsung Galaxy Note 3.  The app worked just fine for about 2 months and then all of a sudden, it will not sign in

  • Why can I no longer scroll with the mouse when using Pages?

    A few days ago, I realized that I am unable to scroll within a Pages document with the mouse.  The scroll bar is not there.  The scroll feature works fine, and after trying to figure this out myself with no success, I thought I'd ask here.  I have Pa

  • JCO.SERVER could not find the server function

    Hi, I am calling "BAPI_COMPANY_GETDETAIL".thuough the zprogram"ZBAPI_COMPANY_GETDETAIL" REPORT ZBAPI_COMPANY_GETDETAIL. DATA:BEGIN OF ITAB, RCOMP LIKE T880-RCOMP, END OF ITAB. ITAB-RCOMP = 99999. CALL FUNCTION 'BAPI_COMPANY_GETDETAIL' EXPORTING COMPA