Binary to pdf

Hi,
        I have RFC which gives data in binary format. now I need to convert that binary data to pdf with out using spool request number like that. Can anybody have idea on this.
       sure helpful answers are rewarded
Thanks,
suma.

Hi,
After  you get  the data from RFC FM,thn  you use tht
all function 'CONVERT_OTF'
       EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
       IMPORTING
            bin_filesize          = v_len_in
       TABLES
            otf                   = i_otf
            lines                 = i_tline
       EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            others                = 4.
  Fehlerhandling
  if sy-subrc <> 0.
  endif.
  loop at i_tline.
    translate i_tline using '~'.
    concatenate wa_buffer i_tline into wa_buffer.
  endloop.
  translate wa_buffer using '~'.
  do.
    i_record = wa_buffer.
    append i_record.
    shift wa_buffer left by 255 places.
    if wa_buffer is initial.
      exit.
    endif.
  enddo.
Attachment
  refresh:
    i_reclist,
    i_objtxt,
    i_objbin,
    i_objpack.
  clear wa_objhead.
  i_objbin[] = i_record[].
Now you the PDF data in i_record.
Reward if useful
Thanks,
Aditya.

Similar Messages

  • 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

  • XSTRING with Binary of PDF - display R3 report in portal

    Hello,
    We have a requirement to show an R/3 report on portal as PDF. User will then be able to Print/Save the same.
    I have browsed through different posts on SDN and
    The idea I have is:
    1. Print the report to spool (Backend).
    2. Convert the spool to pdf (Backend).
    3. Create a FM (in the backend) that exports an xstring with the binary of the pdf (of the report)
    4. Using webdynpro for Java, create pdf form based on binary xstring.
    5. Render the pdf to portal and display it in portal.
    I have a couple of questions regarding this approach:
    1. What exactly does the function module needs to export (what format and type should be used)?
    2. How should the data being sent from the backend be handled in the Webdynpro Code? (What Context attribute should be created and what type should be used?)
    Please share your experience if some one had developed a similar application. Any sample code would be really appreciated.
    Thanks for Reading the post and for your time.
    Regards,
    Raj

    Hi Raj,
    Thanks for the link, i followed the procedure the way it mentioned in the link, but i am getting the below error as nullpointer exception, i checked everything but still i am getting the error.
    i can see one thing in webdynpro java code , i am getting warning message for this " wdwebresource"
    as deprecaiated, what is this meant?
    thanks,
    vinay
    java.lang.NullPointerException
         at com.vin.view.PdfView.wdDoInit(PdfView.java:115)
         at com.vin.view.wdp.InternalPdfView.wdDoInit(InternalPdfView.java:137)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:756)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:291)
         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(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

  • Binary to PDF Conversion

    hi all,
    is there any FM which converts data in BINARY format to PDF format?
    points will be awarded

    Hello,
    check these FM
    SX_OBJECT_CONVERT_OTF_PDF
    SX_OBJECT_CONVERT_OTF_PRT
    SX_OBJECT_CONVERT_OTF_RAW
    SX_OBJECT_CONVERT_SCR_OTF
    hope this will help you
    Thanks
    Anirudh Saini

  • Fulltext search of binary files outside of database in SQL 2012/Server 2012

    This may be more of a Windows Server 2012 question but I'm not sure.
    I have a system that holds large amounts of binary files (pdf, doc, etc.).  The files themselves are held outside the database in a folder and a SQL table holds the metadata.  I used the Indexing Service available through Windows Server 2008 to
    create a catalog called "EFCATALOG" to index the contents of the external folder, then created a linked server called MYIDXS which allowed me to query that external indexing catalog from within SQL with a query like this:
    EXEC sp_addlinkedserver MYIDXS, 'Internal App', 'MSIDXS', 'EFCATALOG'
    SELECT * FROM MYDOCS
    LEFT JOIN OPENQUERY(MYIDXS,'SELECT FILENAME FROM SCOPE() WHERE CONTAINS (''test'')') AS MYTBL
    ON MYDOC_FILE_NAME = MYTBL.[FILENAME]
    With Windows Server 2012, I'm missing the functionality to create the indexing service catalog.  I've added the Windows Search Service and see how I can configure folders for searching, but there is no naming functionality for this and I don't see how
    I can get the above query/structure to work in Windows Server 2012/SQL Server 2012 environment.  In fact, there isn't much at all online regarding the search service or the relationship back to the older versions in 2008 and before.
    Is there any way to continue this structure in 2012?  I would like to avoid recoding my application to work with a different structure.  I'm afraid that changing everything to work with the FILETABLE/FILESTREAM functionality added in SQL 2012
    will be necessary which is fine long term, but not convenient right now.
    Thanks in advance for any suggestions/help.

    Thank you Fanny Liu, based on your link the syntax has changed dramatically. I need to query SYSTEMINDEX now and the structure is very different.    It still seems that this new syntax requires creating a linked server of a different type. 
    I've tried:
    EXEC sp_addlinkedserver @server = 'TEST', @provider = 'Search.CollatorDSO.1', @datasrc = 'SYSTEMINDEX', @srvproduct = '', @provstr='Application=Windows'
    SELECT FileName FROM OPENQUERY("TEST", 'SELECT Filename FROM SYSTEMINDEX')
    Msg 7302, Level 16, State 1, Line 1
    Cannot create an instance of OLE DB provider "Search.CollatorDSO.1" for linked server "TEST".
    I've also tried using just "Search.CollatorDSO"as the provider since that is the provider name listed in management studio but basically the same error comes back.
    So I have 2 questions:
    1) Is it possible for my original process to work in Windows Server 2012 in any way (meaning that the OPENQUERY example I provided can remain relatively unchanged)?
    2) If change is necessary using this new SYSTEMINDEX and linked server combination, why is my linked server definition failing?  I'm using SQL Server 2012....Microsoft SQL Server 2012 - 11.0.2100.60 (X64)
     Feb 10 2012 19:39:15
     Copyright (c) Microsoft Corporation
     Express Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
    Thank you.

  • How to load externl files (PDF) into BLOB column.  Please help.

    Hi All,
    I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
    Regards,
    Trang

    Hi,
    If the following link helps to you then great.
    http://www.exefind.com/oralobeditor-P25468.html
    Regards,
    Sailaja

  • Using PI 7.0 to handle moving a PDF document into a SOAP Message & sending

    Here is our situation.  We have the business writing all invoices for a day out of SAP to disk formatted as a PDF document; meaning, if the file is FTP'd from the disk of SAP to an NT server inside our firewall it is recognised as a PDF by Windows and Adobe.
    After we read the PDF, I need to add it as the payload to a SOAP message that will be sent to the web service of a partner out side our firewall.  They will extract the PDF from the SOAP Message and print the invoices... stuff the envelopes ... and post them. 
    I have been trying to use the file adapter to "pick up" the PDF and the SOAP adapter to send... Obviously, it is not working and I need some assistance.  I am new to XI, so any advice will be greatly appreciated.
    Thanks,
    Rich

    1.If the partner webservice supports SOAP attachments then you can send the required attachments from FileAdapter by selecting "Additional Files" check box in the File Sender channel.
    Check this link: [http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm]
    2.Else if this not the case i.e., you want to send PDF file stream as part of payload then you need to convert the PDF file stream to BASE64 format then map to one of the field of Webservice structure and then post using SOAP Adapter.
    Remember the webservice field length should be enough to carry the BASE64 string otherwise the target application will fail to process the data or it will process data by truncating. Also there should be extra funtionality in target webservice for converting BASE64 format to binary format(PDF file).
    But in general the webservices will support attachements. So you can go ahead with Case1.
    Thanks,
    - Gujjeti.

  • Highlight in pdf ms word

    Hello.I created a table with the statement.
    create table hdocs (
    id number primary key,
    fmt varchar2(10),
    text varchar2(80)
    Then I transfer thru ftp protocol from my pc to the server some files in specific file system and then i did the flollowing inserts records in the table.
    insert into hdocs values(1, ’binary’, ’file1.doc’);
    insert into hdocs values(2, ’binary’, ’file2.doc’);
    insert into hdocs values(3, ’binary’, ’file3.doc’);
    insert into hdocs values(4, ’binary’, ’file4.doc’);
    insert into hdocs values(5, ’binary’, ’file5.doc’);
    insert into hdocs values(6, ’binary’, ’a96594.pdf’);
    insert into hdocs values(7, ’text’, ’file1_txt.txt’);
    insert into hdocs values(8, ’text’, ’file2_txt.txt’);
    insert into hdocs values(9, ’text’, ’file3_txt.txt’);
    Then I createted the fil_datastore preference with the statement:
    begin
    ctx_ddl.create_preference(’COMMON_DIR’,’FILE_DATASTORE’);
    ctx_ddl.set_attribute(’COMMON_DIR’,’PATH’,’/home/oracle/search/files’);
    end;
    and finally build the index
    create index create index hdocsx on hdocs(text) indextype is ctxsys.context
    parameters ('datastore COMMON_DIR filter ctxsys.inso_filter format column fmt');
    All document indexed.okWhen I search with a word all results display ok no problem.i also use some code for highlight as follows.
    procedure showDoc(p_id IN NUMBER, p_query IN VARCHAR2) is
    v_clob_selected CLOB;
    v_read_amount integer;
    v_read_offset integer;
    v_buffer varchar2(32767);
    v_query varchar2(2000);
    v_cursor integer;
    v_id VARCHAR2(20);
    begin
    v_id:=to_char(p_id);
    begin
    ctx_doc.markup(index_name=>'hdocsx',
         textkey=>v_id,
                        text_query=>p_query,
                        restab=>v_clob_selected,
                        starttag=>'<font color=''red''>',
                        endtag=>'</font>');
    v_read_amount:=32767;
         v_read_offset:=1;
         begin
         loop
              dbms_lob.read(v_clob_selected, v_read_amount, v_read_offset, v_buffer);
              htp.p(v_buffer);
              v_read_offset:=v_read_offset + v_read_amount;
              v_read_amount:=32767;
              end loop;
              exception
              when no_data_found then
    null;
         end;
    exception
         when others then
         htp.p('ERROR '|| to_char(SQLCODE) || SQLERRM );
    null;
    end;
    --dbms_lob.freetemporary(v_clob_selected);
    end showDoc;
    The problem is that only in the text files highlight works not in pdf document, and ms word documents.Is some workaround for highlight also in word documents, pdf documents?Thanks in advance Panagiotis.

    Oracle Text at the moment, does not support PDF nor MS Word highlighting. It does support highlighting the filtered version of PDF/MS Word.

  • Display PDF document from Servlets to browser - how 2 change the title

    Hi, need help of changing the html title when Display PDF document from Servlets to browser. By default the browser's title shows the obsolute URL where the rdf comes from (i.e. http://www.google.com/sample.pdf), because servlet responds a binary data (PDF), there seems to be no other way to change the browser's title to fit my own choice.
    Appreciate your quick help,

    You can try and check with
    .setTitle("Welcome");

  • How to display PDF in JSP using Iframe

    Hi All,
    I am using Struts 2. I am building my file in ActionClass with seperate Method like getGeneratedPDF() in which, I am setting header of response and writing into PDF.
    This method will be called from JSP by this way
    s:property value="getGeneratedPDF()" />
    But It displayed Junk Characters , and this PDF is not static (already Generated). It is generated and build on Fly.
    I have 2 questions 1 -- How to display PDF in JSP in proper way without Junk Character in it?
    questions 2 -- How to display it in Iframe?
    Please help me , If you know the solution.
    Thanks in Advance,
    Jimmy

    jamy_26 wrote:
    But It displayed Junk Characters , and this PDF is not static (already Generated). It is generated and build on Fly.A PDF file is a binary file, not a text file, and you're trying to display it as String. Of course you would get "junk characters". Have you ever tried opening a binary file (pdf, doc, jpg, xls, etc) using a text editor like Notepad?
    I have 2 questions 1 -- How to display PDF in JSP in proper way without Junk Character in it?Display it as binary stream, not as text stream. You can display it standalone, just let the link/form/addressbar URL point to some Servlet which writes the InputStream of the PDF file to the OutputStream of the response, along with a correct set of response headers (at least content-type, content-disposition and content-length), so that the browser can open it in the correct application (which is usually Acrobat Reader). If you want to embed the PDF file in a JSP, then one of the ways is indeed using the HTML <iframe> tag.
    questions 2 -- How to display it in Iframe? Just let the iframe URL point to the aforementioned Servlet.
    You can find here an example of a generic file servlet, you may find it useful to get the idea how to do it: [http://balusc.blogspot.com/2007/07/fileservlet.html].

  • Download file (*.jpg or *.pdf ) from Unix to Local PC.

    Please let me know how we can down load (*.jpg or *.pdf ) from Unix to local machine.
    How to handle these files in Opendata set ---> Graphics (not text mode.....)
    thanks a lot in advance ..:)

    Yes was able to crack it with the the Following FM's
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII' for ASCII type (.txt)
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_BINARY' for Binary (.JPG/.PDF/*.doc)
    Thanks to Luis Martinez  For gving me the initial Hint
    And Thanks to all
    Ramesh

  • Binary file attachment

    Hi All,
    Can Oracle B2B accept binary file attachments in message payload?

    Hi Raj,
    B2B can be used to transfer binary documents or binary attachments. For attachment, you need to use proper content type value. You may refer the supported values here -
    http://www.b2bgurus.com/2007/11/attachment-feature-in-rosettanet-using.html
    If it is required to receive docs as body of message, then for binary docs (pdf and jpeg), it may be done by enabling binary transfer at b2b -
    http://www.b2bgurus.com/2008/10/pgp-encrypted-file-transfer.html
    Let us know if you need any other info.
    Regards,
    Anuj

  • How to do best handling binary files in PI/XI?

    Hallo experts ,
    i have got following scenario:
    Sender: Should be a web service client using soap!
    Receiver: Should be a abap proxy in erp (version 701)
    No need for a mapping at the moment, as both sides use the same structure!
    Message: Should contain textual information as well as binary data (pdf-files for example)
    So my question is, what is the best way to implement this scenario? Does anyone know a good tutorial/howto for this matt
    Thanks in advance for you help!
    Kind regards,
    Markus

    Hello,
    Both SOAP adapter and ABAP Proxies support attachments. So as long as you do not need to read the attachment inside XI you should be OK.
    FYI - From PI 7.1 you can also read the attachment in XI mapping but considering that this is a binary content - you will have to use a Java Map etc to handle the content. In your case this might not be needed.
    Make sure you select options keep attachments in the Sender SOAP Adapter.
    Regards,
    Bhavesh

  • Save PDF-file on the application server

    Hello experts,
    I convert my Smartform to a PDF-File. I copied the code from  Suresh Kumar Parvathaneni (REPORT zsuresh_test). At first, thank you Suresh Kumar for that!
    Now, I would like to save the PDF-File on the application server and not local.
    Could you tell me how to do this. Especially, where do I have to put the abap-code in the given code from Suresh Kumar.
    I thank you very much for your help in advance.
    With kind regards.
    gokselin

    Hi,
    You can use the OPEN DATASET statment.
    Probably you must be having an output table which you are downloading to the local machine.You can use the same and loop at it. and if the OPEN dataset returned sy-subrc 0, use the TRANSFER statment.
    Remember the data will be binary for pdf. So you have to open the dataset in binary mode.
    regards,
    Advait

  • Loading external (PDF)file into BLOB colum in the table.  Need urgent help.

    Hi All,
    I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
    Regards,
    Trang

    Once the PDF file is inserted in the PDM table, i am not able to read the PDF data from the below code, This code converts the binary data into the Character data i.e BLOB data into the CLOB, but still the data is not proper which is getting inserted PDF is proprietary format of Adobe. And you cant just read it from pl/sql. You need Adobe software installed in your client machine to view it.
    Here is an example of how to do it.
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006] Display PDF Stored in Database from ASKTOM 

