How to read output of native program

Hi,
I wrote a Java program that runs a native program. In my case, the native program is written in C++ and runs under Linux.
My purpose is, to start the native program and to capture the output of it and send also some input.
I found the code to do this on this website. I used the Process and Runtime classes to start my native program, The I used the following code the intercept the output of the program:
BufferedReader pInput = new BufferedReader(new InputStreamRead(process.getInputStream));
This code works perfectly fine for a native program that does his job and then exit. I guess the the output is only printed when the native job has ended.
That''s my problem, my program must continue to run, it never exits, so I never get the output of it except when I manualy close the program.
Isn't there an other way to get the output real time of my program, without it to wait for the end of the program?
Thanks

my case, the native program is written in C++ and
This code works perfectly fine for a native program
that does his job and then exit. I guess the the
output is only printed when the native job has
ended.Although I 'don't do C' :), my guess is that your native app should close the output device it's using (and that the Java app is using for it's inputstream) and re-open it again.
It shouldn't be needed to close your native application for this, only close the output device.
I think :)
Anne.

Similar Messages

  • How to read stdio of another program

    Hi,
    I have a program that reads data from PC serial port and prints that into the command prompt (stdio) in text format.
    The idea has been that the output is redirected to a file and then the file is analysed off-line with Excel or Matlab.
    Now I would like to make a front-end program with LabWindows that shows the data graphically in real-time.
    I don't want to change the original program that reads the port and prints the data to command prompt as it is needed as such also in the future.
    The question is how to read the stdio of another program in real-time with LabWindows?
    I have tried LaunchExecutable() to start the other program from LabWindows but cannot get hold of the data printed on the command prompt.
    There are examples of DDE-solutions for two programs to exchange data but this seems an overkill for my problem as there is only one-directional data that I want to read into the Labwindows program.
    I thought that it would be quite common to implement such a graphical front-end to display real-time graphics of some old text-based program. Amazing that there seems not to be good and easy solutions for LabWindows.
    (I did implement a quick solution with Qt but LabWindows would offer much better graphical elements for drawing the measurement data.)
    Thanks!

    Hi,
    Thank you for the link.
    I implemented those short programs in LabWindows and tried them. Yes, works perfectly!
    Write-program's output is redirected to a file with ">" and the Read-program can read the file even if the programs are running simultaneously.
    The bad news is that this does not work with the program that I need to use.
    There is a small difference in the behavior of the programs that write output to the command-promt. I don't understand why.
    1) The small Write-program implemented from the link opens a new command-prompt where the output goes if there is no redirection. And if there is the redirection ">" it still opens the new command-prompt but it stays empty as the ouput goes to the file. (And the Read-program can read the file; everything works okay.)
    2) The program that I need to use does not open a new command-prompt when started; it's output goes to the same command-prompt where it is started from. With redirection the output goes to the file; no new command-prompt this time either. But the problem is that the reading program cannot read the file. The Read-program can read the file if it has been created and written before. But not if it tries to read it at the same time that it is written by the other program.
    Maybe this is a simple problem if you know how to solve it... :-/

  • How to read output rows in alv

    I have made alv grid. i have given checkbox for user to select the row.
      so how to read the selected rows.

    hi
    *REPORT YMS_ALVINTER.
    *& tables declaration
    TABLES: VBRK,VBRP.
    *& type-pools declaration
    TYPE-POOLS: SLIS.
    *& data declaration
    DATA: G_REPID TYPE SY-REPID.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara
    WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
    WA_EVENT TYPE SLIS_ALV_EVENT,
    T_EVENT TYPE SLIS_T_EVENT.
    DATA: V_VBELN LIKE VBRK-VBELN,
    V_MATNR LIKE VBRP-MATNR.
    DATA: BEGIN OF IT_VBRK OCCURS 0,
    VBELN LIKE VBRK-VBELN,
    WAERK LIKE VBRK-WAERK,
    VKORG LIKE VBRK-VKORG,
    FKDAT LIKE VBRK-FKDAT,
    BUKRS LIKE VBRK-BUKRS,
    NETWR LIKE VBRK-NETWR,
    END OF IT_VBRK.
    DATA: BEGIN OF IT_VBRP OCCURS 0,
    VBELN LIKE VBRP-VBELN,
    POSNR LIKE VBRP-POSNR,
    FKIMG LIKE VBRP-FKIMG,
    VRKME LIKE VBRP-VRKME,
    NETWR LIKE VBRP-NETWR,
    MATNR LIKE VBRP-MATNR,
    ARKTX LIKE VBRP-ARKTX,
    END OF IT_VBRP.
    *& selection screen
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
    S_FKDAT FOR VBRK-FKDAT,
    S_MATNR FOR VBRP-MATNR.
    SELECTION-SCREEN END OF BLOCK B.
    **INITIALIZATION.
    INITIALIZATION.
    G_REPID = SY-REPID.
    S_FKDAT-LOW = SY-DATUM - 200.
    S_FKDAT-HIGH = SY-DATUM.
    APPEND S_FKDAT.
    ***AT SELECTION-SCREEN.
    AT SELECTION-SCREEN.
    IF NOT S_VBELN IS INITIAL.
    SELECT SINGLE VBELN FROM VBRK
    INTO V_VBELN
    WHERE VBELN IN S_VBELN.
    IF SY-SUBRC <> 0.
    MESSAGE E001(ZZ2).
    ENDIF.
    ENDIF.
    IF NOT S_MATNR IS INITIAL.
    SELECT SINGLE MATNR FROM MARA
    INTO V_MATNR
    WHERE MATNR IN S_MATNR.
    IF SY-SUBRC <> 0.
    MESSAGE E001(ZZ2).
    ENDIF.
    ENDIF.
    ***START-OF-SELECTION.
    START-OF-SELECTION.
    PERFORM GET_DATA_VBRK.
    *& Form GET_DATA_VBRK
    text
    --> p1 text
    <-- p2 text
    FORM GET_DATA_VBRK .
    SELECT VBELN
    WAERK
    VKORG
    FKDAT
    BUKRS
    NETWR
    INTO TABLE IT_VBRK
    FROM VBRK
    WHERE VBELN IN S_VBELN
    AND FKDAT IN S_FKDAT.
    ENDFORM. " GET_DATA_VBRK
    *& Form GET_DATA_VBRP
    text
    --> p1 text
    <-- p2 text
    FORM GET_DATA_VBRP .
    SELECT VBELN
    POSNR
    FKIMG
    VRKME
    NETWR
    MATNR
    ARKTX
    FROM VBRP
    INTO TABLE IT_VBRP
    WHERE VBELN = IT_VBRK-VBELN.
    ENDFORM. " GET_DATA_VBRP
    ***END-OF-SELECTION.
    END-OF-SELECTION.
    PERFORM EVENT_LIST.
    PERFORM GET_FIELD_CATALOG.
    PERFORM LIST_DISP .
    *& Form list_disp
    text
    FORM LIST_DISP .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = 'POPUP'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT = WA_LAYOUT
    IT_FIELDCAT = IT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = IT_VBRK
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " LIST_DISP
    *& Form GET_FIELD_CATALOG
    text
    --> p1 text
    <-- p2 text
    FORM GET_FIELD_CATALOG .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = G_REPID
    I_INTERNAL_TABNAME = 'IT_VBRK'
    I_STRUCTURE_NAME =
    I_CLIENT_NEVER_DISPLAY = 'X'
    I_INCLNAME = G_REPID
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
    CHANGING
    CT_FIELDCAT = IT_FIELDCAT
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " GET_FIELD_CATALOG
    *& Form event_list
    text
    --> p1 text
    <-- p2 text
    FORM EVENT_LIST .
    CLEAR WA_EVENT.
    WA_EVENT-NAME = 'USER_COMMAND'.
    WA_EVENT-FORM = 'USER_COMMAND'.
    APPEND WA_EVENT TO T_EVENT.
    CLEAR WA_EVENT.
    ENDFORM. " event_list
    *& Form user_command
    text
    -->R_UCOMM text
    -->RS_SELFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
    PERFORM GET_DATA_VBRP.
    PERFORM BUILD_FIELDCATALOG_VBRP .
    PERFORM DISPLAY_ALV_VBRP.
    ENDCASE.
    ENDFORM. "user_command
    *& Form BUILD_FIELDCATALOG_VBRP
    text
    --> p1 text
    <-- p2 text
    FORM BUILD_FIELDCATALOG_VBRP .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = G_REPID
    I_INTERNAL_TABNAME = 'IT_VBRP'
    I_STRUCTURE_NAME =
    I_CLIENT_NEVER_DISPLAY = 'X'
    I_INCLNAME = G_REPID
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
    CHANGING
    CT_FIELDCAT = IT_FIELDCAT
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " BUILD_FIELDCATALOG_VBRP
    *& Form DISPLAY_ALV_VBRP
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_ALV_VBRP .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = IT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = IT_VBRP
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_ALV_VBRP
    Message was edited by:
            Rammohan Nagam
    Message was edited by:
            Rammohan Nagam

  • How to read internal table other program (assign?)

    Hello techies,
    The problem >
    I have 2 Sap standard programs A & B
    I'm editing a userexit in program B but I need to read
    data from program A that is also running.
    While using the debugger, I can ask for the folowing
           (A)internaltable
            example : (SAPLMEPO)pot
    this shows the content of internal table "pot" of the program "SAPLMEPO".
    The question>
    How can I copy the content of a table(ex. pot) in program "A"(ex. SAPLMEPO) to a internal table pot2 of program "B"?
    Possible sollution (does not work in 5.0)
    CODE SAMPLE *************
    Fields          **
    data: w_name type char50,"help field
          w_recpot like ekpo."help structure
    Internal tables **
    data: Begin of it_pot2 occurs 0.
       include structure it_pot2.
    data: End of it_pot2
    field-symbols <fs_pot> type any table.
    w_structure_name = '(SAPLMEPO)pot'.
    assign (w_structure_name) to <fs_pot>.
    loop at <fs_pot> into w_recpot.
    it_pot2 = w_recpot.
    append it_pot2
    Endloop.
    END CODE SAMPLE *************
    Thanks in advance,
    Frederik

    Hi again,
    1. Simple.
    2. In your case, u should use
      <b>[]</b>
      DATA : myitab LIKE TABLE OF t001 WITH HEADER LINE.
      DATA : w_struct_name(100) TYPE c.
      BREAK-POINT.
      FIELD-SYMBOLS <fs_pot> TYPE ANY TABLE.
    <b>  w_struct_name = '(ZAM_TEMP0)ITAB[]'.</b>
      ASSIGN (w_struct_name) TO <fs_pot>.
    3. No need to use Loop etc.
    4. *----
    In your case
    CODE SAMPLE *************
    Fields **
    data: w_name type char50,"help field
    w_recpot like ekpo."help structure
    Internal tables **
    data: Begin of it_pot2 occurs 0.
    include structure it_pot2.
    data: End of it_pot2
    field-symbols <fs_pot> type any table.
    w_structure_name = '<b>(SAPLMEPO)POT[]</b>'.
    assign (w_structure_name) to <fs_pot>.
    NOT REQUIRED
    *loop at <fs_pot> into w_recpot.
    *it_pot2 = w_recpot.
    *append it_pot2
    *Endloop.
    END CODE SAMPLE *************
    regards,
    amit m.

  • How to see output of a program again, without running again?

    I have run a report that updates tables and shows the output, I ran the report and on the output screen I accidently pressed ESC key so it went back to selection screen. Is there any way to go back to the output screen without running the program again?
    Thanks for your inputs.

    There is a yes and no answer for it.
    Out of the box the answer is no.
    If however, the report program developer, exported the report to memory explicitly and the developer has provided you with an option via selection-screen to retrieve it from memory and display it then yes you could retrieve it. Alternative, the ouptut could have also been spawned to a spool which you could have displayed via SP01.

  • How to read data in a program from a MAINTENANCE View

    Hi Experts,
    Requirement:
    1. I have maintained a maintenance view on three Database tables.
    2.Data can be entered in the view as it is a Maintenace view as i have created maintenance generator for that and it is a requirement.
    3. In one of my programs i need to read this data, into an internal table, that is maintained through this view.
    Problem: When i am firing a SELECT query on this view, it goves me a syntax error that i cannot get data by select query on a Maintenance view.
    Solution required for: Is there any way i can get the data from this Maintenance view.
    Thanks in advance for your exteemed replies.
    Regards,
    Raghavendra Goutham P.

    Hi,
       Only projection view or database view can be used
       in select query.
        Find the tables used in view and
       Select data into report program by
        joining tables .
    Regards
    Amole

  • How to Email Output of Concurrent Program to set of Users

    Hi Everyone,
    I need to create a Custom concurrent program(Nothing but a PLSQL Program) to email the output of a concurrent program run to a set of users with request id as parameter.
    Please help me...!
    With Regards
    VeeJay

    Do not know Apps - and still have no idea what is implied with a "concurrent" program. Wish that systems/applications will use technology words correctly and appropriately...
    Also, you have not stated what the output is. Is is a text file? A CLOB? A ref cursor? A PL/SQL array? A 32KB varchar2? Something else?
    This output needs to be used to construct the e-mail.
    In order to mail anything you (the e-mail client) need:
    a) TCP client connectivity
    b) to construct a Mime (e-mail) body
    c) deliver that Mime body via TCP using the SMTP (Simple Mail Transfer Protocol)
    In Oracle 10.2.x that is as simple as making a single PL/SQL, courtesy of the UTL_MAIL package.
    In Oracle 9i and 10.1.x, that requires manually constructing a Mime body and then delivering it using the UTL_SMTP package.
    In Oracle 8i, that means using UTL_TCP if UTL_SMTP is not available.
    You need to consult the applicable documentation for that Oracle version. The document being "Supplied PL/SQL Packages and Types Reference" with Oracle 8i and 9i, and simply "PL/SQL Packages and Types Reference" with 10G and later.
    Documentation portal URL is http://tahiti.oracle.com

  • Database control: how to read output of sproc that returns result set

    I have a stored procedure that returns a result set. Should I use a RowSet control to wrap this, or a database control, or neither? Am I better off with straight JDBC in a Java control?
    Thanks.

    Sorry for missing the point totally...
    DOKTL also contains long text for FM parameters...
    This is a modified version of your code that retrieves the long text and displays it...
    DATA: parameter TYPE TABLE OF swotfupar,
          ls_parameter LIKE LINE OF parameter,
          search_string TYPE doktl-object,
          texttab type table of doktl-doktext with header line.
    PARAMETERS: fubaname TYPE swcontdef-abapname
                              DEFAULT 'POPUP_TO_CONFIRM',
                pa_lang TYPE sy-langu.
    START-OF-SELECTION.
      CALL FUNCTION 'SWO_QUERY_FUNCTION_PARAMETERS'
        EXPORTING
          functionmodule            = fubaname
        TABLES
          function_parameters       = parameter
    *   EXCEPTIONS
    *     FUNCTION_NOT_FOUND        = 1
    *     OTHERS                    = 2
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT parameter INTO ls_parameter.
        CONCATENATE `                              `            "30 spaces
                    ls_parameter-parameter INTO search_string.
        OVERLAY search_string WITH fubaname.
        SELECT doktext FROM doktl INTO TABLE texttab
               WHERE id = 'FU'
               AND langu = pa_lang
               AND object = search_string.
        WRITE:/ 'Long Text for', ls_parameter-parameter.
        LOOP AT texttab.
          NEW-LINE.
          WRITE: AT 10 texttab COLOR COL_HEADING.
        ENDLOOP.
      ENDLOOP.
    Hope this helps you
    Regards,
    Dushyant Shetty

  • How to read Update log/RFC Log IN SMSY programatically ?

    Hi all,
    In SMSY we have option to look at <b>update log/RFC Log</b> which shows the connection status for each RFC connection. there are cases where the connection has failed and we get logs as shown below
    Start of automatic data capture with source 'RFC_CALL'
    Start of data capture for system 'A1D'
    Get clients for system 'A1D'
    Clients for system 'A1D' found in RFC destination 'SM_A1DCLNT010_READ'
    Get software components for system 'A1D'
    Software components for system 'A1D' found in RFC destination 'SM_A1DCLNT010_READ'
    Determine the installed Support Packs for the system 'A1D'
    Support Packs for system 'A1D' determined by RFC destination 'SM_A1DCLNT010_READ'
    Get clients for system 'A1D'
    Clients for system 'A1D' found in RFC destination 'SM_A1DCLNT010_READ'
    Get server and instances for system 'A1D'
    Server for system 'A1D' found in RFC destination 'SM_A1DCLNT010_READ'
    Start of data capture for system 'AAE'
    Get clients for system 'AAE'
    Clients for system 'AAE' found in RFC destination 'SM_AAECLNT010_READ'
    Get software components for system 'AAE'
    Software components for system 'AAE' found in RFC destination 'SM_AAECLNT010_READ'
    Determine the installed Support Packs for the system 'AAE'
    Support Packs for system 'AAE' determined by RFC destination 'SM_AAECLNT010_READ'
    my question is:
    1) what does these logs signify
    2) how to read these logs in program and based on what selection
    need ur inputs on this....
    Best regards,
    Subba

    FOUND...

  • How to Read a Message with Content Type multipart/alternative

    Hi ,
    I need to write a POP3 Client to read email message ..but some times the messages comes with content type multipart/alternative
    how to parse it and read only one of the content :
    for example :
    This is a multi-part message in MIME format.
    ------=_NextPart_000_12C25_01C6B64F.09226B00
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    Assignment to workgroup Name 1 : L2 SD Service Delivery Apps Spt
    Open CI Search Code : HPSD
    Description : tesat
    General Information :
    Is the workgroup owner Aware of the addition to Workgroup : Yes
    Workgroup to be added :
    L2 SD Service Delivery Apps Spt
    ------=_NextPart_000_12C25_01C6B64F.09226B00
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <br><P>Assignment to workgroup Name 1 : L2 SD Service Delivery Apps =
    Spt</P>
    <P>Open CI Search Code : HPSD</P>
    <P>Description : tesat</P>
    <P>General Information :</P>
    <P>Is the workgroup owner Aware of the addition to Workgroup : Yes</P>
    <P>Workgroup to be added :</P>
    <P>L2 SD Service Delivery Apps Spt</P>
    <P> </P>
    <P> </P>
    <P> </P>
    <P> </P>
    <P> </P>
    ------=_NextPart_000_12C25_01C6B64F.09226B00--
    The Same message is in text as well as HTML so not sure how to read it .
    currently my program is as follows
    for (int i = 0; i < found.length; i++) {
    Message m = found;
    // Get some headers
    Date date = m.getSentDate();
    Address [] from = m.getFrom();
    String subj = m.getSubject();
    String mimeType = m.getContentType();
    System.out.println(date + "\t" + from[0] + "\t" +
    subj + "\t" + mimeType);
    Object o = m.getContent();
    if (o instanceof String) {
    System.out.println("**This is a String Message**");
    System.out.println((String)o);
    } else if (o instanceof Multipart) {
    System.out.print("**This is a Multipart Message. ");
    Multipart mp = (Multipart)o;
    int count3 = mp.getCount();
    System.out.println("It has " + count3 +
    " BodyParts in it**");
    for (int j = 0; j < count3; j++) {
    // Part are numbered starting at 0
    BodyPart b = mp.getBodyPart(j);
    String mimeType2 = b.getContentType();
    System.out.println( "BodyPart " + (j + 1) +
    " is of MimeType " + mimeType);
    Object o2 = b.getContent();
    if (o2 instanceof String) {
    System.out.println("**This is a String BodyPart**");
    System.out.println((String)o2);
    } else if (o2 instanceof Multipart) {
    System.out.print(
    "**This BodyPart is a nested Multipart. ");
    Multipart mp2 = (Multipart)o2;
    int count2 = mp2.getCount();
    System.out.println("It has " + count2 +
    "further BodyParts in it**");
    } else if (o2 instanceof InputStream) {
    System.out.println(
    "**This is an InputStream BodyPart**");
    } //End of for
    } else if (o instanceof InputStream) {
    System.out.println("***********************************This is an InputStream message**");
    InputStream is = (InputStream)o;
    /* if(m.getContentType().equalsIgnoreCase("multipart/alternative")) {
    MimeMultipart mp = new MimeMultipart();
    // Assumes character content (not binary images)
    } else {*/
    BufferedReader reader
    =new BufferedReader(new InputStreamReader(is));
    String thisLine=reader.readLine();
    while (thisLine!=null) {
    System.out.println(thisLine);
    thisLine=reader.readLine();
    So when the Content TYpe is multipart/alternative it goes into InputStream message .
    any help and ideas to handel such situations ?
    Thanks
    San
    Message was edited by:
    sanrosh_95

    Try reposting that with tags (replace the {'s with ['s).
    Long story short, I think the FAQ and examples would go a long way towards explaining this, but you basically can check the content type, or check if the content contains parts, and parse each part separately.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to send a  'ESC' to a native program

    Dear,
    I'm calling a native program using: Runtime.getRuntime().exec(cmd);
    This command opens cmd.exe.
    I use the outputstream to move to the right directory and open the desired program.
    The program executes properly but when it finishes, it asks to push the escape button to continue.
    How can I simulate the 'pressing of the escape button' via the outputstream?
    I already tried to send the entire ascii table(1 by 1) but the program doesn't terminate.
    Also tried the Robot class without success.
    Does someone knows how to handle this?
    Kind regards,
    Steven

    My life needs a "rewind/erase" button...
    camickr wrote:
    Either way, I'm afraid the Robot class does simulate events only in the current JVM. No, the Robot generates OS level events (is that the correct terminology), so the events are displatched to the application that has focusSorry, I made an unbacked assumption.
    OK so the problem may be to give the focus to the correct application.
    Here you have me a little confused (...) process.getInputStream() returns an InputStream, from the point of view of the launched native pogram, it's an OutputStream. The java program receives information via process.getInputStream().Yes, sorry, sorry, and sorry again. I wrote off memory without bothering a glance to the API, and I was absolutely wrong!
    I remember thinking "Remember that there's a trap in the naming of the methods..." :o)
    I'll try to remember as well "...and it is not what you thought!" :op
    The program that I'm calling does not have a GUI and it expects the pressing of the ESC-button on the keyboard.
    The program does not respond to the keyboard if the window is not active.That probably means the program does not read 'ESC' on its stdin, but merely listens for a "graphical" event indicating "key ESC pressed".
    In this case, as per camickr correction, Robot might generate this native event, but the app (or its launching window) will not receive it if it doesn't have the focus.
    One not-so-nice way could be to display the app window or terminal (using xterm -e /path/to/real/app on Unices, start \path\to\real\app on Windows, with various options to handle titles and pathes), and the user would have to click on this window and then type the 'ESC' key.
    A few words on the drawback:
    - how to automate giving the focus to the app terminal, so that the user doesn't have to click on it?
    Of course it depends on your application: is it general purpose app running on general purpose desktops, or worse portable across different OS? Then you're most probably stuck.
    I"ve had to work on constrained environments where our app were almost the only one to run, and managed the whole screen. When launching an external app from the main Java launcher, for some dedicated task, the main Java app would simply hide or iconify itself, and the forked app was the only active one.
    - how to automate typing the ESC key?
    See camickr reply about Robot being able to send a native event to the current focused app.
    - how to control (more or less) how the app terminal displays?
    Give up any hope of portability. But there are system-specific ways to fix a terminal's look (in the sense of "windowing-system-specific", two window managers on Linux will support different options).
    - how to pipe the launched app output to the Java window?
    First, that may not be necessary once you and the user have accepted that the native console will indeed show up. If you still want the app output, for display of to parse it from the Java launcher, then again look around system-specific options. e.g.:
    {code}xterm -l -lc <filename> -e /path/to/app{code}
    Edited by: jduprez on Jul 8, 2009 9:08 AM - fixed typo

  • How to read system eventlog using java program in windows?

    How to read system eventlog using java program in windows?
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Hi,
    There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
    The output of this command can be read using java program....
    we can use java exec for executing this system32 vbs script.
    use the below program and pass the command "eventquery"
    plz refer cscript,wscript
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec("Command");
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    input.close();
    catch (Exception err) {
    err.printStackTrace();
    This sample program will list all the system log information....
    Zoe

  • How to  read list output into itab? - URGENT

    hai experts,
    how to read current report output for further validation i need all data which is showing in output.
    my req is,
    to read list output all data put into itab.
    reward avail for useful answer....
    regards,
    jai.m

    Hi kumar,
    you said your using second one.
    it's good. then use the below part.but check the syntax because it is there in other programs what i have already phased.
    INCLUDE <%_list>.
    DATA %_LIST TYPE SLIST_LIST_TAB ." WITH HEADER LINE.
    DATA %_LIST_WA TYPE SLIST_LISTLINE.
    DATA: BEGIN OF data_tab OCCURS 0,
    line(255),
    END OF data_tab.
    & Then use:-
    LOOP AT %_list into %_list_wa.
    data_tab-line = %_list-line.
    data_tab-line = %_list_wa-line.
    APPEND data_tab.
    Clear data_tab.
    Clear %_list_wa.
    ENDLOOP.
    kindly reward me if it's ok

  • How can I run external console program, printing output to JTextPane?

    How can I run external console program, printing output to JTextPane?
    I have a console app. written in C++ and I would like to run in it from java swing app. and I would like to see its output in a JTextPane.

    I have used this article
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    to successfully pipe output from jboss batch files to a JTextPane.

  • How to read .xml file from embedded .swf(flash output) in captivate

    I have been trying to read .xml file from the .swf (Flash output) that is embedded within the captivate file but no luck yet . Please if anyone got any clue on how get this thing done using Action script 3.0 then let me know. I am using Adobe Captivate 5.5 at present and Flash CS 5.5.
    I am well aware about how to read .xml file through action script 3.0 in flash but when insert the same flash in captivate and publish nothing comes in captivate output. I would higly appreciate if anyone could help me out with that.
    Here is is graphical demonstration of my query :
    Message was edited by: captainmkv

    Hi Captainmkv,
    Does the information in this post cover what you're trying to do: http://forums.adobe.com/message/5081928#5081928
    Tristan,

Maybe you are looking for

  • Strange issue when typing a number in Lion

    Hi, I have a very rare issue when I type a number now and since I updated my system to Lion, no matter which program am I using, Safari, textedit, mail, etc. Every time I type a number (just one), it suddently erase itself, doesn't happen when I type

  • Error importing policies in OAM

    Hi Experts, I am getting following error while importing in OAM:- wls:/internal_iam_domain/serverConfig> importPolicy(pathTempOAMPolicyFile='/oracle/app/deploy/staging/sec-oam/oam_policy_internal.xml') Jan 3, 2013 4:29:49 PM oracle.security.am.wlst.W

  • Is ABAP expression FORM - PERFORM can be used in SAP BI 7.0 transformation

    Hello Is ABAP expression FORM - PERFORM can be used in SAP BI 7.0 transformations or method odf class is a recommended approach? Thanks

  • ALBPM x Process Archiving x Weblogic

    Hi, friends! How to "LAUNCH ARCHIVING VIEWER" in Weblogic? Anybody know where have documentation of this? Exists "GUI" for view this instances of process archiving in Weblogic? In albpm 5.7 the option is "Launch archiving viewer" in "ADMIN CENTER" I

  • Plain text menu

    Hi! How can I create a text menu in an application? I want to use the console for my programm. The menu should look like that: --> A B C The arrow should be moveable (with up/down) and the entry should be selectable (with enter). I have totaly no ide