Read PDF Formatted Spool and write PDF File to Application Server

Hi Experts,
After ECC 6.0, HR-W2 and W2C Form Spools are getting generated in PDF format.
We have a requirement wherein we want to read the PDF Spool Programatically and write the PDF file to Application server (Using OPEN DATASET and CLOSE DATASET)
PARAMETERS : p_spono LIKE tsp01-rqident.
DATA: pdf_data type FPCONTENT.
types: lt_pdf_table(1000) type x.
data:  l_pdf_data type standard table of lt_pdf_table,
       l_pdf_line type lt_pdf_table,
       l_offset type i,
       l_len type i,
       p_file(100) VALUE '\sapout\DVH\pdf2.pdf'.
*Read the spool content
CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
    EXPORTING
         i_spoolid = p_spono
         i_partnum = '1'
    IMPORTING
           e_pdf = pdf_data
*         e_pdf_file = file
    EXCEPTIONS
         ads_error = 1
         usage_error = 2
         system_error = 3
         internal_error = 4
    OTHERS = 5.
* Modify the spool  contents to prepare internal table
  l_len = xstrlen( pdf_data ).
  while l_len >= 1000.
    l_pdf_line = pdf_data+l_offset(1000).
    append l_pdf_line to l_pdf_data.
    add 1000 to l_offset.
    subtract 1000 from l_len.
  endwhile.
  if l_len > 0.
    l_pdf_line = pdf_data+l_offset(l_len).
    append l_pdf_line to l_pdf_data.
  endif.
* GUI DOWNLOAD Works Fine
* Now pdf contents is ready , lets store in local PC
*CALL FUNCTION 'GUI_DOWNLOAD'
*  EXPORTING
*   filename                        = 'C:\Documents and Settings\Desktop\shital.pdf'
*   filetype                        = 'BIN'
*  TABLES
*    data_tab                        = l_pdf_data.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc <> 0.
  MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
          ' Error opening file:'(Z03) p_file.
ENDIF.
LOOP AT l_pdf_data INTO l_pdf_line.
  TRANSFER l_pdf_line TO p_file.
ENDLOOP.
CLOSE DATASET p_file.
IF sy-subrc <> 0.
  MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
          ' Error closing file:'(Z04) p_file.
ENDIF.
Currently as you can see I have commented out GUI_DOWNLOAD Function Module, But it works perfect when I try to Download file to Local Desktop.
But when I try to pass the same Contents to Application server file and then try to open it by downloading file then it opens BLANK pdf file.
As per requirements I should be able to write the file correctly on Application server and If I dowload it from there it should open PDF file correctly.
Let me know if you require further details about the issue.
Regards
Shital
Edited by: shital phadake on Apr 8, 2009 9:39 PM

Thanks Selçuk for your reply and taking time for understanding the Issue,
I went thru Functionality of the program you suggested but dont think it matches my requirement.
Regards
Shital

