PDF to binary: Scenario R/3 to MQSeries

The JMS adapter transfers the message payload from and to the MQSeries whithout any change.
I am not sure, what you want to have as result, when you mention "binary".
Any file is binary, even an XML file
The next question is: When you read a PDF, what do you want with it?
The easiest thing is, sending the PDF through PI to MQSeries without any change. Then you receive just the original PDF.
Regards
Stefan

Hi
check this thread
spool to pdf conversion
It looks like you are missing translate in you processing of the table t_pdf. Something like the following line is missing:
TRANSLATE gd_buffer USING '~ '.
Loo at the standard program RSTXPDFT4 as well. It converts spool to PDF and then you can download it to your desktop.

Similar Messages

  • How to convert pdf  to binary

    hi all,
       how to convert pdf  to binary .
    regards,
    sheetal

    refer this -
    http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XSTRING_TEXT_CONVER.html

  • PDF to Binary

    Hi,
    I create a Adobe Interactive Form, I need to display this PDF in SAP portal, then I need to develop a RFC to return this PDF file, I read in other post that the way is to convert de PDF to binary file a return this binary file like a paremeter in the RFC.
    Someone have an example about this?
    Regards
    Eduardo Campos

    This works for me, it copies an excel file into another excel file.
    You can keep the binary information as long as you want and later download the file to another place.
    You can try it to see if it works for you.
    Remember to keep the file lenght.
    types: stringa(4096).
    data: tabla type standard table of stringa.
    DATA: FILE TYPE STRING.
    DATA: LENGHT TYPE I.
    fILE = 'C:\DOCUMENTS AND SETTINGS\myuser\MY DOCUMENTS\BOOK1.XLS'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILE
       FILETYPE                      = 'BIN'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    IMPORTING
       FILELENGTH                    = LENGHT
    *   HEADER                        =
      TABLES
        DATA_TAB                      = tabla.
    BREAK RJESCISL.
    fILE = 'C:\DOCUMENTS AND SETTINGS\myuser\MY DOCUMENTS\BOOK2.XLS'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       BIN_FILESIZE                  = LENGHT
        FILENAME                      = file
       FILETYPE                      = 'BIN'
    *   APPEND                        = ' '
    *   WRITE_FIELD_SEPARATOR         = ' '
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = TABLA
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22.
    Edit: Sorry, didn't read the question right.
    Well, is almost the same way, just use Open dataset dsn in binary mode. That way you'll get your file in binary mode.
    I was supossing you were usen a local file but now I see you want it in the application server
    Edited by: Ramiro Escamilla on Feb 29, 2008 10:11 PM

  • Decode Base64(Pdf) to binary

    Hi all,
    I have a WS - PI - File scenario.
    So I get a base64 coded PDF-File and have to create a decoded binary file.
    First I used an UDF. But the created document is invalid and not to open by Acrobat. After reading the forum the conclusion is,  it is impossible to convert data in mapping step, is'nt it.
    But what are the other possibilities?
    Regards
    Mathias

    You can do this in the mapping using Base64.decode() method from SAP standard API (com.sap.aii.utilxi.base64.api.*)
    Check my WIKI section for ref: [Sending Binary Data to Inbound Plain HTTP Adapter in XI and PI |http://wiki.sdn.sap.com/wiki/display/XI/SendingBinaryDatatoInboundPlainHTTPAdapterinXIand+PI] where i used encode method in HTTP client code.
    You can check decode method code in the java snippet  "Java Mapping - Base64 Decryption and Unzipping Code "
    Edited by: Praveen Gujjeti on Jul 16, 2010 4:59 PM

  • How To formate PDF Data(Binary) to HTML Formate

    Hi All,
    I am using PDFs in my application. Once the user has submitted his project in formation through pdf, it stores in BAPI. When i tried to retrive the data from back end to display in a view. it shows me all the information is in single line because of PDf binary data. Can any one knows about how to display pdf data in a view (html) with multiple lines.
    Thanks
    Regards
    Ravi.Golla

    Hi Ravi,
    See this thread...It might be useful for u..
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
    Urs GS

  • Convert filled PDF into binary and store in R3 table

    Hi .. Is there any way to save my entire pdf form into r/3 either in presentation level or ztable as binary upon user submit .. ?
    Edited by: nyap kah wai on Aug 6, 2009 4:27 AM

    Hi,
    Below is the code which may help you out.
    ***Retrieve your Pdf source in Onclick event of submti button.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_pdfsource LIKE ls_context-pdfsource.
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    * get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `PDFSOURCE`
        IMPORTING
          value = lv_pdfsource ).
    Convert to Binary using below code..
      DATA: p_image TYPE sdokcntbins.
      DATA:  p_image_len TYPE i.
    CLEAR: p_image_len.
      REFRESH p_image[].
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer                = lv_pdfsource
    *   APPEND_TO_TABLE       = ' '
       IMPORTING
         output_length         = p_image_len
        TABLES
          binary_tab            = p_image[].
    Now you can use this binary tab to update your custom table..
    Rgds
    Vara

  • PdfSource of InteractiveForm UI element should be populated with pdf binary

    Hey Guys...
    I need some help here...
    I have a Web Dynpro Java Application that retrieves data from R/3 and I want to (only) display that data using Adobe.  I've set the "mode" property of the UI Element as "usePdf" and I have bound the pdfSource property to a binary type in the context, but as I'm about to display the PDF I get the following exception: (the important part of it)
    Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: pdfSource of InteractiveForm UI element should be populated with pdf binary content in USE_PDF mode
    Do you have any idea of what is going on?. Is it the right scenario?
    Should I use generatePdf instead? if that's the case then get Credentials for that?. Would this have any additional cost?
    Thank you
    David.
    Edited by: duztariz on Mar 20, 2009 11:24 PM
    Edited by: duztariz on Mar 20, 2009 11:26 PM

    In your szenario you have to give the PDF as binary content into this content variable. You can do that for example by reading a PDF File as a binary stream and store it into this content variable.
    Then you can use the Interactive Form UI Element to show this PDF.
    But from what I understand, its not exactly what you want? You want to show some data that you read from R/3 and display it in an interactive form?
    What you have to do is, to edit your Interactive form, create the Bindings etc. (see tutorials) and set the mode to "modify PDF". Then the PDF will show the read data for you.

  • Map binary data (PDF) to XML not possible due to non-printable chars

    Hi XI Gurus,
    we have the following issue.
    We send a PDF as binary data (as a hex string '25255044462D3' ) along with some other information from ERP within one RFC to XI , doing a message split 1:n for those two kind of messages (1. the PDF, 2. the XML) an send the split messages to file/ftp receiver adapter.
    The message split and sending of the messages is working well, but we encounter some problems with non-printable chars (hex code below 0x20) in the pdf binary. The PDF data and the dynamic file name is mapped into an XML. But the non printable characters are converted into '#' when mapped into the XML target field.
    (Due to the 1:n multi mapping, we cannot put the filename into dynamic configuration, so we have to map the pdf and the filename into an XML and extract the content with variable substitution in receiver file adapter....)
    My question is: how can binary data with non-printable chars be sent through XI and can be mapped into an XML without beeing replaced by '#' ?
    Any help will be greatly appreciated.
    Thanks and regards
    Holger

    Maybe I didn´t explained it clearly enough.
    We do not have the issue that the RFC puts the '#' into the string. We got from the RFC a hex string containing the pdf as visible hex values like:
    As you can see we have the pdf as hex string. During message mapping XI replaces some non-printable chars like '0x04' or '0x19' with '#'.
    My question is: how can we avoid those char replacement ?
    BTW: I grabbed a pdf with sender file adapter, routed through XI without any mapping and send it with ftp in binary mode. But the pdf contains more chars as the origional file and the pdf content is not visible when opening with a pdf reader like Acrobat. I guess the file adpter has problems with carriage return and linefeed chars. Some CR and LF are replaced inserted somehow.
    Best regards,
    Holger

  • Adobe Forms, XML(PDF format) to PDF binary

    Hi experts!
    I'm working with Interactive Adobe Forms and the form function return the PDF in a XML format (xstring) through the parameter FPFORMOUTPUT-XML.
    I need to save the PDF file (binary) without geting it through the "getpdf" parameter FPFORMOUTPUT-PDF.
    Because the "getpdf" don't permit to show the user dialog print options.
    How could I transform the XML(PDF) returned in binary PDF file?
    Thank you all!

    Hello Evaristo
    You can make use of CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' and CALL METHOD cl_gui_frontend_services=>gui_download to achieve this requirement.
    Regards
    Sandy
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
                   EXPORTING
                     buffer        = ls_params->es_output-s_form_output-xml
                   IMPORTING
                     output_length = lv_pdf_len
                   TABLES
                     binary_tab    = lt_pdf.
                 lv_file_name = p_xml.
    CALL METHOD cl_gui_frontend_services=>gui_download
                   EXPORTING
                     bin_filesize = lv_pdf_len
                     filename     = lv_file_name
                     filetype     = 'BIN'
                   CHANGING
                     data_tab     = lt_pdf
                   EXCEPTIONS
    OTHERS       = 1.

  • PDF binary in backend, show in WDJ interactive form

    Hello,
    I have a backend system, supplying a PDF in binary format "Xstring".
    I want to show it in Web Dynpro Java, using an Interactive Form.
    I'm trying to bind the binary, to the pdfSource, but a error comes up.
    What is the problem?
    Best Regards

    com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Failed to  USEPDF
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:418)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterApplicationModification(ClientApplication.java:1132)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.afterApplicationModification(ClientComponent.java:895)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRespond(WindowPhaseModel.java:573)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:152)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:319)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: java.lang.IllegalArgumentException
         at com.sap.dictionary.runtime.DdTypeBinary.format(DdTypeBinary.java:63)
         at com.sap.dictionary.runtime.DdTypeBinary.toString(DdTypeBinary.java:67)
         at com.sap.tc.webdynpro.clientserver.data.DataContainer.doFormat(DataContainer.java:1405)
         at com.sap.tc.webdynpro.clientserver.data.DataContainer.getAndFormat(DataContainer.java:1098)
         at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.renderAttributes(XfdRenderer.java:370)
         at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.renderElement(XfdRenderer.java:221)
         at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.renderLeadSelectedElement(XfdRenderer.java:183)
         at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.render(XfdRenderer.java:79)
         at com.sap.tc.webdynpro.clientserver.renderer.AbstractRenderManager.render(AbstractRenderManager.java:62)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.getDataStream(AdobeFormHelper.java:537)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.getDataStream(AdobeFormHelper.java:1047)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.getDocumentContextForXMLExchange(AdobeFormHelper.java:907)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:365)
         ... 29 more
    wdContext.currentContextElement().setPdfbinary(); (type binary)
    the backend data, is byte[], and starts with 25 50 ... (it's ok, confirmed in a HEX editor)
    Regars
    Edited by: Joao.Ferreira on Aug 19, 2010 5:02 PM

  • Attach an xml to a pdf using ADS

    Hi all,
    I have a scenario where we are sending a Base64 encoded PDF (a bill) and the corresponding xml data from SAP backend on level 4.6C to PI 7.1. In PI we should attach the xml data to the PDF. I have already succeeded to do this using iText but we have a requirement to do this with ADS instead. In Netweaver Developer Studio I created an example project where I am reading a PDF as a byte array, also reading an XML file and try to attach the XML to the PDF using the ADS api. The project successfully built in NWDS but when I am running the project it failes.
    I am using standard code to attach the xml stream to the pdf, the error message is thrown when the following line is executed:
    IWDPDFDocument document = context.execute();
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.impl.PDFDocumentAccessibleContextWDImpl.execute(PDFDocumentAccessibleContextWDImpl.java:99)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.addAttachmentWithSap(PdfWithAttachment.java:129)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.main(PdfWithAttachment.java:218)
    Caused by: java.lang.NullPointerException
         at com.sap.tc.webdynpro.services.sal.deployment.core.DeployableObjectInternal.getSystemDeployableObjectName(DeployableObjectInternal.java:53)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.<clinit>(AdobeFormHelper.java:115)
         ... 3 more
    Is it the problem with the PDF that it is not an Interactive Form?
    Or the problem is simply that I am trying to run the project on my local machine where ADS is not available?
    Thanks for your help.
    Pal
    Edited by: Pal Somogyi on Oct 17, 2010 10:30 PM
    Edited by: Pal Somogyi on Oct 18, 2010 11:44 AM

    Hi Pal,
    There is a requirement to generate an Adobe Form using SAP Interactive forms, and then, send this PDF to a non-SAP system using Base-64 encoding. The receiving system will decode this file and re-generate a PDF.
    I have heard that this could be done in the PI layer, using the Conversion Agent.
    Another approach which I can think of is convert PDF to binary and then use the cl_http_utility=>encode_base64 to convert binary to base64.
    You have mentioned that you have had to send a base 64 encoded pdf. Could you pelase guide me through the process?
    Thanks,
    Preethi.

  • How to send pdf attachment through BPEL

    Hi All,
    I have been looking for a solution to send a pdf as an attachment in bpel. My requirement is,
    - Send a SOAP request to 'SendAttachment' bpel service with all the input parameters
    - SendAttachment bpel service validates the input and generates the pdf within the bpel process
    - SendAttachment bpel has to return the generated pdf as attachment along with response payload.
    I did some research but couldn't a relevant scenario. I have no idea about how to start with. Experts, please suggest on how to implement this scenario.
    Thanks in advance,
    Satya.

    Dear Ravi,
    I tried to build a small application to handle the above mentioned scenario. But I am unable to send pdf as attachment in BPEL. Below are the details,
    1) Created a standalone weblogic webservice(instead of ejb as you mentioned) - 'GetAttachmentService' in eclipse that will create a pdf and send it along with the xml response.
    2) In GetAttachmentService, created pdf is converted into byte[] and mapped to a 'base64Binary' element in 'GetAttachmentResponse'.
    3) Tested the above webservice successfully using SOAP UI. I am able to see the binary data as one of the elements in GetAttachmentResponse.
    4) Now, I have created a composite in SOA suite that will have a webservice adapter(to consume GetAttachmentService) and a BPEL process - 'SendAttachmentBPEL' to read the response elements.
    5) SendAttachmentBPEL response has a 'base64Binary' element to hold the binary data from GetAttachmentService response.
    6) Modified the SendAttachmentBPEL wsdl to accomodate mime content as below.
    7) Since there is mime part in wsdl, EM didn't allow me to test there. So I have used SOAP UI to test SendAttachmentBPEL, I am getting the pdf as binary data in one of the response elements rather as attachment. Please take a look at the below BPEL snippet and suggest if any changes are required.
    My objective is when I hit the SendAttachmentBPEL in SOAP UI, I should get back a response along with pdf attachment.
    --BPEL snippet
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         MESSAGE TYPE DEFINITION - Definition of the message types used as
         part of the port type defintions
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <wsdl:message name="SendAttachment1BPELRequestMessage">
              <wsdl:part name="payload" element="client:process"/>
         </wsdl:message>
         <wsdl:message name="SendAttachment1BPELResponseMessage">
              <wsdl:part name="payload" element="client:processResponse"/>
    <wsdl:part name="bin" element="client:processAttachment"/>
         </wsdl:message>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PORT TYPE DEFINITION - A port type groups a set of operations into
         a logical service unit.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <!-- portType implemented by the SendAttachment1BPEL BPEL process -->
         <wsdl:portType name="SendAttachment1BPEL">
              <wsdl:operation name="process">
                   <wsdl:input message="client:SendAttachment1BPELRequestMessage" />
                   <wsdl:output message="client:SendAttachment1BPELResponseMessage"/>
              </wsdl:operation>
         </wsdl:portType>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PARTNER LINK TYPE DEFINITION
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <plnk:partnerLinkType name="SendAttachment1BPEL">
              <plnk:role name="SendAttachment1BPELProvider" portType="client:SendAttachment1BPEL"/>
         </plnk:partnerLinkType>
    <wsdl:binding name="SendAttachment1BPELBinding" type="client:SendAttachment1BPEL">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="process">
    <soap:operation style="document"
    soapAction="http://xmlns.oracle.com/bpel_104_Arrays/SendAttachmentProject/SendAttachment1BPEL/process"/>
    <wsdl:input>
    <soap:body use="literal" parts="payload"/>
    </wsdl:input>
    <wsdl:output>
    <mime:multipartRelated>
    <mime:part>
    <soap:body use="literal" parts="payload"/>
    </mime:part>
    <mime:part>
    <mime:content part="bin" type="application/pdf"/>
    </mime:part>
    </mime:multipartRelated>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>

  • Encode a PDF into base64 xml

    Hi Pal,
    There is a requirement to generate an Adobe Form using SAP Interactive forms, and then, send this PDF to a non-SAP system using Base-64 encoding. The receiving system will decode this file.
    I have heard that this could be done in the PI layer, using the Conversion Agent.
    Another approach which I can think of is convert PDF to binary and then use the cl_http_utility=>encode_base64 to convert binary to base64. howvere, I am unaware of how to convert PDF to binary.
    Could someone guide me thorugh this please?
    Thanks,
    Preethi.

    To convert a spool into a binary table, take a look here:
    http://wiki.sdn.sap.com/wiki/display/Snippets/Convert%20Smartform%20to%20PDF%20format?bc=true
    I've done a similar scenario, and i've developed the conversion on Abap side, with cl_http_utility=>encode_base64 method into an xstring field.
    In your case, there's the Adobe I Form, than you need to save PDF file in a system's directory, you need to read the generated file, encode, and than send out.
    You can also use Conversion Agent, and do the conversion in PI system.

  • How to show custom header in pdf generated from report

    Hi,
    I  have created a report that is used to display Leave record of employees in an organization. After which it creates a pdf file and send it to respective HOD.
    In this case I am trimming generated output and sendinf only required fields to the pdf.
    When pdf is getting generated it shows program name as Title of that report.
    I want to change this header to my own header along with some variable but not sure how I can do so.
    I have also tried TOP-OF_PAGE but problem in this case is that I am still getting program name along with it.
    To generate pdf I have used function :
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid   = spoolid
          no_dialog     = ' '
        importing
          pdf_bytecount = l_no_of_bytes
          pdf_spoolid   = l_pdf_spoolid
          btc_jobname   = l_jobname
          btc_jobcount  = l_jobcount
        tables
          pdf           = l_pdfdata.
    Then I had converted this pdf to Binary
    call function 'QCE1_CONVERT'
        tables
          t_source_tab         = l_pdfdata
          t_target_tab         = lit_record
        exceptions
          convert_not_possible = 1
          others               = 2.
    Then I had created subject matter and used FM : SO_NEW_DOCUMENT_ATT_SEND_API1: to send mail to respective HODs.
    I tried dubbing it but couldn't get any variable which is holding program name.
    Sorry for putting in wrong forum.
    so Closing it from this forum and raising the same in ABAp-General forum.
    How to change header of pdf in generated report
    Edited by: gaur.yagyesh on Apr 16, 2010 4:03 PM

    To make it more clear to my question.
    I am using sun one webserver 6.0 sp6.
    I need to enable custom header on the webserver so that any request having a custom http header coming to webserver should be captured by the webserver.
    Thanks,

  • Merge Different Spools containing a Single PDF page into a Single PDF file.

    Greetings,
    I am developing a custom object where in i need to read PDF file from many different Spools(Range given on Input Screen), where each spool has a single PDF page in it. I need to combine all these PDF Pages into a single PDF file & either create a new Spool or save it on an Application Server.
    At present i have developed the code where in i am able to read the PDF files from different spools & convert them into Binary but i am not able to generate it back to PDF file.
    Kindly find my code for your reference.
    CODE:-
    START-OF-SELECTION.
      PERFORM f_get_spool_1000 .
      PERFORM g_conv_pdf_to_bin_2000 .
    *&      Form  F_GET_SPOOL_1000
          text
    FORM f_get_spool_1000 .
      SELECT * FROM tsp01
               INTO TABLE gt_tsp01
               WHERE rqident IN s_spool
               ORDER BY rqcretime DESCENDING.
      IF sy-subrc = 0.
        SORT gt_tsp01 BY rqident .
      ENDIF.
    ENDFORM.
    *&      Form  G_CONV_PDF_TO_OTF_2000
          text
    DATA: lv_filename_out   TYPE string,
                lv_len            TYPE i,
                lt_tab            TYPE tsfixml .
      DATA: lwa_print_parms    LIKE pri_params,
                  lv_valid(1)       TYPE c .
      DATA: lv_linsz LIKE sy-linsz VALUE 132, " Line size
                  lv_paart LIKE sy-paart VALUE 'X_65_132'.  " Paper Format
      DATA : lt_tsp01 TYPE STANDARD TABLE OF tsp01 ,
                   lwa_tsp01 TYPE tsp01 .
      CLEAR : gv_pdf, gwa_tsp01, gv_renderpagecount .
      LOOP AT gt_tsp01 INTO gwa_tsp01.
        CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
          EXPORTING
            i_spoolid         = gwa_tsp01-rqident
            i_partnum         = 1
          IMPORTING
            e_pdf             = gv_pdf
            e_renderpagecount = gv_renderpagecount
            e_pdf_file        = gv_pdf_file
          EXCEPTIONS
            ads_error         = 1
            usage_error       = 2
            system_error      = 3
            internal_error    = 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.
        CLEAR lv_len .
        REFRESH gt_bin .
        CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            buffer        = gv_pdf
          IMPORTING
            output_length = lv_len
          TABLES
            binary_tab    = gt_bin.
        CLEAR gwa_bin .
        LOOP AT gt_bin INTO gwa_bin.
          APPEND gwa_bin TO gt_listout.
          CLEAR gwa_bin .
        ENDLOOP.
      ENDLOOP.
    Get FP reference
      DATA: lo_fp     TYPE REF TO if_fp VALUE IS INITIAL,
            lo_pdfobj TYPE REF TO if_fp_pdf_object VALUE IS INITIAL,
            lo_exc    TYPE REF TO cx_root,
            lv_xslt_message TYPE string .
      lo_fp = cl_fp=>get_reference( ).
    For handling exceptions
      DATA: lo_fpex TYPE REF TO cx_fp_runtime VALUE IS INITIAL.
      TRY.
          lo_pdfobj = lo_fp->create_pdf_object( connection = 'ADS' ).
      Set document
          lo_pdfobj->set_document(
            EXPORTING
              pdfdata = gt_listout ).
      Tell PDF object to extract data
          lo_pdfobj->set_extractdata( ).
      Execute the call to ADS
          lo_pdfobj->execute( ).
        CATCH cx_root INTO lo_exc.
          lv_xslt_message = lo_exc->get_text( ).
      ENDTRY.
    Your quick reply would be of great help.
    Regards.

    Thank Your for your concern, there are many replies & posts but all of them points only to Try what they have said. As being said that trying to convert PDF to binary & appending many PDF similarly would not let you generate a single PDF again.
    Your Kind guidance would be really appreciable.
    Regards.

Maybe you are looking for

  • Data in ods

    Hai Experts, Can any body tell me data is present in active data table, new data table, change log table and as wel as with this there is a content button it is asking for the table name what is that button consists of can any body help me out Regard

  • AMD Athlon 64 3800+ cpu upgrade to AMD Athlon 64 X2

    Hello everyone, First of all, I have been to cpu-upgrade.com and typed in my current (CPU)--> AMD Athlon 64 3800+ 2.40GHz (motherboard)--> ASUS A8M2N-LA (Naos) GL6.  According to the website, my AM2 Socket (940pin) is capable of upgrading to a Dual C

  • Change batch in LT12 (TO Confirmation)

    Hi, I am working in ECC6. I want to change the batch in transfer line item in LT12 before confirmation. Tried finding userexit or BADI or function module but no luck. Can anyone help? Thanks in advance. Shoma

  • Changes in iTunes 3.1 from 3.0?

    I ugraded to iTunes 3.0 on Tuesday. Today, there is an update to 3.1 available. What does 3.1 change?

  • Stock removal from storage location

    Dear All, System showing some stock at various storage location, but whic is physically not in location. Every month balance sheet this stock is shwoing. Please explain me any how to delete this stock from those storage locations. Thanks in advance.