How to convert the local file into unicode file?

Hi All,
I need read local file (GUI_UPLOAD) and save it as unicode file?
I've found class CL_ABAP_CONV_OUT_CE but I've no idea how to use it.
Should I read file in binary mode and then convert it into unicode? AT the and save it (GUI_DOWNLOAD) ?
Thanks
Adam

Hi,
Check these classes, will help you
CL_ABAP_CONV_IN_CE : Reading binary data
CL_ABAP_CONV_OUT_CE : exporting binary data
CL_ABAP_CONV_X2X_CE : reading and exporting binary data and changing the format
Regards,
Satish

Similar Messages

  • How to download the script data into pdf file

    how to download the script data into pdf file
    i have one option to download the script data to pdf file --->rstxpdft4 program.
    i have one doubt how to use this proogram.or any function module to download the script data to pdf file.
    Thanks and regards,
    Sri.

    Hi      Sri Sai,
    I know one method to convert the sapscript to pdf file :
    first generate a Spool Request for the required Sapscript
    then goto transaction SP01 and copy the generated Spool Request number
    now execute the SAP report RSTXPDFT4
    here enter the copied Spool request number and the target directory into the parameters
    execute the report
    required pdf file will be generated into the target directory
    i hope it will help you out
    Please refer this simple program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Reward points if found helpful....
    Cheers,
    Eshwar.

  • I loaded my ipad photos from camera and all the pictures sorted by date.  Next, I did a sync with my computer and the photos were all reorganized into IMPRT folders an out of date sequence.  Any idea how to put the photos back into date files?

    I loaded my ipad photos from camera and all the pictures sorted by date.  I later sync my ipad with my computer and the photos were all reorganized into IMPRT folders an out of date sequence.  Any idea how to put the photos back into date files other than reloading all of them from camera?

    What version of iPhoto?
    Select one and rotate it. Then rotate it back. Does that make it appear? 
    A much better work flow is the keep the photos after importing.  Check the success the import, wait for at least one successful backup cycle then use you camera's format command to reformat the card
    LN

  • How to convert a large PDF into smaller files

    How does one convert a large PDF file into smaller files and not get odd page breaks.  Need to get the page breaks at the headers.  Just looking for instructions for an end user of Acrobat Pro who reports getting random page breaks and couldn't get help from the Adobe help desk.  I was directed here when I tried to contact support ... Figure this forum may have information. ... thanks.

    You can't. If you split the file into pages it will remain in the same layout the original has. PDF files were not meant to be edited in the way you're describing.

  • How to convert the text field into currency field

    Hi,
    I have an requirement to converting the text field into currency.
    If I convert directly it gives dump.
    If I convert this to Numeric means it takes the decimals also as whole value.
    Is there any FM to convert the text field into Currency field.
    Please advice me.
    Thanks in advance.

    Hi,
    I am on an SRM sytem, which unfortunately does not have th FM: PSSV_TEXT_INTO_FIELD_CURRENCY.
    But I also need to transfer a string value like '12,99' to a field with type curr.
    Can i Do that manually, or is there another FM?
    I have already checked code with write to or pack/unpack.
    But without success yet.
    Something like this:
    DATA: g_str(11) type c.
    DATA: g_p type p.
    WRITE '12,99' TO g_str CURRENCY 'EUR'.
    is no use for me. Finally I need to move g_str to my curr-field, which causes st22.
    also: PACK g_str to <curr-field or g_p> dumps.
    Help appreciated.
    regards, matthias

  • RE: How to Export the Table data Into PDF File  in ADF

    Hi Experts,
    I am using Jdeveloper 11.1.2.3.0
    I am created employee VO and Drag and Drop as a Table in a page. So need to Export the Table data into A PDF file.
    So please give me some suggestions regarding this Scnerio.
    With Regards,
    satish

    Hi Guys ,
    Any more answers for this question.
    Please find my jsff below
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core" xmlns:report="http://www.adfwithejb.blogspot.com">
      <af:panelGroupLayout layout="vertical" id="pgl2">
          <af:query id="qryId1" headerText="Service Tariff Mapping Details" disclosed="true"
                    value="#{bindings.findByTarifValidFromQuery.queryDescriptor}"
                    model="#{bindings.findByTarifValidFromQuery.queryModel}"
                    queryListener="#{reportWiseInvoiceBean.genericQueryListener}"
                    queryOperationListener="#{bindings.findByTarifValidFromQuery.processQueryOperation}"
                    resultComponentId="pc1::t2">
         <f:attribute name="queryExpression" value="bindings.findByTarifValidFromQuery.processQuery"/>
                          </af:query>
        <af:panelCollection id="pc1" styleClass="AFStretchWidth">
          <f:facet name="menus"/>
          <f:facet name="toolbar">
              <af:toolbar id="t1">
                 <af:menuBar id="pt_m1">
                <report:reportDeclarative ButtonName="ExportToExcel" ReportName="ServiceTariffMappingDetails"
                                          ReportType="PDF" TableId=":::pc1:t2" id="rd1" Pagination="true"/>
                <af:commandButton text="excel" id="cb1" binding="#{exportToExcelBean.exportID}">
                <af:setActionListener from="pt1:pgl1:pgl2:pc1:t2" to="#{viewScope['exporter.exportedId']}"/>
                <af:setActionListener from="border:1px solid #cccccc" to="#{viewScope['exporter.thStyle']}"/>
                <af:setActionListener from="border:1px solid #cccccc" to="#{viewScope['exporter.tdStyle']}"/>
                <af:fileDownloadActionListener method="#{exportToExcelBean.exportToExcel}" filename="Service TariffMapping.xls"
                                                 contentType="text/excel;chatset=UTF-8;"/>
                </af:commandButton>
                <af:commandMenuItem id="pt_cmi133" icon="/images/common/Excel-icon.png"
                                                shortDesc="ExportToExcel"
                                >
                                <af:exportCollectionActionListener exportedId="t2" type="excelHTML"
                                                                   title="Service Tariff Mapping"
                                                                   filename="Service Tariff Mapping.xls"/>
                            </af:commandMenuItem></af:menuBar>
              </af:toolbar>
          </f:facet>
          <f:facet name="statusbar"/>
          <af:table value="#{bindings.ServiceTariffMappingDtlsRVO1.collectionModel}" var="row"
                    rows="#{bindings.ServiceTariffMappingDtlsRVO1.rangeSize}"
                    emptyText="#{bindings.ServiceTariffMappingDtlsRVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
                    fetchSize="#{bindings.ServiceTariffMappingDtlsRVO1.rangeSize}" rowBandingInterval="0"
                    filterModel="#{bindings.findByTarifValidFromQuery.queryDescriptor}"
                    queryListener="#{bindings.findByTarifValidFromQuery.processQuery}" filterVisible="true" varStatus="vs"
                    id="t2" columnStretching="last" binding="#{ServiceTariffMappBean.testTable}">
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.label}"
                       id="c1">
              <af:inputText value="#{row.bindings.NormalTariffCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.tooltip}" id="it1">
                <f:validator binding="#{row.bindings.NormalTariffCode.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.label}"
                       id="c2">
              <af:inputText value="#{row.bindings.ServiceCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.tooltip}" id="it2">
                <f:validator binding="#{row.bindings.ServiceCode.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.label}" id="c3">
              <f:facet name="filter">
                <af:inputDate value="#{vs.filterCriteria.TrfVldFrm}" id="id1">
                  <af:convertDateTime pattern="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.format}"/>
                </af:inputDate>
              </f:facet>
              <af:inputDate value="#{row.bindings.TrfVldFrm.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.displayWidth}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.tooltip}" id="id2">
                <f:validator binding="#{row.bindings.TrfVldFrm.validator}"/>
                <af:convertDateTime pattern="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.format}"/>
              </af:inputDate>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.label}"
                       id="c4">
              <af:inputText value="#{row.bindings.ServiceDesc.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.tooltip}" id="it3">
                <f:validator binding="#{row.bindings.ServiceDesc.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.label}" id="c5">
              <af:inputText value="#{row.bindings.OtTrfCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.tooltip}" id="it4">
                <f:validator binding="#{row.bindings.OtTrfCode.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.label}" id="c6">
              <af:inputText value="#{row.bindings.OtUnitRate.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.tooltip}" id="it5">
                <f:validator binding="#{row.bindings.OtUnitRate.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.label}" id="c7">
              <af:inputText value="#{row.bindings.NtUnitRate.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.tooltip}" id="it6">
                <f:validator binding="#{row.bindings.NtUnitRate.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.label}" id="c8">
              <af:inputText value="#{row.bindings.TrfGrt.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.tooltip}" id="it7">
                <f:validator binding="#{row.bindings.TrfGrt.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.label}"
                       id="c9">
              <af:inputText value="#{row.bindings.ChargePartyCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.tooltip}" id="it8">
                <f:validator binding="#{row.bindings.ChargePartyCode.validator}"/>
              </af:inputText>
            </af:column>
          </af:table>
        </af:panelCollection>
      </af:panelGroupLayout>
    </jsp:root>

  • How to import the Local WDP into NWDI

    Hi,
    I have developed a WDP application, i have created this under "My Components" section of the Development Configuration perspective in NWDS.
    Can you please guide me how can i import this application into the NWDI?
    BR,
    Bharath

    Hi Bharath,
    is it [this|http://help.sap.com/saphelp_nw70/helpdata/EN/42/c8204dd57f136fe10000000a1553f7/frameset.htm] that you'd like to do?
    HTH,
    Carsten

  • How to convert the exponential data into number

    Hi,
    I have a table with a column which is a vaarchar2(60). I have a CSV file in which, I have stored value as 77052512125510000, but it got converted into 7.71E16. And when I have stored the same in the database, it got saved as 7.71E16. How can I get the original value
    Please help
    Regards
    Edited by: Sarma12 on May 25, 2012 3:11 AM

    Sarma12 wrote:
    The issue is, the data is already copied into the database. Now while retrieving from the database, I am getting that value in the scientific notation and not similar to the data which I have in the CSV file.
    RegardsYou need to be smarter than the tools you use
    bcm@bcm-laptop:~$ sqlplus user1/user1
    SQL*Plus: Release 11.2.0.1.0 Production on Fri May 25 09:50:02 2012
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    09:50:03 SQL> @test
    09:50:07 SQL> drop table test;
    Table dropped.
    09:50:09 SQL> create table test (id number);
    Table created.
    09:50:10 SQL> insert into test values (77052512125510000);
    1 row created.
    09:50:10 SQL> select * from test;
         ID
    7.7053E+16
    09:50:10 SQL> column id format 999999999999999999999
    09:50:10 SQL> select * from test;
                  ID
         77052512125510000
    09:50:10 SQL>
    09:50:10 SQL>

  • How to Convert an internal table into Text File

    Hello friends,
    Can you help me to find out the way to convert an internal table data into a flat file.
    the problem is that my internal table contains fields with data type INT also.

    please  go through the code and the parameter passed to the  finction module  ... since  you didn't show your coding  i am giving you the sample code  also ..
    REPORT y_ss_test_ekko .
    * To hold selection data
    DATA: i_ekko TYPE STANDARD TABLE OF ekko.
    * To hold converted text data
    DATA: i_text(4096) TYPE c OCCURS 0.
    * Selection Screen
    PARAMETERS: p_ebeln LIKE ekko-ebeln.
    * Select data into an ITAB based on the selection Criteria
    SELECT * FROM  ekko
             INTO  TABLE i_ekko
             WHERE ebeln = p_ebeln.
    * Process further only if found some data
    IF NOT i_ekko[] IS INITIAL.
    * Convert data in internal table to a delimited text data
      CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
           EXPORTING
                i_field_seperator    = '|'
           TABLES
                i_tab_sap_data       = i_ekko
           CHANGING
                i_tab_converted_data = i_text
           EXCEPTIONS
                conversion_failed    = 1
                OTHERS               = 2.
      IF sy-subrc <> 0.
        WRITE: / 'Program failed to Convert data.'.
      ELSE.
    *   Download convert data to Presentation Server
        CALL FUNCTION 'DOWNLOAD'
             TABLES
                  data_tab = i_text
             EXCEPTIONS
                  OTHERS   = 8.
        IF sy-subrc <> 0.
          WRITE: / 'Program failed to download data.'.
        ENDIF.
      ENDIF.
    ENDIF.
    reward  points  if it is  usefull   ....
    Girish

  • How to download the SAP client into text file

    Hi,
    I want to download a SAP client to a text file for backup and then upload it again for restoration when needed. Can this be done?

    Hi,
    Regarding which data you want to export, you have to select the corresponding profiles in SCC8:
    If you want to export transaction data & master data (this is together known as application data), then you have to select the appropriate profile. Alongwith application data, customizing data would also be there, because it cant be transferred alone. ALso, you can choose whether to export user data or not.
    But please note that repository data (programs etc) would not be part of this export.
    The transaction is SCC8 for client export.
    For importing you can import like any other transport request.
    For details you could refer to the below link:
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c24c824ba111d189750000e8322d00/frameset.htm
    Thanks & Regards,
    Kunal.

  • How to conver the oracle data into xml files

    Hi All,
    I have a table for ex emp, now i want to generate every row into an xml file. could anyone pls help...
    ex:- emp table
    eno ename sal
    1    bond  3000
    2    kiran    2000
    3    jai       1000
    4    henry   500
    o/p :-  i have to get a column in 4 different files for this 4 rows.
    1.xml file        should contain data  <ID>1</ID><eNAME>bond</eNAME><sal>3000</sal>
    2.xml file        should contain data  <ID>2</ID><eNAME>kiran</eNAME><sal>2000</sal>
    3.xml file       should contain data  <ID>3</ID><eNAME>jai</eNAME><sal>1000</sal>
    4.xml file       should contain data  <ID>1</ID><eNAME>bond</eNAME><sal>500</sal>
    regards,
    Badri.

    You can do it like this :
    begin
      for r in (
          select empno
               , xmlserialize(content xmlforest(empno as "ID", ename, sal)) as xmlcontent
          from scott.emp
      loop
        dbms_xslprocessor.clob2file(r.xmlcontent, 'TEST_DIR', to_char(r.empno) || '.xml');
      end loop;
    end;

  • How to  convert the input  Dates  into ReminderInfo in AssignTask Activity!!

    Hi
    We are reading reminder  time and  Date from   the user   thru the form. We  want to  bind this input date and time with ReminderInfo data type to  set
    Reminders in Assign Task Activity.
    Please  find the ppt for more info.
    Please help  us in this regard.
    Thanks
    Praveen

    Nith,
    I know this thread is old, but how do you identify the Assign Task instance you want to adjust?
    I see processData/asdf..... in your screen shot - is this a global reference to assign task objects or to a specific instance?
    I have a process that has multiple assign task calls in it, and only want to set reminders on one of them.
    Thanks for your help - as always.
    Mark

  • How to convert the following code into an applet

    Please reply for me as soon as you can.
    import java.io.*;
    import java.awt.Frame;
    import java.awt.FlowLayout;
    import java.awt.Color;
    import java.awt.Insets;
    import java.awt.Dimension;
    import java.awt.event.WindowListener;
    import java.awt.event.WindowEvent;
    import java.util.Enumeration;
    import javax.comm.CommPort;
    import javax.comm.CommPortIdentifier;
    import javax.comm.SerialPort;
    import javax.comm.NoSuchPortException;
    import javax.comm.PortInUseException;
    public class BlackBox extends Frame implements WindowListener
         static int               portNum = 0,
                             panelNum = 0,
                             rcvDelay = 0;
         static SerialPortDisplay[]     portDisp;
         static BlackBox           win;
         static boolean               threaded = true,
                             silentReceive = false,
                             modemMode = false,
                             friendly = false;
         public BlackBox()
              super("Serial Port Black Box Tester");
              addNotify();
              addWindowListener(this);
         public void windowIconified(WindowEvent event)
         public void windowDeiconified(WindowEvent event)
         public void windowOpened(WindowEvent event)
         public void windowClosed(WindowEvent event)
         public void windowActivated(WindowEvent event)
         public void windowDeactivated(WindowEvent event)
         public void windowClosing(WindowEvent event)
              cleanup();
              dispose();
              System.exit(0);
         public static void main(String[] args)
              Enumeration           ports;
              CommPortIdentifier     portId;
              boolean               allPorts = true,
                             lineMonitor = false;
              int               idx = 0;
              win = new BlackBox();
              win.setLayout(new FlowLayout());
              win.setBackground(Color.gray);
              portDisp = new SerialPortDisplay[4];
              while (args.length > idx)
                   if (args[idx].equals("-h"))
                        printUsage();
                   else if (args[idx].equals("-f"))
                        friendly = true;
                        System.out.println("Friendly mode");
                   else if (args[idx].equals("-n"))
                        threaded = false;
                        System.out.println("No threads");
                   else if (args[idx].equals("-l"))
                        lineMonitor = true;
                        System.out.println("Line Monitor mode");
                   else if (args[idx].equals("-m"))
                        modemMode = true;
                        System.out.println("Modem mode");
                   else if (args[idx].equals("-s"))
                        silentReceive = true;
                        System.out.println("Silent Reciever");
                   else if (args[idx].equals("-d"))
                        idx++;
                        rcvDelay = new Integer(args[idx]).intValue();
                        System.out.println("Receive delay = "
                                  + rcvDelay + " msecs");
                   else if (args[idx].equals("-p"))
                        idx++;
                        while (args.length > idx)
                             * Get the specific port
                             try
                                  portId =
                                  CommPortIdentifier.getPortIdentifier(args[idx]);
                                  System.out.println("Opening port "
                                       + portId.getName());
                                  win.addPort(portId);
                             catch (NoSuchPortException e)
                                  System.out.println("Port "
                                            + args[idx]
                                            + " not found!");
                             idx++;
                        allPorts = false;
                        break;
                   else
                        System.out.println("Unknown option "
                                  + args[idx]);
                        printUsage();
                   idx++;
              if (allPorts)
                   * Get an enumeration of all of the comm ports
                   * on the machine
                   ports = CommPortIdentifier.getPortIdentifiers();
                   if (ports == null)
                        System.out.println("No comm ports found!");
                        return;
                   while (ports.hasMoreElements())
                        * Get the specific port
                        portId = (CommPortIdentifier)
                                       ports.nextElement();
                        win.addPort(portId);
              if (portNum > 0)
                   if (lineMonitor)
                        if (portNum >= 2)
                             portDisp[0].setLineMonitor(portDisp[1],
                                            true);
                        else
                             System.out.println("Need 2 ports for line monitor!");
                             System.exit(0);
              else
                   System.out.println("No serial ports found!");
                   System.exit(0);
         private void addPort(CommPortIdentifier     portId)
              * Is this a serial port?
              if (portId.getPortType()
              == CommPortIdentifier.PORT_SERIAL)
                   // Is the port in use?     
                   if (portId.isCurrentlyOwned())
                        System.out.println("Detected "
                                  + portId.getName()
                                  + " in use by "
                                  + portId.getCurrentOwner());
                   * Open the port and add it to our GUI
                   try
                        portDisp[portNum] = new
                             SerialPortDisplay(portId,
                                       threaded,
                                       friendly,
                                       silentReceive,
                                       modemMode,
                                       rcvDelay,
                                       win);
                        this.portNum++;
                   catch (PortInUseException e)
                        System.out.println(portId.getName()
                                  + " in use by "
                                  + e.currentOwner);
         public void addPanel(SerialPortDisplay     panel)
              Dimension     dim;
              Insets          ins;
              win.add(panel);
              win.validate();
              dim = panel.getSize();
              ins = win.getInsets();
              dim.height = ((this.panelNum + 1) * (dim.height + ins.top
                        + ins.bottom)) + 10;
              dim.width = dim.width + ins.left + ins.right + 20;
              win.setSize(dim);
              win.show();
              panelNum++;
         static void printUsage()
              System.out.println("Usage: BlackBox [-h] | [-f] [-l] [-m] [-n] [-s] [-d receive_delay] [-p ports]");
              System.out.println("Where:");
              System.out.println("\t-h     this usage message");
              System.out.println("\t-f     friendly - relinquish port if requested");
              System.out.println("\t-l     run as a line monitor");
              System.out.println("\t-m     newline is \\n\\r (modem mode)");
              System.out.println("\t-n     do not use receiver threads");
              System.out.println("\t-s     don't display received data");
              System.out.println("\t-d     sleep for receive_delay msecs after each read");
              System.out.println("\t-p     list of ports to open (separated by spaces)");
              System.exit(0);
         private void cleanup()
              SerialPort     p;
              while (portNum > 0)
                   portNum--;
                   panelNum--;
                   * Close the port
                   p = portDisp[portNum].getPort();
                   if (p != null)
                        System.out.println("Closing port "
                                  + portNum
                                  + " ("
                                  + p.getName()
                                  + ")");
                        portDisp[portNum].closeBBPort();
    }

    hi welcome to java forum,
    please do one thing for me so that i can help you, can you put your code in a code tag [code ][code ] (without spaces) so that your code can be readable easily

  • How can I convert the volume directory into a single file installer?

    How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.

    On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
    Are you choosing the second option (self-extracting Zip file for software installation)?
    I have a word file that I created to help me remember - is there anyway to email it to you?

  • How to convert an NWDI project into a Local project?

    Hi Experts,
    Please tell me " how to convert an NWDI project into a Local project? "
    If you c

    Hi Srini
    1. Copy/Paste Webdynpro components in the new project as was suggested before
    2. Or create new project, copy _comp folder from old project to the new one. But, do not forget to update .dcdef & .project files manually after this. You have to set the correct project name in .dcdef and set the correct local project path in .project.
    BR, Sergei

Maybe you are looking for