Modal-like behaviour between two Jframes

Let�s say my app has 2 JFrames. The main JFrame is already loaded and from it, there is a menuitem that loads and shows the 2nd JFrame. I�d like to know how can I disable the main JFrame until the users requests to do so, clicking on some button or alike on the 2n JFrame.
I have tried to do .getContenPane().setEnabled(false) on the main JFrame before loading the 2n one, but it seems not wo work.
I have also considered going across all components inside the main JFrame, using getContentPane().getComponents() an on the returing array, do a setEnabled(false). But this seems quite a dirty way to accomplish it.
Any idea? JFrame does not offer a setModal() method? It�s kinda sick...
(No , I don�t want to make the 2nd JFrame into a JDialog that I know offers the setModal() method)....

I have tried to do .getContenPane().setEnabled(false) on the main JFrame
before loading the 2n one, but it seems not wo work.seems to work OK in this
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing
  public void buildGUI()
    JButton btn = new JButton("Show Other Frame");
    JPanel p = new JPanel(new GridBagLayout());
    p.add(btn,new GridBagConstraints());
    final JFrame f1 = new JFrame("f1");
    f1.getContentPane().add(p);
    f1.setSize(200,200);
    f1.setLocationRelativeTo(null);
    f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f1.setVisible(true);
    btn.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent ae){
        final JFrame f2 = new JFrame("f2");
        f2.addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent we){
            f1.setEnabled(true);
        f2.setBounds(100,100,150,100);
        f2.setVisible(true);
        f1.setEnabled(false);
  public static void main(String[] args)
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new Testing().buildGUI();
}

