Sending PDF as attachment using Business workflow from Java WD

Hi,
It seems it is famous and known may be solved issue. But i am not able to conceptualize the information available. Thats why i am posting this. pls suggest me how to proceed.
My scenario: I have an online intercative form in java webdynpro application where as once user completes data entry on send button click, i am triggereing an workflow of ECC6.0 which sends mail to MS exchange mail ID. Once user gets the form and complete comments section i have another application which allows user to upload the file which is similar to offline case. But  when i send the attachment i am getting mail with pdf attachment but when i open PDF i am getting error. And it seems PDF doesn't contain data(as size of pdf is 1 KB). and i tried to use xstring as input type.
Can anyone pls guide me how to proceed.
Regards
Ravindra.

A pdf file is definitely not a text file. Storing it in a Java String is a mistake.
Is the "body" variable in your code a String? How does the data get into
the String?

Similar Messages

  • Want to send PDF as attachement using Java Mail

    HI,
    I am using Java mail API for sending PDF as attachment. Here is my sample code
    messageBodyPart = new MimeBodyPart();
    messageBodyPart.setDataHandler(new DataHandler("String data for PDF using iText", "text/plain" ));
    I am generating String for PDF file using iTEXT but I am unable to find out mimetype for passing into DataHandler as second paramete.
    Any idea?
    Thanks
    Shailesh

    Don't convert the data to String. It isn't text so
    you'll damage the binary content by doing that. In
    the "demos" directory of your JavaMail download
    you'll find a ByteArrayDataSource class you can use
    instead of a FileDataSource. Yes, this worked for me. I create the pdf in memory as as StringBuffer and I just changed the code from
    messageBodyPart.setDataHandler(new DataHandler(pdf.toString(), "application/pdf"));
    to
    messageBodyPart.setDataHandler(new DataHandler(new ByteArrayDataSource(pdf.toString(), "application/pdf")));
    and it worked.
    Thanks a lot for your help,
    Dennis

  • Sending PDF as attachment using utl_smtp

    Hi all,
    I am encountering the following problem when i try to send the email using utl_smtp builtin,i receive the mail in my outlook,but not able to read the contents of the pdf file.
    Oracle Version :- Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    source code:-
    CREATE OR REPLACE PROCEDURE "PROC_MAIL_ATTACH_PDFS" (
    p_cust_nb IN cstm.cstm_cust_nb%TYPE,
    from_name IN VARCHAR2,
    to_name IN VARCHAR2,
    subject IN VARCHAR2,
    MESSAGE IN VARCHAR2,
    p_binary_file IN VARCHAR2,
    p_seq_id IN NUMBER,
    p_ret_cd OUT NUMBER,
    p_ret_desc OUT VARCHAR2
    --ISO-8859-6
    IS
    v_smtp_server VARCHAR2 (100) := '172.20.204.17';
    --change this to your mail server
    v_smtp_server_port NUMBER := 25;
    v_directory_name VARCHAR2 (100);
    v_file_name VARCHAR2 (100);
    v_line VARCHAR2 (1000);
    crlf VARCHAR2 (2) := CHR (13)
    || CHR (10);
    mesg VARCHAR2 (32767);
    conn UTL_SMTP.connection;
    v_slash_pos NUMBER;
    v_file_handle UTL_FILE.file_type;
    invalid_path EXCEPTION;
    mesg_length_exceeded BOOLEAN := FALSE;
    l_msg VARCHAR2 (32000);
    l_tag_sep VARCHAR2 (1)
    := func_get_config_value ('TAGSEPRTR');
    l_ind VARCHAR2 (10);
    l_rec VARCHAR2 (4000);
    l_sep_rep VARCHAR2 (4000) := '17_ACCSTMT_NOV_2010';
    l_rem_rep VARCHAR2 (4000);
    l_rep VARCHAR2 (4000);
    l_mim_type VARCHAR2 (2000);
    boundary CONSTANT VARCHAR2 (256)
    := '-----DMW.Boundary.605592468';
    first_boundary CONSTANT VARCHAR2 (256) := '--' || boundary || crlf;
    last_boundary CONSTANT VARCHAR2 (256)
    := '--' || boundary || '--' || crlf;
    multipart_mime_type CONSTANT VARCHAR2 (256)
    := 'multipart/mixed; boundary="' || boundary || '"';
    mime_type VARCHAR2 (255) := 'text/html';
    l_offset NUMBER;
    l_ammount NUMBER;
    CURSOR cur_trnm
    IS
    SELECT trnm_email_enarr, trnm_email_anarr
    FROM trnm
    WHERE trnm_id = 16;
    l_enarr trnm.trnm_email_enarr%TYPE;
    l_anarr trnm.trnm_email_enarr%TYPE;
    l_message_body VARCHAR2 (32000);
    --// To check if all mails belongs to the customer already sent...
    CURSOR cur_pdfd
    IS
    SELECT COUNT (*)
    FROM pdfd
    WHERE pdfd_cust_nb = p_cust_nb
    AND pdfd_email_sts IS NULL
    --NEWLY ADDED ...
    AND NVL (pdfd_stmt_mode, '.') = 'E'
    AND TRUNC (pdfd_to_dt) = (SELECT MAX (TRUNC (pdfd_to_dt))
    FROM pdfd
    WHERE pdfd_cust_nb = p_cust_nb);
    l_cnt NUMBER := 0;
    PROCEDURE send_header (NAME IN VARCHAR2, header IN VARCHAR2)
    IS
    BEGIN
    UTL_SMTP.write_data (conn, NAME || ': ' || header || crlf);
    END;
    PROCEDURE write_raw (
    p_conn IN OUT NOCOPY UTL_SMTP.connection,
    p_message IN RAW
    IS
    BEGIN
    UTL_SMTP.write_raw_data (p_conn, p_message);
    END write_raw;
    PROCEDURE binary_attachment (
    p_conn IN OUT UTL_SMTP.connection,
    p_file_name IN VARCHAR2,
    p_mime_type IN VARCHAR2
    IS
    k_max_line_width CONSTANT PLS_INTEGER DEFAULT 54;
    v_amt BINARY_INTEGER := 672 * 3;
    /* ensures proper format; 2016 */
    v_bfile BFILE;
    v_file_len PLS_INTEGER;
    v_buf RAW (2100);
    v_buf1 RAW (2100);
    v_modulo PLS_INTEGER;
    v_pieces PLS_INTEGER;
    v_file_pos PLS_INTEGER := 1;
    v_data RAW (32767);
    v_data1 RAW (32767);
    v_chunks PLS_INTEGER;
    l_amt NUMBER := 32767;
    l_off NUMBER := 1;
    l_raw RAW (32767);
    l_raw1 RAW (32767);
    l_lob BLOB;
    l_lob_empt BLOB;
    req UTL_HTTP.req;
    resp UTL_HTTP.resp;
    resp_empt UTL_HTTP.resp;
    l_url VARCHAR2 (4000);
    l_rep_path VARCHAR2 (2000);
    l_report VARCHAR2 (100);
    l_seq_nb repq.repq_seq_nb%TYPE;
    l_parm repq.repq_parm_val%TYPE;
    l_repq repq%ROWTYPE;
    l_sts NUMBER;
    l_user VARCHAR2 (10);
    --L_MSG VARCHAR2(32000);
    l_seq_id NUMBER;
    usr_err EXCEPTION;
    --// 07-Jun-2009 - Basheer A.S. : Code added for sending A/c Statement and PFL statements in single e-mail ...
    CURSOR cur_pdfd
    IS
    SELECT
    --UTL_COMPRESS.LZ_UNCOMPRESS(PDFD_DB_FILE) PDFD_DB_FILE,
    pdfd_file_name
    FROM pdfd
    WHERE pdfd_cust_nb = p_cust_nb
    --AND PDFD_EMAIL_STS IS NULL
    --NEWLY ADDED ...
    --AND NVL(PDFD_STMT_MODE,'.') = 'E'
    AND pdfd_seq_nb = p_seq_id
    AND TRUNC (pdfd_to_dt) = (SELECT MAX (TRUNC (pdfd_to_dt))
    FROM pdfd
    WHERE pdfd_cust_nb = p_cust_nb);
    l_buffer_size INTEGER := 57;
    l_offset INTEGER := 1;
    l_raw RAW (57);
    l_file_nm pdfd.pdfd_file_name%TYPE;
    BEGIN
    --// 06-Jun-2009 - Basheer A.S. : Code added for sending A/c Statement and PFL statements in a single e-mail ...
    --// Initializing temporary CLOB data ...
    DBMS_LOB.createtemporary (l_lob, FALSE);
    --DBMS_LOB.createtemporary(L_LOB_EMPT, FALSE);
    --// Loop thro all the records for the given Customer Number...
    OPEN cur_pdfd;
    LOOP
    --FETCH CUR_PDFD INTO L_LOB, L_FILE_NM;
    FETCH cur_pdfd
    INTO --L_LOB_EMPT,
    l_file_nm;
    EXIT WHEN cur_pdfd%NOTFOUND;
    proc_audit_log ('T',
    'PROC_MAIL_ATTACH_PDFS, Customer No. '
    || p_cust_nb
    || ', File attachment: '
    || l_file_nm
    UTL_SMTP.write_data (conn, first_boundary);
    UTL_SMTP.write_data (conn,
    'Content-Transfer-Encoding: base64 '
    || UTL_TCP.crlf
    UTL_SMTP.write_data (conn,
    'Content-Type: ' || mime_type || UTL_TCP.crlf
    UTL_SMTP.write_data (conn,
    'Content-Disposition: ATTACHMENT; filename="'
    || p_file_name
    || '"'
    || UTL_TCP.crlf
    UTL_SMTP.write_data (conn, crlf);
    l_ind := '1.1';
    v_file_pos := 1;
    --// Attaching individual PDF files ...
    BEGIN
    v_modulo := 0;
    v_pieces := 0;
    v_amt := 2016;
    l_ind := '2.1';
    v_file_len := DBMS_LOB.getlength (l_lob);
    --v_file_len := dbms_lob.getlength(L_LOB_EMPT);
    v_modulo := MOD (v_file_len, v_amt);
    v_pieces := TRUNC (v_file_len / v_amt);
    IF (v_modulo <> 0)
    THEN
    v_pieces := v_pieces + 1;
    END IF;
    l_ind := '2.2';
    DBMS_LOB.READ (l_lob, v_amt, v_file_pos, v_buf);
    --dbms_lob.read(L_LOB_EMPT, v_amt, v_file_pos, v_buf);
    v_data := v_data1;
    v_chunks := 0;
    v_data := v_data1;
    FOR i IN 1 .. v_pieces
    LOOP
    v_file_pos := i * v_amt + 1;
    v_file_len := v_file_len - v_amt;
    v_data := UTL_RAW.CONCAT (v_data, v_buf);
    l_ind := '2.3';
    v_chunks := TRUNC (UTL_RAW.LENGTH (v_data) / k_max_line_width);
    IF (i <> v_pieces)
    THEN
    v_chunks := v_chunks - 1;
    END IF;
    l_ind := '2.4';
    write_raw (p_conn => p_conn,
    p_message => UTL_ENCODE.base64_encode (v_data)
    v_data := v_data1;
    IF (v_file_len < v_amt AND v_file_len > 0)
    THEN
    v_amt := v_file_len;
    END IF;
    l_ind := '2.5';
    DBMS_LOB.READ (l_lob, v_amt, v_file_pos, v_buf);
    --DBMS_LOB.READ(L_LOB_EMPT, v_amt, v_file_pos, v_buf);
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    proc_audit_log
    ('E',
    'PROC_MAIL_ATTACH_PDFS.binary_attachment.inside BLOB loop, :'
    || SQLERRM
    || ',ind:'
    || l_ind
    END;
    v_file_pos := 1;
    UTL_SMTP.write_data (conn, UTL_TCP.crlf);
    UTL_SMTP.write_data (conn, UTL_TCP.crlf);
    END LOOP;
    --// END multiple file attachments
    l_ind := '2.6';
    UTL_SMTP.write_data (p_conn, last_boundary || UTL_TCP.crlf);
    EXCEPTION
    WHEN OTHERS
    THEN
    proc_audit_log ('E',
    'PROC_MAIL_ATTACH_PDFS, when others:'
    || l_ind
    || ', '
    || SQLERRM
    END binary_attachment;
    BEGIN
    --// If no pending emails for the given Customer, then exit the process...
    OPEN cur_pdfd;
    FETCH cur_pdfd
    INTO l_cnt;
    CLOSE cur_pdfd;
    --// If still pending statements needs to be send...
    --IF L_CNT > 0 THEN
    IF l_cnt = 0
    THEN
    OPEN cur_trnm;
    FETCH cur_trnm
    INTO l_enarr, l_anarr;
    CLOSE cur_trnm;
    l_message_body :=
    '<html>'
    ||
    --'<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1256(Arabic)">'||
    --'<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1256">'||
    '<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-6">'
    || '<body>
    <TABLE BORDER="0" WIDTH=100% style="table-layout:fixed;">
    <TR>
    <TD WIDTH="50%" ALIGN="LEFT" style="word-wrap: break-word"><B>'
    || l_enarr
    || '</B></TD>'
    || '<TD WIDTH="50%" ALIGN="RIGHT" style="word-wrap: break-word"><B>'
    || l_anarr
    || '</B></TD></TR></TABLE>
    </body>
    </html>';
    proc_audit_log ('T', 'PROC_MAIL_ATTACH_PDFS, msg:' || l_msg);
    v_smtp_server := func_get_config_value ('MAILHOST');
    v_smtp_server_port := func_get_config_value ('MAILPORT');
    l_ind := '3.1';
    conn := UTL_SMTP.open_connection (v_smtp_server, v_smtp_server_port);
    --utl_smtp.helo( conn, v_smtp_server );
    --utl_smtp.mail( conn, '[email protected]' );
    UTL_SMTP.helo (conn, v_smtp_server);
    UTL_SMTP.mail (conn, from_name);
    UTL_SMTP.rcpt (conn, to_name);
    l_ind := '3.2';
    l_rec := func_eti_tagval (l_msg, 'EMAIL');
    proc_audit_log ('T', 'PROC_MAIL_ATTACH_PDFS, l_rec:' || l_rec);
    proc_audit_log ('T', 'l_sep_rep1' || l_sep_rep);
    UTL_SMTP.open_data (conn);
    send_header ('From', '<' || from_name || '>');
    send_header ('To', '<' || to_name || '>');
    --send_header('To',''||Func_Eti_Tagval(L_MSG, 'EMAIL')||'');
    send_header ('Date', TO_CHAR (SYSDATE, 'dd Mon yy hh24:mi:ss'));
    send_header ('Subject', subject);
    send_header ('Content-Type', multipart_mime_type);
    UTL_SMTP.write_data (conn, first_boundary);
    --utl_smtp.write_data(conn, 'Content-Type: '||mime_type||utl_tcp.crlf);
    --utl_smtp.write_data(conn, 'Content-Type: '||mime_type||'; charset=Windows-1256'||utl_tcp.crlf);
    UTL_SMTP.write_data (conn,
    'Content-Type: '
    || mime_type
    || '; charset=ISO-8859-6'
    || UTL_TCP.crlf
    --new...
    UTL_SMTP.write_data (conn, crlf);
    UTL_SMTP.write_raw_data (conn, UTL_RAW.cast_to_raw (l_message_body));
    UTL_SMTP.write_data (conn, crlf);
    UTL_SMTP.write_data (conn, crlf);
    proc_audit_log ('T', 'l_sep_rep2' || l_sep_rep);
    binary_attachment (p_conn => conn,
    p_file_name => l_sep_rep || '.pdf',
    p_mime_type => 'multipart/mixed'
    ); --||l_sep_rep||'.pdf');
    UTL_SMTP.write_data (conn, last_boundary || UTL_TCP.crlf);
    UTL_SMTP.close_data (conn);
    UTL_SMTP.quit (conn);
    END IF;
    p_ret_cd := 0;
    p_ret_desc := 'Mail sent successfully';
    EXCEPTION
    WHEN OTHERS
    THEN
    proc_audit_log ('E',
    'PROC_MAIL_ATTACH_PDFS, error:'
    || SQLERRM
    || 'ind:'
    || l_ind
    p_ret_cd := 1;
    END;
    Kindly help me to resolve this issue.
    Thanks & Regards
    Ariff

    pl ease check below link
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

  • Using word/excel from java (client or weblogic server)

    Hi everybody,
    i want to use excel / word functionality from java in two different variants:
    -> serverside
    -> clientside
    I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
    My knowlege about COM is rather bad.
    Does anybody did this bevor and
    -> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
    -> has a example for using Excel / Word from Java in bea weblogic
    -> has a example for using Excel / Word directly in a client (not via rmi)
    Thanks
    Ciao
    Sven

    Sven, This is a really bad idea. Why don't you tell me
    what your trying to do and I wil surely give you a better alternative
    JRadecki
    "Sven Roesner" <[email protected]> wrote:
    >
    Hi everybody,
    i want to use excel / word functionality from java in two different variants:
    -> serverside
    -> clientside
    I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
    My knowlege about COM is rather bad.
    Does anybody did this bevor and
    -> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
    -> has a example for using Excel / Word from Java in bea weblogic
    -> has a example for using Excel / Word directly in a client (not via rmi)
    Thanks
    Ciao
    Sven

  • Use a scanner from Java

    Hi all!, someone knows about an API that let me use a scanner from Java?
    without programing JNI code.
    thks in advance!.

    The Java Twain package from http://www.gnome.sk does exactly what you need. You do not have to bother about jni, you can get an image from the scanner directly from your java application.
    Erika

  • Service command in Preview.app - Send PDF as attachment doesn't work

    I have used the following workflow for month on all my three macs.
    I open up a PDF file in Preview and select "eMail PDF as attachment" from the Edit menu at the top of the screen. This will attach the current viewed PDF file to a new mail message.
    I guess after updating to 10.7.2 somehow it stopped working on MacBook Pro and iMac. My Mac mini is fine. 
    When I do use this command I get two error messages. Service not available. Can't attach PDF to mail. Import failed. Something like that.
    Does anyone know how to fix that? I repaired permissions and did all that kind of stuff.
    Thanks in advance!

    Would it be possible, please, for someone who has/had this issue to send me the com.apple.ServicesMenu.Services.plist files from ~/Library/Containers/com.apple.Preview/Data/Library/Preferences and from ~/Library/Preferences?
    Thank you.

  • Issue Transporting Business workflow from one System to Another

    Hi All,
    As there are many limitations in Import/Export of Workflow I'm going for a Transport of Workflow from one sytem to another.
    There are some query's reagrding transporting of the Business Workflow through Transport Request.
    1)   How can get the Transport Request no. of the Workflow to be transported? (As there are no direct versions displayed from  menu).
    2)   If there are any dependent objects first how to find the dependent objects lof workflow like if  any data element, Domain, Table, Structure (if these objects are used in your WF definition or may be BOR method), Function module, function group BOR, Rule, WF template, task and Task assignment  ?
    3) How to get Transport Request no. of such dependent objects specifically The Task,Rule , WF template etc.?
    4) I have object Type ZBUS2081 related to it how can i get its TR ?
    Please describe as I'm new to workflow.
    Please identify if there can be some issues after transporting workflow .
    Regards,
    Ujjwal

    Hi Ujjwal,
    Please find the below hint's.
    1. Regarding the objects included in the Transport request check the Tables - E070*.
    2. For dependent objects, you should check the workflow template. You have to check all the Task's and in the task go to
       utilities ---> Object directory entry --> Lock overview . Here you can see the request. It will show you the current request for    the Task.
    3. To get the TR for Business object, Go to basic data ---> Transport data --> Here you can see the Request ID for the business object.
    Thanks,
    Viji.

  • Sending File as attachment using Mail adapter with naming convention

    Dear All,
    I am working on a scenario in which my sender file adapter is sending one file named 'ABC.ok' in one of the folders in application server. I have to send the same file with the same name  to one of the folders at FTP and also to my customer at his email id.
    I have used File Content onversion at the receiver side and has selected adapter specific attributes due to which the required file is getting generated at FTP folder with the same name as that of the source. But how to send the same file using the mail adapter by keeping same name as "ABC.ok". Kindly guide me out in this.
    Regards,
    NJ

    what you need to do:
    1) Select ASMA in Sender and receiver File CC...already done
    2) Using the Dynamic Config UDF get the sender file name in the field Content-Type...for this you need to have a return statement in your UDF
    3) now before pushing this file name to the Content-Type you have to append (concat)the actual type of the file content (xml, txt)
    so your entire Content-Type node will have something like text/plain; name="abc.ok"
    SAP Note has reference on how to do this:
    https://service.sap.com/sap/support/notes/856599
    From the note:
    Q: How can I set the file name of a mail attachment?
    Regards,
    Abhishek.

  • Converting Sender File as attachment using PayloadSwapBean module

    Hi Expert,
    I have a scenario where I have to pick up a file from PI & send it to another PI server as an attachement using XI Adapter.
    I went through SDN & found several messages describing configuration for attachement for mail & SOAP adapter.
    I attached PayloadSwapBean in my sender File channel & passed keyname as Conent-Disposition & keyValue as attachment however I dont see file being converted as an attachment in SXMB_MONI. It still shows it as main payload.
    Please help me on how to convert a sender file payload into attachement. I would like to keep attachment name same as file name. Let me know how we can do that. I also noticed that on receiver XI adapter (which I would be using to send data to next PI system), you can't attach modules. Let me know if there is some other standard way of achieving this requirement.
    Thanks
    Regards
    Sushil

    Hi Stefan,
    No, I dont see dynamic configuration values in second PI system. I am able to see them in first system.
    Hi Amol,
    Do you see dynamic configuration in second PI? I am still referring ASMA in second PI system as file parameters? Should it be HTTP header? (How are you referring ASMA in second PI). Below is my code which give me null at run time.
    DynamicConfiguration dCon =(DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey dKey = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
    String FileDirectory = dCon.get(dKey);
    return FileDirectory;

  • Not Able to send pdf as attachment through email

    Hi,
    I am trying to send the generated pdf as attachment throught email and for the same i am referring to this blog
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417100)ID1409662650DB01562818410448928630End?blog=/pub/wlg/8551
    but when i am trying to send the mail using the method given in this blog , i am getting this error
    com.sap.tc.adobe.pdfobject.core.PDFObjectRuntimeException: Processing exception during a "MergeData" operation. Request start time: Fri Dec 11 18:05:24 IST 2009 com.adobe.ProcessingException: PDF is not interactive. Data can only be imported into interactive forms. Exception Stack Trace: com.adobe.ProcessingException: PDF is not interactive
    and at the backend i am getting the error as
    #com.sun.mail.smtp.SMTPSendFailedException: 501 Bad address syntax
    Can any one please help me out with a solution ?? Any suggestions are welcomed
    Thanks a lot in advance

    Hi,
    Thanks for your reply , but i cannot set the enabled property of the form as true as we are not using the licensed version of the live cycle designer . But if i try the example step by step then even by setting the enabled property as false , the pdf is generated and sent through the email and when i am trying to do the same thing in one of my applications its not working . The pdf is generated but as soon as i click on the button send mail the above told error is displayed .
    There needs to be some other explaination for the error

  • Send Datetime2 value to a SQL Procedure from Java using Hibernate

    Hi All,
    I Have a Procedure which takes a parameter of type datetime2.
    The procedure is called from Java Hibernate.
    How can I Pass datetime2 value to SQL procedure from Java?
    Thanks in advance,
    Shraddha Gore

    You may define a global empty array in some package. Then you can do:
    SQL> CREATE OR REPLACE PACKAGE pkg
    AS
       g_empty   DBMS_SQL.varchar2_table;
    END pkg;
    Package created.
    SQL> CREATE OR REPLACE PROCEDURE p (
       p_tuids   IN   DBMS_SQL.varchar2_table "DEFAULT pkg.g_empty"
    AS
    BEGIN
       NULL;
    END p;
    Procedure created.
    SQL> BEGIN
       p ();
    END;
    PL/SQL procedure successfully completed.

  • Using Inbound IDOC from Java system creation of Outbound delivery

    Dear Experts,
    The scenario we are having is really very interesting. Hopefully its a good learning for me and also for others also.
    The scenario is,
    After sales order creation the details will be sent to one Non SAP system (Java) for performing some tasks related to forwarding agent decision, shipping date and etc. Once the details are finalized in that Java system then, the details needs to be transferred to SAP as "Inbound IDOC" process. For this proposed to use the SAP Jco middle ware.
    Once the details transfered from Java system to SAP then, the outbound IDOC needs to get generated automatically. Assuming the stock for that sales order line item is available. Also one more complexity is, our client is using custom transaction (ZVl10C) for delivery creation.
    Now Query is,
    1. Which IDOC, message type and Functional module needs to be used for creating the delivery automatically..??
    2. As per assumption, stock of that sales order line item should be available. Due to some business reason the stock was removed during inbound IDOC transfer then, what will happen to the IDOC..?. How to avoid this situation..??
    3. As we told we are re going to use SAP Jco b/w SAP & Java system. In this case, how the data will get transfered from Java system to SAP..?
    Thanks in advance for the replies I am going to get
    Regards,
    VEL

    Thanks for the feedback. This question is resolved

  • Use Acrobat Reader from Java

    Hi everybody!
    Can anyone tell me, how I can call the Acrobat Reader from Java, open a pdf-document and make a snapshot fo the first page?
    I have to create an Image file of a page of a pdf-file.
    I already tried pdfbox and iText, both do not work.
    So using Acrobat seems to be the best solution, from my point of view.
    Any suggestions?
    Thx in Advance!
    Stef

    Jeah, I did, but nothing usefull there.
    Perhaps it is possible to open a pdf and save a sanpashot of one page as an image using commandline or jscript?
    Any hints, ides?
    Greetings
    Stef

  • Using ExecutorService class from java.util.concurrent package

    Dear java programmers,
    I have a question regarding the ExecutorService class from java.util.concurrent package.
    I want to parse hundreds of files and for this purpose I'm implementing a thread pool. The way I use the ExecutorService class is summarized below:
    ExecutorService executor = Executors.newFixedThreadPool(10);
            for (int i = 0; i < 1000; i++){
                System.out.println("Parsing file No "+i);
                executor.submit(new Dock(i));
            executor.shutdown();
            try {
                executor.awaitTermination(30, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();However, the code snippet above creates all the 1000 threads (Dock objects) at once and loads them to the executor, and thus I'm worrying about memory leak. I haven't tested it on 1000 files yet but just on 50 small ones, and even if the program prints out "Parsing file No "+i 50 times at once, it executes normally the threads in the background.
    I guess the write way would be to keep the number of active/idle threads in the executor constant (lets say 20 if the thread pool's size is 10) and submit a new one whenever a thread has been finished or terminated. But for this to happen the program should be notified someway whenever a thread is done. Can anybody help me do that?
    thanks in advance,
    Tom

    Ok I found a feasible solution myself although I'm not sure if this is the optimum.
    Here's what I did:
            ExecutorService executor = Executors.newFixedThreadPool(10);
            Future<String> future0, future1, future2, future3, future4, future5, future6, future7, future8, future9;
            Future[] futureArray = {future0 = null, future1 = null, future2 = null, future3 = null, future4 = null, future5 = null,
            future6 = null, future7 = null, future8 = null, future9 = null};
            for (int i = 0; i < 10; i++){
                futureArray[i] = executor.submit(new Dock(i));
            }I created the ExecutorService object which encapsulates the thread pool and then created 10 Future objects (java.util.concurrent.Future) and added them into an Array.
    For java.util.concurrent.Future and Callable Interface usage refer to:
    [http://www.swingwiki.org/best:use_worker_thread_for_long_operations]
    [http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter10/concurrencyTools.html]
    I used a Future[] Array to make the code neater. So after that I submitted -and in this way filled up- the first 10 threads to the thread pool.
            int i = 9;
            while (i < 1000){
                for (int j = 0; j < 10; j++){
                    if (futureArray[j].isDone() && i < 999){
                        try{
                            i++;
                            futureArray[j] = executor.submit(new Dock(i));
                        } catch (ExecutionException ex) {
                            ex.printStackTrace();
                        } catch (InterruptedException ex) {
                            ex.printStackTrace();
                try {
                    Thread.sleep(100); // wait a while
                } catch(InterruptedException iex) { /* ignore */ }
            executor.shutdown();
            try {
                executor.awaitTermination(60, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();
        }Each of the future[0-9] objects represents a thread in the thread pool. So essentially I'm check which of these 10 threads has been finished (using the java.util.concurrent.Future.isDone() method) and if yes I replenish that empty future[0-9] object with a new one.

  • Call a C++ services using an uuid from java

    I need to call a C++ services which is using the UUID for RPC. The interface is having the UUID. The previous client program is also in C++, they have used RpcBindingFromStringBinding(UUID value, .,.,.) to call the interface. Right now I need to call this service from Java using the UUID. Can anyone help me in it.

    Passing the UUID should be the easy part, the tricky bit is performing an RPC from Java to C++. How are you doing that? Once you sort that out, passing arguments should be straight forward.
    Note: Java's RMI only works between a client server running RMI. To connect to C++ server, you need to use a Java client library which is compatible with your C++ server.
    If you still don't know how to perform the RPC call, I suggest you contact the people supporting the C++ program as they should know how RPC calls are made currently. If they don't know, it is highly unlikely we can guess a solution unless you are willing to change the C++ server to use a known RPC mechanism.

Maybe you are looking for

  • E-mail button changes email address when submitting

    Hello, For some reason when I try to e-mail my form when I hit the submit by e-mail button in the Send Form that pops up the e-mail address that the form is supposed to be sent to is different than what I have set it up to be on the form. I have trie

  • Repeating header

    Hi All; I have searched for information that would address this question, but I can't seem to locate anything. If it has, please direct me to the link, if it is posted in this forum. I have jut started using DW 8 for the first time (I used Golive bef

  • Mail not showing new mail count

    Very recently, Mail has stopped showing the new mail count next to the corresponding inbox on the bar on the left side of Mail. There are new emails sitting in the indox but it doesn't show a count. I upgraded to Mavericks and it there were no issues

  • Single query to get data from different databases

    i need to capture certain fields from certain tables in database 1 and certain fields from certain tables in database 2 into one file using a single SQL statement. i tried searching on the net i found that dblinks can help but iam not sure if ill be

  • How to integrate PC-UI workitems in UWL.

    Hello experts, I appreciate anyone sharing information or a cook book on "How to write a workflow method to present CRM PC-UI ACTIVITY in UWL". Thank you in advance. Regards, Krishna.