Text Characteristic from Vendor Class. System

HI Gurus!
I needed in a report a characteristic that came from Vendor Classification System in R/3. To get it, i enhanced the Datasource 0VENDOR_ATTR with the new characteristic attribute and used the function module 'BAPI_CLASS_GET_CLASSIFICATIONS' to get the characteristic value.
My problem now is that i need also to get the texts from this characteristic. How can i extract this texts to my custom infoobject. I was wondering that the only eay was to built a generic texts datasource with a function module... Does anybody know any alternative?
Thanks in advance.
Nuno

Hi
If Text keeps on change then you have to create a datasource which is normal.
If text doesn't change then do textfile upload.
To get the text , goto domain of the that field in R/3 and select value range .Save the values in  CSV format and text file upload.
Hope ti helps.
Regards,
Chama.

Similar Messages

  • Header Text PO from Vendor master automatically

    Dear Friends
    This is regarding automatically adoption of header text in PO from vendor master. I am following these steps
    - Maintained customizing as MM>purchasing > PO>texts for PO >define copying rules for header texts .
    in this , select the text type ( this is the PO header text ) and click on text linkage and maintain source obj as vendor master and maintain the fixing as blank ( ie text automatically adopt in the target obj)
    -Then I wrote text (needed in FR lanugage) to respective vendor in purchasing view
    Now When I create a PO, system does not propose any thing under header text
    Did I miss anything.
    Please respond
    Regards
    SG

    Hi,
    1. First I assume the configuration settings are correct
    MM- Purchasing -- PO --Texts for PO --Define Copying rules for header text
    Here the target text type (in this case the PO text type ) i.e. sequence no. is assigned to the correct source object and text (in this case the vendor text type)
    2.If you logon to the system using the language option. i.e. logon id, password and language you get the SAP screens in that language. Now if you try to maintain vendor text in FR and create a PO, the FR Text would get copied to the PO. Now if you go back to the EN logon you ll still find the vendor text in FR. So it is definitely linked to the logon language.
    There should be another way for this too.
    This is an observation and may help you resolve your issue.

  • PO acknowledgement from vendor in system

    Hi gurus,
    PLease let me know the procedure for getting acknowledge from vendor for PO...
    Once po created , how to get acknowledge and what are settings required for the same.. how to use that option..
    plesae explain..
    thanks in advance

    Vendor Acknowledgment can be used with Confirmations Concept
    After Receiving PO, Vendor will notify you acknowledgment through mail/phone/ some other source.
    Then, in ME22N,   In the Item Details, Confirmations Tab (BELOW),
    You Acknowledge the materials,...
    Then only system will allow you to do GR in MIGO.
    You have to activate Confirmations In SPRO,and Vendor Master data
    Edited by: Anand K on May 1, 2008 3:17 PM

  • How to load text data from multiple source systems.

    Hello Gurus,
    I am facing an issue of loading master data text into 0Material. I have loaded attribute data from 2 source systems. But i am not able load text data from the same 2 source systems as i am not able to see 0logsys in transfermation rules of 0MATERIAL.
    Please gimme some inputs to proceed.
    Thanks in advance
    Peter

    Hi,
    I dont think that you need the source system info here, texts are mapped to attributs and attributs to source systems.
    so try to load simply:
    material key, text, lang (optional)
    Hope it helps.

  • PO texts from vendor master

    Hi,
    when I create a PO using a vendor, after filling field Purchasing Org., Purch. Group and Company code, system copies a text but I don't know from where.
    In PO down the header texts I can read "Text adopted from Vendor Master (Purch.org.-spec.test text )", I cannot find it in vendor master....
    Could You help me ?
    Regards

    Hi,
    In MK03 please open your vendor go to purchasing data and  click on extras on the menu bar, and select text, here you will find purchase order texts, hope this is what you were looking for.
    Also check the PIR.
    Regards
    Shailesh
    Edited by: Shailesh Rajan on Jun 28, 2011 3:07 PM

  • Transfering text from one class to another

    Hi, I'm having a lot of trouble with getting the text from a textArea in a frame to transfer from one class to another.
    I could really use any help given.
    Thanks
    Here's where the text should come from
    import javax.swing.*;
    import BreezySwing.*;
    import java.util.*;
    public class UserFrame extends GBFrame {
    //String Design = null;
    private
       JTextArea InputArea = addTextArea
       ("...",1,1,1,1);
       JButton drawButton = addButton
       ("Draw" ,3,1,1,1);
    //  UserPanel dPanel = new UserPanel();
       GraphicsInputPanel dPanel = new GraphicsInputPanel();
       GBPanel panel = addPanel(dPanel, 1, 2, 1, 1);
       public void buttonClicked (JButton buttonObj){
          GraphicsInputPanel.setdesign(InputArea.getText());
    // rbPanel setDesign(graphicCodeArea.getText());
    public static void main(String[] args) {
    UserFrame tpo = new UserFrame();
    tpo.setSize(400, 300);
    tpo.setVisible(true);
    and here's where it should be going
    import BreezySwing.*;
    import java.awt.*;
    import java.util.*;
    public class GraphicsInputPanel extends GBPanel{
       String design;
       public void setdesign (String d){
          design = d;
       public void paintComponent (Graphics g){
          super.paintComponent(g);
          StringTokenizer lines = new StringTokenizer(design, "\n");
          while (lines.hasMoreTokens()){
             String line = lines.nextToken();
             if (design.equals ("Blue")){
                g.setColor(Color.blue);      
             }else if (design.equals("Green")){
                g.setColor(Color.green);
             g.fillRect(0,0,100,100);
         public void setDesign(String d){
          design = d;
          repaint();
    }

    Hello Saqib,
    The requirement to transfer asset with value date in the past year contradict the objective of audit trail established in the system although it is technically possible to do. Perhaps you should convince your client to adopt the standard approach, i.e. value date as at the date of asset transfer.
    Kind regards,
    John Chin

  • Read data from SAP R/3 Class-System

    Hello,
    first of all sorry when I posted this into the wrong subforum, but I wasn't sure about that. My Question is how to read data from the Classystem I have specified in my ABAP report.
    The goal is to read data from my individual class-system as well as data from MM and write them to a table that is to be read by another report. But right now I can't find information about the class system and abap. Maybe you know some tutorials or blogs about right that topic you can suggest?

    What class system have you specified in your report?
    Normally a class can be used by declaring a variable of type of the class in question, if this class can be instantiated this is. If your class can't be instantiated, but it has only class methods, you can call this method directly.
    But there is a lot more to this ABAP Object Oriented Programming, than just this short explanation. Search on SDN for some ABAP OO Tutorials.
    some links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
    Transacation ABAPDOCU.

  • External requirement from non SAP system created in SRM 7.0 Extended Classi

    Hello SRM Gurus:
    Has anyone created an external requirement using XI ExternalRequirement_Create_In (http://sap.com/xi/EBP).  We are getting a E001 "No company code could be determined for backend  for product##".  I traced the error to FM 'BAPI_SCEC_CREATE' in class "CL_BBPX_EXTERNAL_REQUIREMENT".  What I found is that it check the attributes for BUK and updates a table with the backend EEC system.  Then it checks if any of the entries match our external non SAP system in our external requirement and since it is a non SAP system none do.  Then it sets a return error code.
    I configured our non SAP system in the SLD and in SPRO under "Define System Landscape" as a non SAP system.
    We are running external classic scenario.  We just want to created a shopping cart from an external non SAP system.  Source the shopping cart in SRM and create the PO in SRM/ECC.  We are not using a product master but creating "describe requirement" in our external system.  Our product categories are replicated from ECC and the same codes used in our external non SAP planning system.
    If I change the external planning system to the ECC backend system, the external requirement is created in SRM but when I source it and convert it to a PO, it returns a backend error that the external requirement number does not exist in ECC.  Therefore it appears all of our data from our external system is correct with the exception of how to deternine the backend company code
    According to SAP this should be possible using XI.
    Has anyone been successful doing this or can you please advise any OSS notes or documentation explaining how to do this.  Please advise if you need additikonal info.
    Thanks in advance.
    Bert

    Dear Poster,
    As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
    Best Regards,
    SDN SRM Moderation Team

  • Header Text copy to PO from vendor master

    Dear all,
    I am trying to pull data storeed in vendor master to PO for header text so that we don't need to repeat to each PO for the vendor.
    I tried to link this in "Texts for Purchase Orders" in SPRO ,But not able to link it
    B'coz it's not allowing me to add the object of vendor master
    so pl guide me how i link vendor master text to PO
    Regards,
    Vimlesh

    Hi,
    In customizing ->material management -> purchasing -> purchase order -> texts for purchase orders -> define copying rules for header texts, choose "header text" and click on text linkages. Here you can enter for source object "vendor master", and for source text choose vendor master header text.
    And in the FIX INDICATOR for text you have to maintain blank. then it will copy text
    This will copy text from vendor master to PO header text.
    Please check this and revert back if you need further details
    thanks,
    santosh

  • Vendor Master Replication from 2 Backend System

    Hi Experts,
                  I am facing a problem in replicating the vendor masters from two Different Logical ECC systems.
    The vendor master at 1st Backend system
    Vendor Master: 0011000196
    Company Code: C001
    Pur.Organization: P001
    The vendor Master at 2nd Backend system
    Vendor Master: 0011000196
    Company Code: 1000
    Pur.Organization: 1000
    In BBPGETVD, the vendor from 1st backend system is replicated successfully and available in VENMAP table. Again, I entered the same vendor code and change the 2nd Backend destination in BBPGETVD and clicked on start transfer , In SLG1 i could find the error as below
    "Error: The Vendor Number Exists as a Partner Number Vendor: 0011000196”.
    In VENMAP table for the above vendor there is only one entry for the 1st logical system alone.
    Kindly suggest.
    Thanks& Regards,
    Ramprakash N

    If it is the same vendor - it must have the same address in both backends.
    After that you should be able to start BBPGETVD with following checkbox activated.
    Then VENMAP should be extended automatically.
    Regards
    Konstantin

  • Retrieve TEXTS from Vendor

    Hello All,
    We generally maintain some vendor information TEXTS . (XK1/2/3  --> Extras --> Texts ).
    How do we programatically retrieve the text maintained here.I want to know the table . F1 info. shows the structure name as usual.If thru standard texts what should be the Text Id ? I tried to check in all vendor related tables LF* but left clueless.
    Please help.
    Regards,
    Ramdass.

    Try this piece of Code
    DATA : it_lines_sh TYPE STANDARD TABLE OF tline.
    data : m_key type thead-tdname.
    M_KEY = '0000305240'.  "Vendor"
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        client                  = sy-mandt
        id                      = '0001'
        language                = sy-langu
        name                    = m_key
        object                  = 'LFA1'
      TABLES
        lines                   = it_lines_sh
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.
    This will extract the Accounting note text from Vendor Text.
    Regards
    Vinod

  • Writing in a Text Area from a different class.

    Hi,
    I need to write some text in a Text Area which is in a class I've call GUI where I handle all the graphic stuff but I need to do it from another class which handles packets that come through a COM port.
    Is there anyway to do that?
    Thanks!

    Thank you! I'll try that but I think I might have problems with that since an instance of the Gui class was already created. I'm using the NetBeans Gui design form wich already makes the code for the Gui and this is what I have public class Gui extends javax.swing.JFrame {
        Connection connection = new Connection();
        /** Creates new form Gui */
        public Gui() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            bnConectar = new javax.swing.JButton();
            cbPuerto = new javax.swing.JComboBox();
            lblPuerto = new javax.swing.JLabel();
            jScrollPane1 = new javax.swing.JScrollPane();
            taPuerto = new javax.swing.JTextArea();
            bnPing = new javax.swing.JButton();
            jMenuBar1 = new javax.swing.JMenuBar();
            mArchivo = new javax.swing.JMenu();
            miNuevoP = new javax.swing.JMenuItem();
            miCargarP = new javax.swing.JMenuItem();
            miGuardarP = new javax.swing.JMenuItem();
            miSalir = new javax.swing.JMenuItem();
            mEdicion = new javax.swing.JMenu();
            mMonitorizacion = new javax.swing.JMenu();
            miMonON = new javax.swing.JMenuItem();
            miMonOFF = new javax.swing.JMenuItem();
            miPing = new javax.swing.JMenuItem();
            miConfig = new javax.swing.JMenuItem();
            mAyuda = new javax.swing.JMenu();
            miAcerca = new javax.swing.JMenuItem();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Monitorizaci?n");
            bnConectar.setFont(new java.awt.Font("Tahoma", 1, 11));
            bnConectar.setText("Conectar");
            bnConectar.setToolTipText("Conecta con el puerto seleccionado.");
            bnConectar.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    bnConectarActionPerformed(evt);
            cbPuerto.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
            lblPuerto.setFont(new java.awt.Font("Tahoma", 1, 14));
            lblPuerto.setText("Puerto");
            taPuerto.setColumns(20);
            taPuerto.setRows(5);
            jScrollPane1.setViewportView(taPuerto);
            bnPing.setFont(new java.awt.Font("Tahoma", 1, 11));
            bnPing.setText("Ping");
            bnPing.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    bnPingActionPerformed(evt);
            mArchivo.setText("Archivo");
            miNuevoP.setText("Nuevo Proyecto");
            mArchivo.add(miNuevoP);
            miCargarP.setText("Cargar Proyecto");
            mArchivo.add(miCargarP);
            miGuardarP.setText("Guardar Proyecto");
            mArchivo.add(miGuardarP);
            miSalir.setText("Salir");
            mArchivo.add(miSalir);
            jMenuBar1.add(mArchivo);
            mEdicion.setText("Edici?n");
            jMenuBar1.add(mEdicion);
            mMonitorizacion.setText("Monitorizaci?n");
            miMonON.setText("Monitorizaci?n ON");
            mMonitorizacion.add(miMonON);
            miMonOFF.setText("Monitorizaci?n OFF");
            mMonitorizacion.add(miMonOFF);
            miPing.setText("Ping");
            mMonitorizacion.add(miPing);
            miConfig.setText("Configuraci?n");
            mMonitorizacion.add(miConfig);
            jMenuBar1.add(mMonitorizacion);
            mAyuda.setText("Ayuda");
            miAcerca.setText("Acerca");
            mAyuda.add(miAcerca);
            jMenuBar1.add(mAyuda);
            setJMenuBar(jMenuBar1);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(lblPuerto)
                            .addGap(17, 17, 17)
                            .addComponent(cbPuerto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(bnPing)
                            .addComponent(bnConectar)))
                    .addGap(45, 45, 45)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(287, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap())
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(cbPuerto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(lblPuerto))
                            .addGap(18, 18, 18)
                            .addComponent(bnConectar)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                            .addComponent(bnPing)
                            .addContainerGap(172, Short.MAX_VALUE))))
            pack();
        }// </editor-fold>
        private void bnConectarActionPerformed(java.awt.event.ActionEvent evt) {                                          
            try{
               connection.connect();
            }catch (XBeeException e){
        private void bnPingActionPerformed(java.awt.event.ActionEvent evt) {                                      
            try{
               connection.ping();
            }catch (XBeeException e){
        * @param args the command line arguments
        public static void main(String args[]) throws Exception, InterruptedException {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                   new Gui().setVisible(true);
        }Would that be a problem?
    Thanks again!

  • XMES not displaying the text from message class/number

    Hi,
    I have used the operation XMES in a pcr to generate a warning when a particular wage type scenario is in play.  I am using the XMES with the parameter O so that it operates as function MESSG.  The Operation reads as: XMESOZZ001.  I also set up the short and long text for the message class in SE91.  When the payroll is processed, the warning comes through with the Pernr, payroll, period parameter and the ZZ001; however the text does not come through.  I tried also setting it up with the country message class 10 and that does not work either.  While debugging discovered that there is no coding actually moving the corresponding text to the log_msg.  Was this programming meant to be used in ECC 5.0 and on?  There are no updates beyond 4.7 so I am wondering if we are missing something in our coding that others may have or was the intention for the customer to build in its own coding?  Was anyone else able to get the actual text to display in the log??
    Thank you,
    JLM

    Hello:
    You need to use customer exit in Opertion XMES.  Go to Pe04 for XMES and look at code.  When "ZZ"  ZZ customer exit (ZZxxx).    You need to use the same in Payroll rule to pop up the message in the log as described in SE91 for custom message class.  Follow the syntax given in documentation.
    Get this done by a developer.
    Thanks
    Bhavani

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • Problem getting arraylist from another class

    I am trying to call information about an arraylist from another class. I am using this code to call the size of an arraylist:
    import java.io.*;
    public class Test
        public static void main(String argv[]) throws IOException
    Echo03 thing = new Echo03();
    int y=thing.value();
    System.out.println(y);
    Echo03 thing2 = new Echo03();
    int x=thing2.percent.size();
    System.out.println(x);
    }from another file which starts like this:
    public class Echo03 extends DefaultHandler
    static ArrayList<String> percent = new ArrayList<String>();
    static ArrayList<String> text = new ArrayList<String>();
      int a;
    public int value(){
         return percent.size();
      public static void main(String argv[]) throws IOException
        {The second file is based on an example piece of code from the Java website. I havent posted the whole thing, but if it is relevant then please ask.
    Anyway when I run Echo03 by itself, the arraylist has a size of 2. But when I run it from the Test file, it says a size of 0. Is this because the data is not being transferred between the classes? Or is the Echo03 program not executing (and hence the arraylist is not filling up)?
    How can I fix this? I have tried 2 ways of calling the data (As seen in my Test file). Neither work.

    I didnt post the full bit of the code for the second one. Here it is:
    import java.io.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import java.util.ArrayList;
    import java.awt.*;
    import javax.swing.*;
    public class Echo03 extends DefaultHandler
    static ArrayList<String> percent = new ArrayList<String>();
    static ArrayList<String> text = new ArrayList<String>();
      int a;
      public static void main(String argv[]) throws IOException
            if (argv.length != 1) {
                System.err.println("Usage: cmd filename");
                System.exit(1);
            // Use an instance of ourselves as the SAX event handler
            DefaultHandler handler = new Echo03();
            // Use the default (non-validating) parser
            SAXParserFactory factory = SAXParserFactory.newInstance();
            try {
                // Set up output stream
       out = new OutputStreamWriter(System.out, "UTF8");
                // Parse the input
                SAXParser saxParser = factory.newSAXParser();
                saxParser.parse( new File(argv[0]), handler);
    for (int b=0; b<percent.size();b++){
         System.out.println(percent.get(b+1));
            } catch (Throwable t) {
            System.exit(0);
        static private Writer  out;
        public void startElement(String namespaceURI,
                                 String lName, // local name
                                 String qName, // qualified name
                                 Attributes attrs)
        throws SAXException
            if (attrs != null) {
    StringBuffer sb = new StringBuffer (250);        
    for (int i = 0; i < attrs.getLength(); i++) {
                    nl();
                    emit(attrs.getValue(i));
              sb.append (attrs.getValue(i));
    String sf = sb.toString ();
    percent.add(sf);
    System.out.println(" String: "+sf); a++;
        public void characters(char buf[], int offset, int len)
        throws SAXException
             emit(" ");
            String s = new String(buf, offset, len);
            if (!s.trim().equals("")) {text.add(s); emit(s);}
    //===========================================================
        // Utility Methods ...
        //===========================================================
        // Wrap I/O exceptions in SAX exceptions, to
        // suit handler signature requirements
        private void emit(String s)
        throws SAXException
            try {
                out.write(s);
                out.flush();
            } catch (IOException e) {
                throw new SAXException("I/O error", e);
        // Start a new line
        private void nl()
        throws SAXException
            String lineEnd =  System.getProperty("line.separator");
            try {
                out.write(lineEnd);
            } catch (IOException e) {
                throw new SAXException("I/O error", e);
    }

Maybe you are looking for