Similar Messages

  • Getting a coherent behaviour between two extensions of a bundle

    Hi,
    I have two extensions in my bundle. The first (A) needs the second (B) OPEN in order to get datas. I have fixed the problem of communication with CSXSEvents.  When the A is open, the B must be open too. But the B must evoluate by herself if the A is closed.
    The only solution i have found to get a coherent behaviour is to do "requestOpenExtension(B)"  on the following Event (com.adobe.indesign.Event.AFTER_SELECTION_CHANGED) of A.
    Obviously, even if I close those  two extensions and then, I change the selection, the extension B appears again.
    How can i  fix the problem? i have thought to close definitely the extension A on closing event of extension B but i'm not familiar with StateChangeEvent events and i'm not sure if it's the right solution. How can I close définitely an extension?
    Thanks for help .

    A solution which has worked for me in the past is to communicate via CSXS events - your first extension would register a listener for certain event types, and your second extension would dispatch events with that same type. Something like:
    // Extension A:
    CSXSInterface.getInstance().addEventListener(B_TO_A_EVENT, myEventHandler);
    // Extension B:
    CSXSInterface.getInstance().dispatchEvent(B_TO_A_EVENT, myCSXSEvent);
    If you need two way communication then you can additionally add an event listener in Extension B and dispatch from Extension A.
    Hope that helps!
    --Louis

  • Mapi connection behaviour between two sites-Exchange 2010

    Hello,
    I have small doubt, need help from you guys,
    i have two sites A, B,  DAG is span over the two sites;
    Both site has array Of different FQDN
    site A has active copies, its PASSIVE copies are in site-B
    i have witnesserver in third location
    if Active mailbox database in Site-A fails, passive copy on Site-B will become active;  i guess
    My question is ===>  without downtime or without MANUAL Task, will mapi connection goes to site-B copy ??? ,

    Hi,
    In Cross Site maintainence we, have to work out mainly on Database Activation Coordination Mode(DAC) which avoids the split brain syndrome.
    below URL's gives you clear vision on how we can do that and what it is for.
    - http://www.msexchange.org/articles-tutorials/exchange-server-2010/management-administration/planning-deploying-testing-exchange-2010-site-resilient-solution-sized-medium-organization-part7.html
    - https://technet.microsoft.com/en-us/library/dd979790.aspx
    Regards,
    Gowtham T

  • How to calculate hours between two dateTime node in BPEL.

    In my BPEL there's a requirement need calculate hours between two dateTime type..
    I tried 2 solutions, both of them failed:
    1. use xslt calculate duration(xml type, like PT12H) between two dateTime, and then use embedded java code to get the hours.. The problem is : I need to parse the xml duration format...(like this real one: -P80DT17H47M36S....), and to parse it in java , maybe have the same problem with solution 2..
    * [Subtracting 2 dateTime values into a duration using XPath 2.0|http://blogs.oracle.com/rammenon/2007/07/subtracting_2_datetime_values.html]
    2. use embed java code, but it seems we can't use some class in embedded java code:
    my code(input begin, end both dateTime in xml. output: diff, int in xml):
    1 System.out.println("\n\nTimeTestBegin");
    2 String begin=getVariableData("begin").toString();
    3 String end=getVariableData("end").toString();
    4 System.out.println(begin+"-----"+end);
    5 //Class c1=Class.forName("javax.xml.datatype.XMLGregorianCalendar");
    6 //Class c2=Class.forName("javax.xml.datatype.DatatypeFactory");
    7 //System.out.println(c1.getName());
    8 //System.out.println(c2.getName());
    9 javax.xml.datatype.XMLGregorianCalendar beginTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(begin);
    10 javax.xml.datatype.XMLGregorianCalendar endTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(end);
    11 long diff=beginTime.toGregorianCalendar().getTimeInMillis()-endTime.toGregorianCalendar().getTimeInMillis();
    12 setVariableData("diff",String.valueOf(diff/1000/3600));
    13 System.out.println("DIFF======"+diff/1000/3600);
    14 System.out.println("TimeTestEnd");
    it's said can't compile java class, but can't find the detail error, I think the problem is how to import java class to embedded java code activity(use full package name like above code don't work), when I remove line 9-13, no compile error..
    BTY: Jdeveloper is a IDE support java, but why the embedded java activity's edit window only have a simple "java code" editor, too simple that it can only edit you code snippet...
    3.There's another sulotion: extend BPEL xpath functions(add a new function), but in my project, modify BPEL server(soa server)'s config file is not allowed..
    Anyone know easy solution to my problem?
    Thanks.

    Hi, All,
    I found the cause. Sorry, it's my mistake..
    below line have a DatatypeConfigurationException:
    javax.xml.datatype.DatatypeFactory.newInstance()
    When I test my java code snippet, I coped the code snippet to one of my java class in eclipse, and put it in a method to check if there's compile error, but I didn't notice there's a "throws Exception"...
    the final java code snippet for test is :
    input: begin dateTime
    input: end dateTime
    output: diff int, how many hours in (begin-end)
    try{
    System.out.println("\n\nTimeTestBegin");
    String begin=getVariableData("begin").toString();
    String end=getVariableData("end").toString();
    System.out.println(begin+"-----"+end);
    javax.xml.datatype.XMLGregorianCalendar beginTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(begin);
    javax.xml.datatype.XMLGregorianCalendar endTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(end);
    long diff=beginTime.toGregorianCalendar().getTimeInMillis()-endTime.toGregorianCalendar().getTimeInMillis();
    setVariableData("diff",String.valueOf(diff/1000/3600));
    System.out.println("DIFF======"+diff/1000/3600);
    System.out.println("TimeTestEnd");
    }catch(Exception e){
    e.printStackTrace();
    }

  • Including a JDialog or JFrame between two rows in a JTable

    Hello,
    Is it possible to include a JFrame or JDialog between two rows in a JTable?
    I would like two have a JFrame or JDialog which shift all the rows below the row that I want in order to include a JFrame between them.
    Thank in advance

    [http://forums.sun.com/thread.jspa?threadID=5331582]

  • How do I place a fixed image and show it between two pages like the Global on Page 3 (LOE)?

    How do I place a fixed image and show it between two pages like the Global on Page 3 (LOE)?

    Ohoh, I do think so. It's the trick. Thanks
    BTW, How about including a widget within real time RSS feed?

  • I would like the share an iTunes library between two different accounts on one Mac. How do I do this?

    iTunes no longer works properly (aka at all) while using one of the user accounts set up on my iMac. It does, however, work when logging in under another user account on the same iMac. (if any of you can help me solve this issue that would be perfect). If there is no solution can anyone help with my request to share an iTunes library between two different accounts on one Mac. How do I do this?

    jc_hering wrote:
    that works for anything he purchases after he creates the new account.  What about his current music that currently resides in my itunes library?  How can I get his current music out of my library into his new account/library??  Thanks..
    Copy it to his computer into his iTunes library and authorize his computer with the iTunes account used to purchase them..
    You cannot tranfser items from one iTunes account to another. Purchased items remain part of the iTunes account is was purchased with.
    iTunes account - used to purchase items
    iTunes library - where purchases (and CD RIPs) go on the computer

  • Subject: How to do join between two tables using something like SE16

    SE16, SE11 provide form based interface query information from a single table. Is there a way to do join between two tables without creating an infoset erc? I am looking for something similar to sql join but in SAP BI 7.0
    Thanks.

    Hi
    Pls look into below links. Hope this helps you.
    1. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45bf455611d189710000e8322d00/content.htm
    2. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45a5455611d189710000e8322d00/content.htm
    Regards
    Sirigiri

  • Problem with replicated partitioning between two BSO db's. version 9.3.0.1

    Hi there,
    I have a problem with partitioning between two BSO db’s.
    I created the partition, it validates and I made an export for the partion definiton(xml file).
    Everything is fine if I set this partition up as transparent partition.
    This means I can see the data from the src in the trg db as ecpected.
    But when I change over to replicated (what in fact I want to do) nothing happens for the trg site - there are still no data. (Yes I have choosen Update all cells.)
    I got no error in any way neither AAS nor in the app logs of src and trg.
    (Mayby this it important: one src-dimension is mapped to void for the trg.)
    Can anyone give me a hint or even confirm this behaviour ?
    Thank you in advance
    Andre
    Below the log infos:
    log of src db:
    [Fri Dec 04 15:29:03 2009]Local/AAA///Info(1013210)
    User [hyperion] set active on database [db]
    [Fri Dec 04 15:29:03 2009]Local/AAA/db/hyperion/Info(1013091)
    Received Command [PutReplicatedCells] from user [hyperion]
    [Fri Dec 04 15:29:03 2009]Local/AAA///Info(1013210)
    User [hyperion] set active on database [db]
    [Fri Dec 04 15:29:03 2009]Local/AAA/db/hyperion/Info(1013091)
    Received Command [XferReplicatedCells] from user [hyperion]
    [Fri Dec 04 15:29:03 2009]Local/AAA///Info(1013214)
    Clear Active on User [hyperion] Instance [1]
    [Fri Dec 04 15:29:03 2009]Local/AAA/db/hyperion/Info(1023005)
    Update of replicated partition elapsed time : [0] seconds
    [Fri Dec 04 15:29:03 2009]Local/AAA/db/hyperion/Info(1243010)
    Partition refreshed
    log of trg db:
    [Fri Dec 04 15:29:03 2009]Local/AAA1///Info(1013210)
    User [hyperion] set active on database [db]
    [Fri Dec 04 15:29:03 2009]Local/AAA1/db/hyperion/Info(1013091)
    Received Command [ReqXferReplicatedCells] from user [hyperion]
    [Fri Dec 04 15:29:03 2009]Local/AAA1///Info(1013210)
    User [hyperion] set active on database [db]
    [Fri Dec 04 15:29:03 2009]Local/AAA1/db/hyperion/Info(1013091)
    Received Command [ProtocolXchg] from user [hyperion]
    [Fri Dec 04 15:29:03 2009]Local/AAA1/db/hyperion/Info(1023044)
    Processing distributed request from [P4B5A856A, AAA, db]
    [Fri Dec 04 15:29:03 2009]Local/AAA1/db/hyperion/Info(1013091)
    Received Command [PutLastUpdatedTime] from user [hyperion]
    [Fri Dec 04 15:29:03 2009]Local/AAA1///Info(1013214)
    Clear Active on User [hyperion] Instance [1]
    [Fri Dec 04 15:29:03 2009]Local/AAA1///Info(1013214)
    Clear Active on User [hyperion] Instance [1]

    It sounds like you are doing it all correctly. One thing you might try just to be sure you are not getting any data in the target database is the following:
    1) clear the target database
    2) Run the replication for all cells
    3) Run an export of all data on the target database
    See if you get anything in the export file, maybe you are getting some of the data or possibly it is a rollup issue. Just a thought.
    Jeff

  • Hide values in URL, passing data between two webdynpro(ABAP) applications.

    Hi
       When transferring the data between two webdynpro applications,  How to hide the values in URL.
    Example : First application is using for login
                    Second application is for some transactional screens.
    Based on first application login data second application should trigger. When passing the user id and password thru URL every one can see the user name and password at internet explorer, so how to hide that user name and password in URL.
    Thanks
    Murali Papana.

    Hi Lekha,
        Thanks for your reply, but I could not find parameter like visibility, andi found HAS_TOOLBAR but no use.
    I set it like
    CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
      EXPORTING
        URL            = 'http://*****:8000/sap/bc/webdynpro/sap/Y1app1/?sap-language=EN&sap-client=200&sap-user=1104&sap-password=abcd'
        MODAL          = ABAP_FALSE
        HAS_MENUBAR    = ABAP_TRUE
        IS_RESIZABLE   = ABAP_TRUE
        HAS_SCROLLBARS = ABAP_TRUE
        HAS_STATUSBAR  = ABAP_TRUE
        HAS_TOOLBAR    = ABAP_FALSE
        HAS_LOCATION   = ABAP_TRUE
      RECEIVING
        WINDOW         = lo_window.
    Thanks
    Murali Papana.

  • Signalling between two Windows

    I am not sure how to signal between two Windows created in the same Thread.
    Suppose I have two Windows, WindowA and WindowB (either is a descendent from the Window hierarchy - ie. JFrame, JDialog, etc.).
    WindowB can be instantiated with different parameters that cause it to look different.
    I want to do something like this in a method in my WindowA class: (pseudo-code)
    for int 1 to n
    hide this window; (i.e. WindowA)
    instantiate and display a new WindowB object (with xxxxx parameters)
    wait for WindowB to signal this WindowA object that it should
    now create a new WindowB object and display that new object
    somewhere in Class code for WindowB
    signal WindowA;
    How do I set up a "wait and signal" between the two Windows? Without it, WindowA will keep going through the for loop creating new Windows immediately -> I would like it to wait until WindowB signals that it is ok to do so.
    Thanks for any help.
    -TJW

    Here's an example:
    class CreateWindows {
         int count = 0;
         int limit = 5;
         public CreateWindows(int limit) {
              this.limit = limit;
              create();
         void create() {
              if (++count < limit) {
                   new WindowA(new SignalListener() {
                        public void signal() {
                             create();
    interface SignalListener {
         void signal();
    class WindowA {
         public WindowA(SignalListener listener) {
              // do things
              listener.signal();

  • Executing Methodes between different JFrames

    hi everybody.
    I have a prop and dont know what the best way is to fix it. There are two JFrames (named F1 and F2) wich are created by a main class (lets say F3). Does anybody know what the best way is to get the reference between those two objects (f1 and f2) so that i can call methodes between those objects (f1,f2). For example i want to perform a methode of f2 from the first JFrame f1 without using a static context.
    in f1 something like this:
    f2.bar();
    thx

    Kangal,
    I suspect Kangal is another alias for CoWork? Spelling and syntax are very similar to posts under that ID. If not, please see this thread:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=388361&tstart=0&trange=100
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is there a way to dispatch or bubble events between two pop-up windows?

    Hi. I was wondering if there is a way to dispatch custom
    events between two or more pop-up windows created using the
    PopUpManager?
    I understand how to pass an event from one pop-up window to
    the main application (or FrontController) by dispatching the event
    from Application.application under Cairngorm 2.0.
    However, as I understand it, that will only bubble the event
    through the Application chain of visual controls and not to the
    other pop-up windows created using the PopUpManager.
    I tried dispatching the event directly from the pop-up window
    itself, but the other pop-ups still does not seem to receive the
    event.
    It would be nice to be able to do this so that each non-modal
    pop-up can have some awareness with each other.
    Thank you very much in advance.

    If you have just 2 pop-ups you can have them each do a
    addEventListener on the other, listening for the event (custom or
    otherwise).
    If you have an unpredicatable number, then you devise
    something else. Suppose you have 3 pop-ups, p1, p2, and p3. Let's
    say you also have 1 custom event, E1. Any of those pop-ups is
    capable of dispatching an E1 event and you want all of them to
    receive it.
    Create a class that extends EventDispatcher and instantiate
    an object of that class. Each pop-up "registers" with that class,
    something like:
    controller.addEventListener( "E1", handler ); where handler
    is a function in the pop-up.
    When a pop-up wants to dispatch an E1 event, it does it
    through the controller: controller.dispatchEvent( new E1(data) );
    This will automatically dispatch that event to all the
    pop-ups, including the one that dispatched the event. So a pop-up
    will have to examine the event to see if it sent it and perhaps
    ignore it.

  • Using Lightroom Cloud to Sync Catalog Between Two Machines

    I have use of so many cloud services including the 20gb that Adobe gives me.  Is there a way i can sync my catalog on the cloud so that i can have all my metadata on both my laptop and desk top?  I also have 300gb of cloud storage though Copy.  I would just like some recomendations on how best to go about it. Thanks

    Hi Pat,
    Using Lightroom Cloud to Sync Catalog Between Two Machines
    If you’re running Lightroom on a laptop during your location shoots, you might want to take all the edits, keywords, metadata, and of course the photos themselves, and add them to the Lightroom catalog on your studio computer. It’s easier than it sounds: basically, you choose which catalog to export from your laptop, then you take the folder it creates over to your studio computer and import it.
    You need to decide whether you want to export a folder (all the imported photos from your shoot), or a collection (just your Picks from the shoot). In this case, we’ll go with a collection, so go to the Collections panel and click on the collection you want to merge with your main catalog back in your studio. (If you had chosen a folder, the only difference would be you’d go to the Folders panel and click on the folder from that shoot instead. Either way, all the metadata you added, and any edits you made in Lightroom, will still be transferred over to the other machine.)
    Please refer to http://www.peachpit.com/articles/article.aspx?p=1930499 for more details.
    Thanks!
    Eshant Jindal

  • Unable to find line break between two lines in attachment file.

    Dear all I will be very great full if someone help me out,
    I am trying to send mail through SMTP server with an attachment of oracle report, but I am unable to find line break between two lines, when I down load the attachment from mail and open attach.txt file by double click on it. Next line starts right after previous line ends, it should starts with new line.
    In order to send an attachment file, I am reading source file line by line and put MIME protocol’s attachment instance, contain of source file is being properly written into target file if I open that attachment on cmd prompt.
    Following code may help you to understand the case.
    Thanks in advance.
    My code is as follows:-
    create or replace procedure bec_file_test
    v_subject varchar2, -- Subject of the email
    v_body varchar2, -- Body of the email
    v_from VARCHAR2 default 'XYZ.com', -- sender mail id
    v_to varchar2 default 'XYZ.com', -- Field To of the email
    v_cc varchar2 default 'XYZ.com' -- cc address
    ) is
    -- variable to hold the smtp server connection
    v_smtp_connection utl_smtp.connection;
    -- variable to hold the smtp host name
    v_smtp_host varchar2(100) default 'mail.bec-group.com';
    -- variable to hold the smtp port
    v_smtp_port number default 25;
    -- composite of {CR}{LF} caridge return and line feed.
    CRLF varchar2(2):=CHR(13)||CHR(10);
    cursor pr_rec is
    select requisition_no,line_no,release_no,a.contract,
    a.project_id,substr(a.activity_seq,1,11)ACT_SEQ,
    substr(a.part_no,1,12)PART_NO,
    substr(a.description,1,32)DESCRIPTION,
    substr(a.Bal_qty,1,8) BAL_QTY,
    substr(a.unit_meas,1,5)UOM,
    a.wanted_receipt_date WAN_REC_DT,
    a.latest_order_date LAT_ORD_DT
    from bec_pr_line_rep a
    where a.Bal_qty>0 and a.header_state not in 'Closed'
    and upper(a.state1) like 'RELEASED' and a.contract not in ('U1ENG','ULENG','U1FND','U2FND')
    and a.buyer_code='70306'
    order by a.part_no;
    begin
    declare
    fHandle UTL_FILE.FILE_TYPE;
    v_msg_line varchar2(2000);
    -- v_buffer varchar2(20000);
    --ALTER SYSTEM SET utl_file_dir = 'D:\Database\temp'
    --COMMENT='Temporary change on Dec 14'
    --SCOPE=SPFILE;
    SELECT name, value
    FROM gv$parameter
    WHERE name = 'utl_file_dir';
    --drop directory my_directory
    --CREATE or replace DIRECTORY my_directory AS 'D:\database\temp';
    --GRANT read,write ON DIRECTORY my_directory TO PUBLIC;
    begin ---writing data into a file.
    fHandle := UTL_FILE.FOPEN('MY_DIRECTORY', 'pending_pr_summry.txt', 'w');
    UTL_FILE.put_line(fHandle, ' Pending PR to process (detail report)');
    UTL_FILE.put_line(fHandle,TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
    UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
    UTL_FILE.put_line(fHandle, 'Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt' );
    UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
    for pr_temp in pr_rec loop
    begin
    v_msg_line:=to_char(rpad(pr_temp.requisition_no,12,' ')||'|'||
    lpad(pr_temp.line_no,3,' ')||'|'||
    lpad(pr_temp.release_no,3,' ')||'|'||
    rpad(pr_temp.contract,7,' ')||'|'||
    lpad(nvl(pr_temp.project_id,' '),7,' ')||'|'||
    lpad(nvl(pr_temp.act_seq,' '),12,' ')||'|'||
    lpad(pr_temp.part_no,12,' ')||'|'||
    rpad(pr_temp.description,35,' ')||'|'||
    lpad(pr_temp.bal_qty,10,' ')||'|'||
    rpad(pr_temp.uom,6,' ')||'|'||
    lpad(pr_temp.wan_rec_dt,14,' ')||'|'||
    lpad(pr_temp.lat_ord_dt,14,' '));
    UTL_FILE.put_line(fHandle,v_msg_line);
    end;
    end loop;
    UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
    UTL_FILE.put_line(fHandle, ' Regards : IFSAPP ( Application owner ) ');
    UTL_FILE.FCLOSE(fHandle); ------------writing into file is successfuly done here!
    --Reading of file starts here containt will be added in attchment file
    fHandle :=UTL_FILE.FOPEN('MY_DIRECTORY','pending_pr_summry.txt','R' );
    -- establish the connection to the smtp server
    v_smtp_connection := utl_smtp.open_connection(v_smtp_host, v_smtp_port); /** OPEN CONNECTION ON THE SERVER **/
    -- perform a handshake with the smtp server
    utl_smtp.helo(v_smtp_connection, v_smtp_host); /** DO THE INITIAL HAND SHAKE **/
    -- set the 'from' address of the message
    utl_smtp.mail(v_smtp_connection, v_from);
    -- add the recipient to the message
    utl_smtp.rcpt(v_smtp_connection, v_to);
    -- send the email
    utl_smtp.open_data(v_smtp_connection);
    v_msg_line:='Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || CRLF ||
    'From: ' || v_from || CRLF ||
    'Subject: ' || v_subject || CRLF ||
    'To: ' || v_to || CRLF ||
    'Cc: ' || v_cc || CRLF ||
    'MIME-Version: 1.0'|| CRLF || -- Use MIME mail standard
    'Content-Type: multipart/mixed;'||CRLF ||
    ' boundary="-----SECBOUND"'||CRLF||
    CRLF ||'-------SECBOUND'|| CRLF ||
    'Content-Type: text/plain;'|| CRLF ||
    'Content-Transfer_Encoding: 7bit'|| CRLF ||
    CRLF ||v_body|| CRLF;     -- Message body
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    v_msg_line:='-------SECBOUND'|| CRLF ||
    'Content-Type: application/octet-stream;'|| CRLF ||
    'Content-Type: text/plain;'|| CRLF ||
    'name="pending_pr_summry.txt"'|| CRLF ||
    'Content-Transfer_Encoding: 8bit'|| CRLF ||
    'Content-Disposition: attachment;'|| CRLF ||
    ' filename="pending_pr_summry.txt"'|| CRLF || CRLF;     -- Content of attachment
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    -- check file is opened
    IF utl_file.is_open(fHandle) THEN
    -- loop lines in the file
    LOOP
    BEGIN -- Content of attachment
    utl_file.get_line(fHandle,v_msg_line);
    v_msg_line:=concat(v_msg_line,CRLF);
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    END LOOP;
    END IF;
    --end of attachment containt     
    utl_smtp.write_data(v_smtp_connection,v_msg_line);
    UTL_FILE.FCLOSE(fHandle);
    utl_smtp.close_data(v_smtp_connection);
    utl_smtp.quit(v_smtp_connection);
    exception
    when utl_smtp.invalid_operation then
    dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
    when utl_smtp.transient_error then
    dbms_output.put_line(' Temporary e-mail issue - try again');
    when utl_smtp.permanent_error then
    dbms_output.put_line(' Permanent Error Encountered.');
    when others then
    dbms_output.put_line('Exception: SQLCODE=' || SQLCODE || ' SQLERRM=' || SQLERRM);
    RAISE;
    end;
    end bec_file_test;

    Pending PR to process (detail report)01-17-13 12:43:19 PM--------------------------------------------------------------------------------------------------------------------------------------------------Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt--------------------------------------------------------------------------------------------------------------------------------------------------MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade |500|kg |30-NOV-2012| 20-nov-2012MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012MAT/250606 | 2| |NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | |1|NMDCJ|6001|100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1|pkt | 25-DEC-2013| 14-dec-2013--------------------------------------------------------------------------------------------------------------------------------------------------
    where as source file is like that:-
    Pending PR to process (detail report)
    01-17-13 12:43:19 PM
    Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt
    MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade | 5500|kg | 30-NOV-2012| 20-nov-2012
    MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012
    MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012
    MAT/250606 | 2| 1|NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012
    MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012
    MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
    MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012
    MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012
    MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1 |pkt | 25-DEC-2013| 14-dec-2013
    Ignore alignment. It is well formatted in source file.

Maybe you are looking for

  • Required Text Field for automatically generated line items

    Hi Experts, I have noticed that when additional line items is automatically generated by SAP, the line item text field becomes required for those items.  This happens regardless of the configuration made in the field status group.... For example, whe

  • XML data output file in a directory needs to be published as a pdf report

    Hi, I have already got an XML output file in a directory. I want to display it using RTF template using a concurrent program or some sort of java api in a pdf format to be able to print it. How do I do it? Do I have to write another file output comma

  • List of approvers in SRM

    Is there easy was to get list of approvers and levels of approval out of SRM by cost centre

  • Photoshop CS4 64 Bit

    I am running Adobe Photoshop on Windows Vista 64 Bit. Some problems aroused while using the 64 bit version and I was now wondering if I could just remove the folder for Adobe Photoshop (64 Bit) since Adobe Photoshop works fine without it anyway?

  • T61 Rescue and Recovery - system restore has no restore points

    Hello I just got a T61 with Vista basic, I made some restore points in Vista but in ThinkVantage, system restore there is no restore points in the "Main hard disk" area. I also have updated using ThinkVantage system update, all the crucial items. Is