Maybe you are looking for

  • How to create text names within a number or shape

    I would like to learn how to create a print design for college hoodies. I get asked all the time but it takes me a very long time to do it. I am sure there is a quicker way in illustrator. I want to create a design like this image. Can Anyone Help me

  • How to obtain most popular cities from my users table

    Hi. I've got a 'users' table: USER_ID --- CITY_ID 1 ---- 32 2 ---- 20 3----- 32 4 ---- 32 5 ----- 17 I would like to obtain the most popular cities from this table, and the number of occurrences. Is this possible to make it easy with an SQL statement

  • Symbols are disappearing in Preview and Publish

    I'm completely new to Edge so user error is not unlikely, but I have a small animation with 11 small circles that animate opacity and Y pos. The circles are all symbols and are being controlled (play/stop) from the main timeline. When I preview, half

  • How to trigger ABAP proxy

    hai all, i am trying to do a scenario using abap proxy, i created two proxies in the different clients of the XI box itself. when iam giving test data iam able to check it out. when iam trying to pass the dat from the proxy it is not hitting the XI e

  • Multiple Sold-to-Parties in Organizational Model

    Dear All, I've made an Organizational Model with multiple Sold-to-Parties. With that the same amount of Distribution Channels and Divisions have to be maintained, which i have done. The problem now is that i can't seem to maintain the relation of tho