Similar Messages

  • Problem of Delete and Overwrite XLS file on Application Server

    Hi Experts,
         I want to transfer file on application server using below code and try to delete after successfully transfer on application file to other location.
    I have problem during deleting file and overwrite file.
    DATA: G_S_FILE TYPE EPSFILNAM,
          G_S_DIR  TYPE EPSDIRNAM,
          G_T_FILE TYPE EPSFILNAM,
          G_T_DIR  TYPE EPSDIRNAM.
    DATA : DELFILE(60).
      G_S_FILE = '1400000051.XLS'.
      G_S_DIR  = '\\Dev\PO\'.
      G_T_FILE = '1400000051.XLS'.
      G_T_DIR  = '\\Dev\PO\bkup'.
      DELFILE = '\\Dev\PO\1400000051.XLS'.
      CALL METHOD CL_CTS_LANGUAGE_FILE_IO=>COPY_FILES_LOCAL
        EXPORTING
          IM_SOURCE_FILE           = G_S_FILE
          IM_SOURCE_DIRECTORY      = G_S_DIR
          IM_TARGET_FILE           = G_T_FILE
          IM_TARGET_DIRECTORY      = G_T_DIR
          IM_OVERWRITE_MODE        = 'S'
        EXCEPTIONS
          OPEN_INPUT_FILE_FAILED   = 1
          OPEN_OUTPUT_FILE_FAILED  = 2
          WRITE_BLOCK_FAILED       = 3
          READ_BLOCK_FAILED        = 4
          CLOSE_OUTPUT_FILE_FAILED = 5
          OTHERS                   = 6.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      OPEN DATASET DELFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DELETE DATASET DELFILE.
      ELSE.
        WRITE / 'File not found'.
      ENDIF.
    Thanks,
    Himanshu Patel.

    Write a Java program using Apache POI that reads in a tab delimited file and outputs an xls file (in what they call Horrible Spread Sheet Format. Create your tab delimited file and then run your Java program using appropriate OS commands.
    Jelena Perfiljeva wrote:
    In all honesty, I find it hard to believe other application can't accept any other format. It's actually seems rather unreasonable to expect an ERP system to create a file in an outdated format of a desktop software. Even Excel itself can open many formats, so this just doesn't make any sense.
    This.
    Unless you can explain exactly why the destination must be xls and no other format is acceptable, I'm going to close the thread. What is this third party tool? Why can it only read the obsolete xls file format.
    I'm going through this thread and rejecting all the responses that attempt a solution that isn't xls.
    I'm surprised that the OP thought that simply saving with an xls file extension would cause some magic to happen and produce an actual Excel file.

  • Change character set used to write a file in application server.

    Hello Experts,
                       I want to know if we can change the character set used to create a file in application server.(Is it posible to use a particular character set while creating a file in application server.
                      I will be very great full for any help.
    Thanks in advance.
    Sharath

    Hello Sarath,
    There is an extension CODE PAGE with OPEN DATASET stmt.
    Can you please elaborate which character set you want to write to the application server?
    BR,
    Suhas

  • Write XML file in application server

    Experts,
    I'm using a transformation to generate a xml file:
      CALL TRANSFORMATION zdatafechomes
      SOURCE ficheiroexecucao = gt_source[]
      RESULT XML  xml_result.
    It's working fine. But i'm having problems in putting the "xml_result" (it's a type xtring) into the application server.
    Anyone knows how to do it ? Transaction cg3z it's different because the file comes from C:
    Best Regards,
    Mário.

    Hello Mario
    I do not see why the following logic should not work:
    *& Report  ZUS_SDN_XML_XSTRING_APPLSERVER
    REPORT  ZUS_SDN_XML_XSTRING_APPLSERVER.
    DATA:
      gd_dsn            type string,
      gd_xstring        type xstring,
      gt_kna1           type STANDARD TABLE OF kna1.
    start-of-selection.
      select * from kna1 into table gt_kna1 up to 10 rows.
      BREAK-POINT.
      call TRANSFORMATION id
        source itab = gt_kna1
        result xml = gd_xstring.
        gd_dsn = '/tmp/xml_as_xstring.file'.
        open DATASET gd_dsn for OUTPUT in BINARY MODE.
        check ( syst-subrc = 0 ).
        TRANSFER gd_xstring to gd_dsn.
        CLOSE DATASET gd_dsn.
    end-of-SELECTION.
    Regards
      Uwe

  • OPEN DATA SET to write files in application server folder - some of the files are missing

    Hi,
    I'm using OPEN DATASET statement in batch job to write the files in application server. what i'm experiencing is when i schedule the batch job all the files are not writing into the folder.
    If i run the report again to write the missed files, the files are writing into the application server folder.
    after opening the dataset, i'm closing it. do we need to give any delay between creation of the files? or until the first write operation is done, 2nd one can't start ..how can we achieve this.
    Thanks for your help in advance.
    Thanks,
    Adi.

    Hello Bathineni,
    Are you using the sy-subrc check after the OPEN DATASET statement.
    If not use a sy-subrc check and transfer the contents to file only when the OPEN DATASET returns value sy-subrc = 0.
    if sy-subrc is 8 repeat the same loop say for 3 attempts until the OPEN DATASET becomes 0.
    DO 3 TIMES. <---- put any number of attempts as you need
    OPEN DATASET.
    IF sy-subrc = 0.
       TRANSFER contents to file.
       EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET.
    Regards,
    Thanga

  • How to search file in application server using pattern

    Hi all,
    I want to search file in application server.
    Suppose there is file named abc20090808.dat.
    Is there is any function module to search the file?
    it should return back the file names starting with abc, if the import parameter is abc*
    Regards,
    Nikhil

    hello,
                 Have a look
            You can use this function module /SAPDMC/LSM_F4_SERVER_FILE for F4 help for application server file and then you can use the function module TEXT_CONVERT_XLS_TO_SAP to read data into internal table.
      access file from application server
    regards,
    shweta

  • Download text file from application server to client server.

    Hi all,
    I am facing a format issue while downloading text file from application server to the client machine.
    The issue is that, say I have 6 to 10 lines in my text file in application server. but when i store it on the hard drive,
    it shoes all the data in a single line. Where as i need to download data in same format as in application server.
    Awaiting for your responses.
    Regards,
    Jose

    Hi,
    If we want to upload file data from the application server to the internal table, there is no function module or class static method which we can use, we must wirte the code by ourselves.
    1. For the file data which has no seperator between field columns.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_data.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.2. For the file data which has tab separator between field columns.
    DATA: gds_field_split type gts_data.
    FIELD-SYMBOLS: <fs_field> TYPE gts_data.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET prf_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_field.
        SPLIT gds_field  AT cl_abap_char_utilities=>horizontal_tab
             INTO TABLE gdt_field_split.
       LOOP AT gdt_field_split  into gds_field_split.
           gdf_index = gdf_index + 1.
           ASSIGN COMPONENT gdf_index OF STRUCTURE
                 gds_data to <fs_field>.
          IF sy-subrc = 0.
              <fs_field> = gds_field_split.
          ENDIF.
       ENDLOOP.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.
    Thanks & regards,
    ShreeMohan

  • Can any one tell me how to write open hubs to application server?

    Hello Everone,
    I created open hubs and my requirement is to write the file to application server. So, I created logical file name and logical paths as specified in below link.
    http://help.sap.com/SAPHELP_NW04S/helpdata/EN/8d/3e4ec2462a11d189000000e8323d3a/frameset.htm
    That is created 'logical file path defination' in 'FILE' transaction. Used the physical path as - 'bw/FTPOUT/BPR/GM/<FILENAME>' as given in above link..
    In logical file name I used the above logical file path.
    When I run the open hub, I'm getting the ABAP dump  "UNCAUGHT_EXCEPTION
    CX_RSB_WRITE_ERROR
    12/18/2008 09:00:40"
    Can any one tell me how to write open hubs to application server?

    Hi David,
    Goto transaction code - FILE
    1) Create a Logical File Path definition, enter the technical name and description by clicking new entries and save it.(z_ftp)
    2) create a Logical file name definition using cross client,
        enter the logical file name = z_ftp , name = ftp , physical file = ftp_test.txt,
    dataformat = ASC, Appln area = BW and Logical path = z_ftp(created from step 1).
    click SAVE button.
    3) Assignment of physical paths to logical paths, choose your logical path here.
    enter the syntax group = UNIX
    Physical path = /bwftp/....
    Save it .
    In the openhub,
    choose definition type = file
    Check the applicaion sever.
    servername = dev
    type of file name = Logical file
    Applin server file name = z_ftp
    separator = |
    Hope this helps and solve your problem.
    Thanks
    Sat

  • Transfering data from bsis table to file on application server

    Hi Gurus,
    In my program iam selecting data from bsis table and transferring to file on the application server.
    Code:
    Tables: BSIS.
    data: file type rlgrap-filename.
    Select * from BSIS into BSIS.
    Open dataset output in text mode encoding default.
    Transfer bsis to file.
    closesdataset.
    1, Issue when transferring iam getting dump due to type conflict.
    2, Here I cant create a structure like bsis and define type c  
        varialbles as its an upgrade project.
    3, I tried field-symbols using type casting but data in the
        application server is showing junk data with ##### in currncy
        fields.
    4, In earlier program there is no internal table defined for bsis,
        Directly passing to work area and transferring to file on
        application server.
    Please let me know any feasble solution to approach.
    If need i can post the complete code.
    Regards
    Bhaskar

    Hi Robert,
    Here is my code....in ECC. While executing program is going to dump saying character type error.
    tables: bsis.
    data: begin of i_tab occurs 100.
            include structure bsis.
            end of i_tab.
    parameters: outfile(1000) lower case.
    open dataset outfile for output in text mode encoding default
    ignoring conversion errors..
    select * from bsis into table i_tab
    where bukrs = bukrs.
       loop at i_tab.
          transfer i_tab to outfile.
       endloop.
      close dataset.
    Please let me know if any soluton.
    regards
    Bhaskar

  • How do I migrate files created in a Windows OS to a new external drive that is formatted as a MAC drive. I want to read and write these files back to the new drive.

    How do I migrate files from an external hard drive created in a Windows OS to a new MAC external drive? I want to read and write these files to the new drive.

    LKrzesowski wrote:
    How do I migrate files from an external hard drive created in a Windows OS to a new MAC external drive? I want to read and write these files to the new drive.
    If all you're trying to do is move the files from the Windows external to the Mac external, you can simply connect them both to the Mac and drag the files from the Windows drive to the Mac drive. If you want to move the files back and forth between them, you'll need to establish the format of the Windows external. Macs can read and write to FAT32 and exFAT (which can handle files larger than 4GB) formatted drives but can only read NTFS formatted drives without additional software. With the Windows drive connected, you can check its format with Disk Utility.

  • Write PDF file into application server.

    Hi Gurus,
    I have created a smartform and converted into PDF using function module as given below. Now I want to write this generated PDF file into application server. I am not generating any spool request too. How can I proceed from here?  Pls advice..
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize                 = lv_bin_filesize
        TABLES
          otf                              = ls_job_output_info-otfdata
          doctab_archive         = lt_docs
          lines                           = lt_lines
        EXCEPTIONS
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 2
          OTHERS                 = 3.
    Thanks..
    Saj

    transfer all the data from ur itabs to one final itab declared as follow
    DATA: BEGIN OF final_itab OCCURS 0,
                     document  TYPE string,
               END OF final_itab.
    then finally,
    OPEN DATASET 'yourfile.pdf' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      len = strlen( final_itab-DOCUMENT ).
      TRANSFER final_itab-DOCUMENT  TO 'yourfile.pdf'  LENGTH len.
    CLOSE DATASET 'yourfile.pdf'.
    This ends the coding mate.
    Enjoy it n have a good day.
    Cheers

  • File Read and Write using File Adapter in Bpel

    In Bpel Process i am using File Adapter ( Schema is Opaque) for read and write the file contents. i am able do successful deployment and read, write function in first time deployment, after that again i tired to run the application, its not going to write the content of file, its only writing the file with out data's or content in that file.
    Please help me...
    Saravanan

    Hi Eric
    In my domain.log file having the following details. In this file im unable to find out what the exact problem. Please look at this and help me.
    <2008-01-22 18:25:42,024> <INFO> <default.collaxa.cube.compiler> validating "C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\tmp\.bpel_BPELProcess2_1.1_298e83988d77b6640c33dfeec11ed31b.tmp\BPELProcess2.bpel" ...
    <2008-01-22 18:25:49,850> <INFO> <default.collaxa.cube.engine.deployment> <CubeProcessFactory::generateProcessClass>
    Process "BPELProcess2" (revision "1.1") successfully compiled.
    <2008-01-22 18:25:49,914> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Loading JCAActivationAgent for {portType=Read_ptt}
    <2008-01-22 18:25:49,914> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::load - Locating Adapter Framework instance: OraBPEL
    <2008-01-22 18:25:49,930> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::load - Done loading JCAActivationAgent for processId='bpel://localhost/default/BPELProcess2~1.1/
    <2008-01-22 18:25:49,930> <INFO> <default.collaxa.cube.engine.deployment> Process "BPELProcess2" (revision "1.1") successfully loaded.
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::uninit Shutting down the JCA activation agent, processId='bpel://localhost/default/BPELProcess2~1.0/', activation properties={portType=Read_ptt}
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - performing endpointDeactivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Endpoint De-activation called in adapter for endpoint : D:\MAXIMUS_Project_Softwares\jdevstudiobase10132\jdev\mywork\MyLabs\BPELProcess2\in
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::init - Initializing the JCA activation agent, processId='bpel://localhost/default/BPELProcess2~1.1/
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and initializing inbound JCA endpoint for:
    process='bpel://localhost/default/BPELProcess2~1.1/'
    domain='default'
    WSDL location='rd.wsdl'
    portType='Read_ptt'
    operation='Read'
    activation properties={portType=Read_ptt}
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - endpointActivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,730> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Endpoint Activation called in File Adapter for endpoint: D:\MAXIMUS_Project_Softwares\jdevstudiobase10132\jdev\mywork\MyLabs\BPELProcess2\in
    <2008-01-22 18:26:02,730> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - successfully completed endpointActivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,890> <WARN> <default.collaxa.cube.activation> <File Adapter::Inbound> PollWork::run exiting, Worker thread will die
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Managed Connection Created
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Connection Created
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> FileInteraction Created

  • I'm trying to share folder between users on a single mac.  I put the folder in "shared," set permissions so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    I'm trying to share a folder between users on a single mac.  I want both users to be able to read and write so the folder stays current on both accounts.  I put the folder in "shared," set permissions on folder so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    Did you log out of one account and into the other or just used Fast user switching?
    Is the permissions set to anyone?
    When you move data to teh Shared folder is it copied or just moved?
    If copied then it's not a folder both can access, just a way station like a USB thumb drive that things are coped too and off of likely.
    You can run this #5 on each user account to reset the user permissions once they are taken back out of the Shared folder
    Step by Step to fix your Mac

  • To access pdf files from application server using web.show_document

    Hello!
    If my pdf file is copied in Oracle_home/forms90/java directory.Then using web.show_document i can access the pdf file.But I can't copy all the pdf files in /forms90/java directory.We have lacs of pdf files which I want to keep in my own directory.But my requirement is if my pdf file is in /home2/docs directory in (Linux application server) ie in my own directory where I store all the pdf files.Then web.show_document does not open the pdf file.It says page cannot be displayed.For that I think we have to configure the directory /home2/docs directory as a webserver.From otn I got something like forms90.conf file in application server where we have to set virtual directory mapping etc.If the pdf is in local machine then in orion-web.xml file we have to mention real path and save the file and shutdown oc4j instance and restart it again.I tried it.But it is not working.Can u give me step by step instructions to solve this problem.I found a few links in discussion forum.But is doesn't work out.My pdf file is in /home2/docs directory in Linux application server.Please treat it as urgent.
    Regards
    Jayashree

    Hi Sandeepmsandy,
    There is no available code sample for this scenario. You may write your own.
    Step 1: Get pdf URL from sqlite database. Please refer to the following MSDN blog and see a code sample.
    http://blogs.msdn.com/b/robertgreen/archive/2012/11/13/using-sqlite-in-windows-store-apps.aspx. Note, you need to retarget the project to 8.1 and then get two sqlite packages from NuGet before building this sample.
    Step 2: Use some special classes to get file from serer.
    HttpWebRequest can help download small pdf files. For more information to see
    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/de96a61c-e089-4595-8349-612be5d23ee6/download-file-with-httpwebrequest?forum=winappswithcsharp. It’s easy for use, but if you want to download the larger or many files, it’s recommend to use
    BackgroundTransfer namespace. The classes in this namespace provide a power way to transfer files in the background. See a code sample from MSND.
    https://code.msdn.microsoft.com/windowsapps/Background-Transfer-Sample-d7833f61.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Error in PDF Conversion while downloading file from application server

    Hi,
    I am facing a problem in which i have to download file from application server which is a PDF file (output of SAP Script). I am downloading this file using following code in BSP technology:
    * event handler for data retrieval
    EMPCD = REQUEST->GET_FORM_FIELD( 'emp' ).
    MONTH = REQUEST->GET_FORM_FIELD( 'mn' ).
    YEAR  = REQUEST->GET_FORM_FIELD( 'yr' ).
    W_IND = 'N' .
    DATA : wa_zform16 type  zform16.
    DATA : file_path type string.
    DATA : l_pdf_len type string.
    DATA STR TYPE STRING.
    DATA: OUTPUT    TYPE STRING ,
          L_XSTRING TYPE XSTRING ,
          APP_TYPE  TYPE STRING.
    DATA: PDF_TABLE TYPE  RCL_BAG_TLINE.
    DATA PHY_NAME_OUT     TYPE SAPB-SAPPFAD.
    concatenate '/usr/sap/put/form16/' EMPCD '_' YEAR '.PDF'  into file_path
    *PHY_NAME_OUT = '/usr/sap/put/form16/01000200_2007.PDF'.
    PHY_NAME_OUT = file_path.
    OPEN DATASET PHY_NAME_OUT FOR INPUT IN TEXT MODE ENCODING default.
    IF SY-SUBRC IS INITIAL.
      DO.
        READ DATASET PHY_NAME_OUT INTO STR.
        IF SY-SUBRC IS INITIAL.
          CONCATENATE
              OUTPUT
              STR
              CL_ABAP_CHAR_UTILITIES=>CR_LF
          INTO OUTPUT.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      APP_TYPE = 'APPLICATION/PDF'.
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          TEXT     = OUTPUT
                MIMETYPE = 'APPLICATION/PDF'
    *            MIMETYPE = 'APPLICATION/PDF;charset=utf-16le'
        IMPORTING
          BUFFER   = L_XSTRING.
      CALL METHOD CL_BSP_UTILITY=>DOWNLOAD
        EXPORTING
          OBJECT_S            = L_XSTRING
          CONTENT_TYPE        = APP_TYPE
          CONTENT_DISPOSITION = 'attachment;filename=webforms.pdf'
          RESPONSE            = _M_RESPONSE
          NAVIGATION          = NAVIGATION.
    Result of this code is : there is a pop up asking to open or save pdf format and process is complete, but i have problem in downloaded file.
    At the time of creation i have put BMP image for signature in PDF file and it is working fine but when i upload that file in Application server and then download it with above used code it save the PDF file but when i open that file so whereever i have used signature that page gives error and could not display that scanned signature.
    Can anyone please help me in this regard.
    or is there any possibility from which i can download that file just like File transfer from BSP.
    Keep in mind that i am using BSP technology so all GUI based function module to download file are not working.
    waiting for your reply.....
    Regards,
    Gagan

    Hi Raja,
    I have standard sap form for TDS Certificate on which i have include an BMP image for digital signature and download that script into pdf format.While i download that PDF looks ok but it is not working in BSP.
    Regards,
    Gagan

Maybe you are looking for

  • SSO and JavaScript

    Hi all, does any one of you know about any restriction or any other issue involving SSO and JavaScript? We have a web app in an OC4J instance, which uses JSP and JavaScript. When SSO is disabled for the application, everything goes well. But when SSO

  • Merging Broadband and Phone Accounts

    New to the Forum. I hope someone can advise. I have old BT Yahoo Broadband and am currently paying around £26.00 per month for the privilege. I spoke to BT about getting a better deal early last year and was placed on a less expensive contract, but w

  • Need help with HR_INFOTYPE_LOG_GET_DETAIL, before/after tables

    Greetings experts: I've searched SDN for assistance with this question before posting but haven't been able to find anything to address my specific question which is, how do I "convert" the data that is in the before and after tables returned by this

  • Forgot to assign Cost center for one of the GL account and positing are don

    Hi All, I have created GL account but forgot to assign Cost center to that GL, now some 1000 documents are posted in that account, what is the best way to resolved this problem. your respond is appreciated. Thanks, Supriya.

  • Speech recognition not working

    I have an iPhone 5 and for several months, no form of speech recognition has worked, whether for Siri or, for example,  voice dictation when sending text messages, Whenever I try to use the feature, the line does not wave at all, as though the mic is