Want to create XML tag from the query

Here i want to create a xml output from the below code for the given P_repair_number can anyone help me for the code i have written
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
facing the above error when run from concurrent program
Procedure dfdfdf(p_repair_number number,
                          errbuf        OUT VARCHAR2,
                          retcode       OUT NUMBER) as
v_error_code NUMBER; -- error code
  v_error_message VARCHAR2(255); -- error message
  v_text_msg VARCHAR2(100);
cursor Rodetails(p_repair_number IN NUMBER) is
SELECT
  dra.repair_number,
  dra.repair_line_id,
  items.concatenated_segments item_name,
  items.description item_desc,
  dra.inventory_item_id,
  sr.incident_number sr_incident_number,
  decode(dra.customer_product_id, '',dra.serial_number,cp.serial_number) serial_number,
  ltrim(oeh.order_number) rma_number,
  rstl.resource_name ro_owner_name,
  fndl.meaning flow_status_name,
  dra.status ro_status_code,
  drtt.name repair_type_name,
  dra.problem_description,
  dra.promise_date,
  rgtl.group_name repair_org_name,
  decode(dra.customer_product_id, '',dra.item_revision,cp.inventory_revision) revision,
  cp.lot_number,
  dra.unit_of_measure uom_code,
  uom.unit_of_measure_tl uom_name,
  dra.quantity,
  cp.instance_number ib_instance_number,
  plkup.meaning ro_priority_meaning
FROM
  csd_repairs dra,
  csd_repair_types_tl drtt,  
  cs_incidents_all_b sr,
  csi_item_instances cp,
  fnd_lookups fndl, 
  csd_flow_statuses_b fsb,
  mtl_system_items_kfv items,
  mtl_units_of_measure_tl uom,
  jtf_rs_resource_extns_tl rstl,
  jtf_rs_groups_tl rgtl,
  oe_order_headers_all oeh,
  cs_estimate_details edt,
  csd_product_transactions txns,
  fnd_lookups plkup 
WHERE dra.repair_type_id =  drtt.repair_type_id
  AND drtt.language = userenv('LANG')
  AND dra.repair_mode = 'WIP'
  AND dra.incident_id = sr.incident_id
  AND dra.CUSTOMER_PRODUCT_ID = cp.INSTANCE_ID(+)
  AND dra.flow_status_id = fsb.flow_status_id
  AND fsb.flow_status_code = fndl.lookup_code
  AND fndl.lookup_type = 'CSD_REPAIR_FLOW_STATUS'
  AND dra.inventory_item_id = items.inventory_item_id
  AND dra.unit_of_measure = uom.uom_code
  AND uom.language = userenv('LANG')
  AND dra.resource_id = rstl.resource_id (+)
  AND rstl.category (+) = 'EMPLOYEE'
  AND rstl.language (+) = userenv('LANG')
  AND dra.owning_organization_id = rgtl.group_id (+)
  AND rgtl.language (+) = userenv('LANG')
  AND dra.repair_line_id = txns.repair_line_id
  AND txns.estimate_detail_id = edt.estimate_detail_id
  AND edt.order_header_id = oeh.header_id
  AND edt.line_category_code = 'RETURN'
  AND dra.currency_code = oeh.transactional_curr_code
  AND dra.ro_priority_code = plkup.lookup_code(+)
  AND plkup.lookup_type(+) = 'CSD_RO_PRIORITY' 
  AND items.organization_id = cs_std.get_item_valdn_orgzn_id
  AND dra.repair_number=p_repair_number
  AND rownum <50;
begin
errbuf := NULL;
retcode := 0;
  SAVEPOINT Create_external_orders;
  --retcode             := FND_API.G_RET_STS_SUCCESS;
  IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
    fnd_log.STRING (fnd_log.level_procedure, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER.BEGIN', 'Enter - PrintTraveller');
  END IF;
--FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
--FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
FOR v_rodetails IN Rodetails(p_repair_number)
LOOP
/*For each record create a group tag <G_RODETAILS> at the start*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_RODETAILS>');
  FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_NUMBER>' || v_rodetails.repair_number ||
                                   '</REPAIR_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_LINE_ID>' || v_rodetails.repair_line_id
                                || '</REPAIR_LINE_ID>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_NAME>' || v_rodetails.ITEM_NAME
                                 ||'</ITEM_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_DESC>' || v_rodetails.ITEM_DESC
                                || '</ITEM_DESC>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SR_INCIDENT_NUMBER>' || v_rodetails.SR_INCIDENT_NUMBER ||
                                   '</SR_INCIDENT_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERIAL_NUMBER>' ||v_rodetails.SERIAL_NUMBER
                                 ||'</SERIAL_NUMBER>');                               
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RMA_NUMBER>' || v_rodetails.RMA_NUMBER
                                || '</RMA_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' ||v_rodetails.RO_OWNER_NAME ||
                                   '</RO_OWNER_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<FLOW_STATUS_NAME>' || v_rodetails.FLOW_STATUS_NAME
                                 ||'</FLOW_STATUS_NAME>');                                
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                || '</RO_STATUS_CODE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_TYPE_NAME>' || v_rodetails.REPAIR_TYPE_NAME ||
                                   '</REPAIR_TYPE_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROBLEM_DESCRIPTION>' || v_rodetails.PROBLEM_DESCRIPTION
                                 ||'</PROBLEM_DESCRIPTION>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROMISE_DATE>' || v_rodetails.PROMISE_DATE
                                || '</PROMISE_DATE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' || v_rodetails.RO_OWNER_NAME ||
                                   '</RO_OWNER_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORG_NAME>' || v_rodetails.REPAIR_ORG_NAME
                                 ||'</REPAIR_ORG_NAME>');                                
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                || '</RO_STATUS_CODE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REVISION>' || v_rodetails.REVISION ||
                                   '</REVISION>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<LOT_NUMBER>' || v_rodetails.LOT_NUMBER
                                 ||'</LOT_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_CODE>' || v_rodetails.UOM_CODE
                                || '</UOM_CODE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_NAME>' ||v_rodetails.UOM_NAME ||
                                   '</UOM_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<QUANTITY>' || v_rodetails.QUANTITY
                                 ||'</QUANTITY>');                                
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<IB_INSTANCE_NUMBER>' || v_rodetails.IB_INSTANCE_NUMBER
                                || '</IB_INSTANCE_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_PRIORITY_MEANING>' || v_rodetails.RO_PRIORITY_MEANING ||
                                   '</RO_PRIORITY_MEANING>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_RODETAILS>');                             
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</REPAIR_ORDER>');                                
END LOOP;
IF(retcode != FND_API.G_RET_STS_SUCCESS) THEN
                RAISE FND_API.G_EXC_ERROR;
              END IF;
              IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
                fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', ' In PrintTraveller');
              END IF;
fnd_file.put_line(fnd_file.log, 'Successfully completed PrintTraveller');
EXCEPTION
|| Catch all error.
WHEN OTHERS THEN
ROLLBACK;
v_error_code := SQLCODE;
v_text_msg := 'Fatal Error, Oracle Error is: '
|| TO_CHAR (v_error_code, '99999');
fnd_file.put_line (fnd_file.log, v_text_msg);
v_error_message := SQLERRM;
fnd_file.put_line (fnd_file.log, v_error_message);   
end dfdfdf;Edited by: user12053530 on Apr 19, 2010 5:54 AM

However using SYS.ODCIVARCHAR2LIST makes sense if your query is a part of bigger processing (PL/SQL procedure or function) and you will do some processing depending on File_Type, like in this example (not compiled, could contain syntax errors):
DECLARE
  l_stid           VARCHAR2(10);
  l_address        VARCHAR2(30);
  l_File_Type_tab  SYS.ODCIVARCHAR2LIST;
  cur_cursor IS SELECT STID,
                ADDRESS,
                CAST(COLLECT(DISTINCT File_Type) AS SYS.ODCIVARCHAR2LIST) AS File_Type
                FROM (
                      SELECT STID,
                             ADDRESS,
                             File_Type
                        FROM DUMMY
                GROUP BY STID, ADDRESS;
BEGIN
  OPEN cur_cursor;
  <<main_loop>>
  WHILE (1=1) LOOP
     FETCH cur_cursor INTO l_stid, l_address, l_File_Type_tab;
     EXIT WHEN cur_cursor%NOTFOUND;
     -- Now do processing for each File_Type in l_File_Type_tab;
     <<each_file_type>>
     FOR i IN l_File_Type_tab.FIRST .. l_File_Type_tab.LAST LOOP
       -- for example:
       -- IF l_File_Type_tab(i) = 'SALES'
       -- THEN
       --   do_something(l_stid, l_address);
       -- ELSIF l_File_Type_tab(i) = 'TRANSFER'
       -- THEN
       --   do_something_else(l_stid, l_address);
       -- ELSE
       --   do_something_default(l_stid, l_address);
       -- END IF;
     END LOOP each_file_type;
  END LOOP main_loop;
  CLOSE cur_cursor;
END;

Similar Messages

  • I want to create an ISO from the 8.1 DVD on my old iMac

    My current iMac is a 2011 i5 3.1, 1tb, 6970 GPU, 27 inch variety. I want to use this machine to create an install USB for my new iMac which of course has no DVD. I have a copy of 64 bit 8.1 WIndows on DVD. My current machine has Windows  7 installed, do I need to remove this before Bootcamp will give me the options of creating the bootable USB?  Do I need to source the ISO somewhere else or can I create it from the DVD? I heard I can make a MSDN account, free at that, and download a trial 8.1 ISO image but I am concerned it might not work even if I give it a valid key.
    Thank you.

    an iso file is a cabon copy of an optical disc there are many a free program which can transform one to the other
    http://hints.macworld.com/article.php?story=20060619181010389
    more from the google search
    osx make dvd into iso

  • Removing XML definition & XML tage from the XML message....

    Dear All,
    We are using PI 7.1 and implementing a scenario in which we need to send a signed payment message to our partner, our implemented scenario goes as follows:
    1) We are using SOAP without header to send the message.
    2) We are signing the payload using our own java code as UDF in graphical mapping.
    3) the main issue that we have is that in the final XML message which is being sent to our partnet, XMl definition and the topmode XML tage are again added to the signed message. Please see the following for reference:
    Source Message:
    We are using only I node in the graphical mapping and one UDF to sign in between the source and the target node. So after signingwe get the following in the target node:
    Signed Message
    0u201A#u0152# *u2020Hu2020÷ ### u201A#}0u201A#y###1#0 ##+######0u201A#h# *u2020Hu2020÷ ### u201A#Y#u201A#U
    u201A#ý0u201A#¸0u201A#  ######5gu0152yu2022ݬ½´b#¿#u2019 u01780 # *u2020Hu2020÷ #####0�Ý1#0 ##U####US1#0###U# ##VeriSign, Inc.1#0###U####VeriSign Trust Network1;09##U### BLAH BLAH BLAH SOME VERISGIN CERTIFICATE SIGNING INFORMATION
    but the final message that get through the SOAP and reaches our partner look liks the following:
    , as all this is appearing twice in our final message.
    I'll appriciate if anyone can help us finding a solution for that, as we tried to remove it in our java class at the adapter level in the module tab, but that produces java error.
    Regards,

    Vijaya, we already have solved this problem by creating an EJB and adding it to SOAP Adapter processing modules, so rather signing our payload in the UDF in graphical mapping we are now signing the payload in the SOAP adapter module and removing any unwarranted characters etc over there as well. We cannot send SOAP with header in our scenario as it is adding hell lot of extra bites that our partner system cannot understand, so we have adapted the EJB way of solving it. Thanks anyways for your suggestion.
    Athar Ullah Khan

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • I mostly work on Mac desktop, but use a Macbook Pro on trips. Due to limited HD space on the latter, I want to create a library of part of the images on the Mac, to be used on the Macbook. I do not however want to remove these images from the Mac library.

    I mostly work on Mac desktop, but use a Macbook Pro on trips. Due to limited HD space on the latter, I want to create a library of part of the images on the Mac, to be used on the Macbook. I do not however want to remove these images from the Mac library.

    Choose one or more Projects, and then use Export as New Library (from File).  The resulting export will be a fully functioning Aperture Library to either transfer and open on the Macbook Pro, or to Import into a library you already have on the MBP.
    Ernie

  • Generating target XML tag from a value in the Source XML document

    Hi there,
    I have a scenario where the following transformation needs to occur:
    Source Message...
    <Catalogue>
      <key>abc<\key>
      <value>123<\value>
      <key>def<\key>
      <value>456<\value>
    <\Catalogue>
    Target Message...
    <Catalogue>
      <abc>123<\abc>  --> Value of KEY becomes the XML tag and the VALUE gets assigned to it
      <def>456<\abc>
    <\Catalogue>
    The target message is written to an xml file using the receiver file adapter.
    I would like the target message generation to be dynamic so that when a new key-value pair is added, it would not require a change in the XI mapping layer.  Is there a way to accomplish this without having to code or enhance the adapter.  I am trying to avoid doing this in the mapping because that would mean changing the mapping every time a new key-value pair needs to be added.
    Any suggestions to accomplish this are welcome.
    Thanks all.

    Hi,
    I doubt if it will work for you. you can generate dynamic values using this but not tags dynamically. You need to see if there are any methods to generate tags dynamically.
    One way of doing this is by using Java Mapping and playing around with InputStream and OutputStream.It will work for sure with this.
    Thanks
    Amit

  • XML File from SQL Query

    I have created XML File from Query using below function:-
    select dbms_xmlgen.getxml('
    select * from tblreports where rownum<=1') from dual;
    "(CLOB) <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <REPORTID>preRES0011</REPORTID>
    <ALIAS>Date wise Summary of pins Report</ALIAS>
    <ACTIVE>Y</ACTIVE>
    <TITLE>Date wise Summary of pins Report</TITLE>
    <QUERY>select tsb.month1,
    count(SIDNUMBER)GENERATED,
    sum(case WHEN SERIALSTATUSID=&apos;SRS01&apos; THEN 1 ELSE 0 END)NotAllocated,
    SUM(CASE WHEN SERIALSTATUSID=&apos;SRS02&apos; or SERIALSTATUSID=&apos;SRS03&apos; or SERIALSTATUSID=&apos;SRS05&apos; THEN 1 ELSE 0 END)ALLOCATED,
    SUM(CASE WHEN SERIALSTATUSID=&apos;SRS02&apos; or SERIALSTATUSID=&apos;SRS01&apos; THEN 1 ELSE 0 END)NOTASSIGNEDTORESELLER,
    SUM(CASE WHEN SERIALSTATUSID=&apos;SRS03&apos; THEN 1 ELSE 0 END)READYTOACTIVATE,
    sum(CASE WHEN SERIALSTATUSID=&apos;SRS05&apos; THEN 1 ELSE 0 END)ACTIVATED,
    sum(CASE WHEN SERIALSTATUSID=&apos;SRS06&apos; THEN 1 ELSE 0 END)Terminated,
    sum(CASE WHEN SCRAPSTATUSID=&apos;CST01&apos; THEN 1 ELSE 0 END)scraped,
    sum(CASE WHEN LOCKSTATUSID=&apos;CST01&apos; THEN 1 ELSE 0 END)locked,
    NULL,
         NULL,
         NULL,
         NULL,
         NULL,
    NULL,
    NULL     
    from (SELECT TO_CHAR(CREATEDATE,&apos;DD-MON-YYYY&apos;)MONTH1 ,PINUSAGEMODEID,SERIALBATCHID,SERIALIDCOUNT,CREATEDATE FROM TBLMSERIALBATCH )TSB,
    tblmserial ts
    where TSB.SERIALBATCHID=ts.SERIALBATCHID
    and to_char(TSB.CREATEDATE,&apos;MON-YYYY&apos;)=&apos;$1&apos;
    GROUP BY TSB.MONTH1
    order by TO_DATE(MONTH1,&apos;dd-mon-yyyy&apos;) DESC</QUERY>
    <CONNECTIVITYID>C0001</CONNECTIVITYID>
    <INPUTREQUIRED>Y</INPUTREQUIRED>
    <INPUTNAME>Month</INPUTNAME>
    <CREATEDATE>30-JAN-10</CREATEDATE>
    <LASTMODIFIEDDATE>22-FEB-10</LASTMODIFIEDDATE>
    <CREATEDBY>reportadmin</CREATEDBY>
    <LASTMODIFIEDBY>reportadmin</LASTMODIFIEDBY>
    <TITLEPARAM>Y</TITLEPARAM>
    <SUBTITLE>Date wise Summary of pins Report For &amp;1</SUBTITLE>
    <ELEMENTTYPEID>AET002</ELEMENTTYPEID>
    <REPORTTYPEID>RTP01</REPORTTYPEID>
    <SORTFIELD>Disable</SORTFIELD>
    </ROW>
    </ROWSET>
    But in that it is taking '&apos;' for ' ' instead of '$1' it is taking &apos;$1&apos;
    how to keep ' ' in XML file instead of &apos?

    You can use bcp with query out option
    use your above query as the source query and use queryout option after specifying destination as your required local file path (specify extension as .xml)
    see
    http://visakhm.blogspot.com/2013/10/bcp-out-custom-format-data-to-flat-file.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Create XML file from XSD

    Hello,
    can anybody help me with generating an empty tagged XML file from a XSD file. Any sample java code will be highly appreciated.
    Thanx in advance.
    A .

    Apache XML Beans presents a way to compile the XSD Schema and generate Java classes for each element defined in the schema. With these interface you can then create new XML instances from the schema. (http://xmlbeans.apache.org/)

  • How to Create XML Schema From JTree ?

    Please help me... Thank you.
    This is Code
    Tree.java ----- Run This File
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class Tree extends JPanel implements ActionListener {
        private int newNodeSuffix = 1;
        private static String ADD_COMMAND = "add";
        private static String REMOVE_COMMAND = "remove";
        private static String CLEAR_COMMAND = "clear";
        private static String OK_COMMAND = "ok";
        private DynamicTree treePanel;
        public Tree() {
            super(new BorderLayout());
            //Create the components.
            treePanel = new DynamicTree();
            //populateTree(treePanel);
            JButton addButton = new JButton("Add");
            addButton.setActionCommand(ADD_COMMAND);
            addButton.addActionListener(this);
            JButton removeButton = new JButton("Remove");
            removeButton.setActionCommand(REMOVE_COMMAND);
            removeButton.addActionListener(this);
            JButton clearButton = new JButton("Clear");
            clearButton.setActionCommand(CLEAR_COMMAND);
            clearButton.addActionListener(this);
            JButton okButton = new JButton("OK");
            okButton.setActionCommand(OK_COMMAND);
            okButton.addActionListener(this);
            //Lay everything out.
            treePanel.setPreferredSize(new Dimension(300, 150));
            add(treePanel, BorderLayout.CENTER);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(addButton);
            panel.add(removeButton);
            panel.add(clearButton);
            panel.add(okButton);
            add(panel, BorderLayout.LINE_END);
        /*public void populateTree(DynamicTree treePanel) {
            String p1Name = new String("Parent 1");
            //String p2Name = new String("Parent 2");
            String c1Name = new String("Child 1");
            //String c2Name = new String("Child 2");
            DefaultMutableTreeNode p1;
            p1 = treePanel.addObject(null, p1Name);
            //p2 = treePanel.addObject(null, p2Name);
            treePanel.addObject(p1, c1Name);
            //treePanel.addObject(p1, c2Name);
            //treePanel.addObject(p2, c1Name);
            //treePanel.addObject(p2, c2Name);
        public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
            if (ADD_COMMAND.equals(command)) {
                //Add button clicked.
                treePanel.addObject("New Node " + newNodeSuffix++);
            } else if (REMOVE_COMMAND.equals(command)) {
                //Remove button clicked.
                treePanel.removeCurrentNode();
            } else if (CLEAR_COMMAND.equals(command)) {
                //Clear button clicked.
                treePanel.clear();
            } else if (OK_COMMAND.equals(command)) {
                 //Ok button clicked.
                 treePanel.ok();
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("Craete XML Tree");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            Tree newContentPane = new Tree();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }DynamicTree.java
    import javax.swing.JOptionPane;
    import java.awt.GridLayout;
    import java.awt.Toolkit;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.MutableTreeNode;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.TreeSelectionModel;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    public class DynamicTree extends JPanel {
        protected DefaultMutableTreeNode rootNode;
        protected DefaultTreeModel treeModel;
        protected JTree tree;
        private Toolkit toolkit = Toolkit.getDefaultToolkit();
        public DynamicTree() {
            super(new GridLayout(1,0));
            rootNode = new DefaultMutableTreeNode("Root Node");
            treeModel = new DefaultTreeModel(rootNode);
            treeModel.addTreeModelListener(new MyTreeModelListener());
            tree = new JTree(treeModel);
            tree.setEditable(true);
            tree.getSelectionModel().setSelectionMode
                    (TreeSelectionModel.SINGLE_TREE_SELECTION);
            tree.setShowsRootHandles(true);
            JScrollPane scrollPane = new JScrollPane(tree);
            add(scrollPane);
        /** Remove all nodes except the root node. */
        public void clear() {
            rootNode.removeAllChildren();
            treeModel.reload();
        public void ok() {
             int n = JOptionPane.showConfirmDialog(null, "Do you want to create XML Schema?", "", JOptionPane.YES_NO_OPTION);
        /** Remove the currently selected node. */
        public void removeCurrentNode() {
            TreePath currentSelection = tree.getSelectionPath();
            if (currentSelection != null) {
                DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode)
                             (currentSelection.getLastPathComponent());
                MutableTreeNode parent = (MutableTreeNode)(currentNode.getParent());
                if (parent != null) {
                    treeModel.removeNodeFromParent(currentNode);
                    return;
            // Either there was no selection, or the root was selected.
            toolkit.beep();
        /** Add child to the currently selected node. */
        public DefaultMutableTreeNode addObject(Object child) {
            DefaultMutableTreeNode parentNode = null;
            TreePath parentPath = tree.getSelectionPath();
            if (parentPath == null) {
                parentNode = rootNode;
            } else {
                parentNode = (DefaultMutableTreeNode)
                             (parentPath.getLastPathComponent());
            return addObject(parentNode, child, true);
        public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
                                                Object child) {
            return addObject(parent, child, false);
        public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
                                                Object child,
                                                boolean shouldBeVisible) {
            DefaultMutableTreeNode childNode =
                    new DefaultMutableTreeNode(child);
            if (parent == null) {
                parent = rootNode;
            treeModel.insertNodeInto(childNode, parent,
                                     parent.getChildCount());
            //Make sure the user can see the lovely new node.
            if (shouldBeVisible) {
                tree.scrollPathToVisible(new TreePath(childNode.getPath()));
            return childNode;
        class MyTreeModelListener implements TreeModelListener {
            public void treeNodesChanged(TreeModelEvent e) {
                DefaultMutableTreeNode node;
                node = (DefaultMutableTreeNode)
                         (e.getTreePath().getLastPathComponent());
                 * If the event lists children, then the changed
                 * node is the child of the node we've already
                 * gotten.  Otherwise, the changed node and the
                 * specified node are the same.
                try {
                    int index = e.getChildIndices()[0];
                    node = (DefaultMutableTreeNode)
                           (node.getChildAt(index));
                } catch (NullPointerException exc) {}
                System.out.println("The user has finished editing the node.");
                System.out.println("New value: " + node.getUserObject());
            public void treeNodesInserted(TreeModelEvent e) {
            public void treeNodesRemoved(TreeModelEvent e) {
            public void treeStructureChanged(TreeModelEvent e) {
    }

    XML shema is basically an XML file. So u need to know how to create an XML,
    provided u know how the shema file should be.
    Creating an XML :
    http://forum.java.sun.com/thread.jspa?threadID=5181031&messageID=9705786#9705786

  • Creating XML doc from DTD using jDOM

    Hi...
    I want to create empty XML Document from the DTD using JDOM or JAXP & then want to populate that xml document with the values from the database.
    The problem is :-
         How can we create an XML document by simply reading the DTD using JDOM or JAXP.?
    or
    first of all how am i going to parse the DTD from jDOM or JAXp & then how will i create the empty XML Document from it..?
    Please revert back soon... & thanx in advance for helping..
    regards
    Shoorya

    Yes i've also got teh same problem this day...
    Can somone help us ?
    Thanks
    Math

  • Is it possible to create "places" tags without the maping feature?

    Is it possible to create "places" tags without the maping feature? I updated from PSE 10 (where I created my own list of "places,") to PSE 12, where "places" seems to require the mapping feature. I would prefer not to use the map, and stick to my old way.
    Thanks for any help!
    Tom

    Apparently, not only is the mapping feature required, but once the GPS-loaded Place tag is created, it is not listed in alphabetical order with other place tags.  It is listed by country, then by state, then by title!!  !! VERY irritating!!  And what if I want to create a place tag (of which I already have many) which does not have a recognizeable address, like, say, Grandmother's House?  VERY irritating.
    And if I use the Keyword feature to create Place tags, they will be in an entirely separate list from the other Place tags.  VERY irritating!
    Who designed this upgrade?  I will soon start looking for an alternative, though I have used Photoshop Organizer for years and have thousands of photos in it.  My upgrade to PSE 12 has caused me nothing but headaches.

  • How do I set BI Publisher to read html tags from the database?

    How do I set BI Publisher (Release 10.1.3.4) to read html tags from the database? For example if the text is quoted with a bold tag I want my output to display the text in bold. Is there a setting or something I can set?

    I took a look at Tim Dexter's blog as suggested and the sample worked, but for the elements in the xml file not for the value coming from the database, however this is good to know as well!
    I have data in the data base column which looks like this:
    'MS Applied <B(bold tag)> Mathematics</B(bold tag)>University of Southern California'
    I want the data to be rendered like this:
    'MS Applied <B>Mathematics</B> University of Southern California'.
    In Report Builder on the property sheet I would set Contains HTML Tags property to Yes and the report would render correctly.
    In BI Publisher 10.1.3.4 I can not seem set it to read this I have change the configure properties of the report to Character set to HTML and Make HTML output accessible to True. I just can't figure out what I'm missing.
    Thank you for any assistance you can offer.

  • Create xml tag dynamically within simple transformation

    Hi all together,
    I'm faceing the following problem:
    There is a internal table provided, consisting of name/value-pairs. Something like
    ls_struc-name = 'NAME1'.
    ls_struc-value = 'XYZ'.
    append ls_struc to lt_struc
    ls_struc-name = 'CITY1'.
    ls_struc-value = 'Munich'.
    append ls_struc to lt_struc
    and so on.
    I have to create this XML (with simple transformation):
    <NAME1>XYZ</NAME1>
    <CITY1>Munich</CITY1>
    Everythings works fine so far (tables, values etc.), but I have problems with creating the XML-Tag, e.g <NAME1> from "$line.name" within the transformation. I don't have any information about the data structure (therefore "call transaction id" does not work).
    Any hint is useful!!!
    Best regards,
    Thomas

    Exaple program for creating XML file from abap
    REPORT  z_xit_xml_dom_create.
      TYPE-POOLS: ixml.
      TYPES: BEGIN OF xml_line,
              data(256) TYPE x,
             END OF xml_line.
      DATA: l_ixml            TYPE REF TO if_ixml,
            l_streamfactory   TYPE REF TO if_ixml_stream_factory,
            l_ostream         TYPE REF TO if_ixml_ostream,
            l_renderer        TYPE REF TO if_ixml_renderer,
            l_document        TYPE REF TO if_ixml_document.
      DATA: l_element_flights TYPE REF TO if_ixml_element,
            l_element_airline TYPE REF TO if_ixml_element,
            l_element_flight  TYPE REF TO if_ixml_element,
            l_element_from    TYPE REF TO if_ixml_element,
            l_element_to      TYPE REF TO if_ixml_element,
            l_element_dummy   TYPE REF TO if_ixml_element,
            l_value           TYPE string.
      DATA: l_xml_table       TYPE TABLE OF xml_line,
            l_xml_size        TYPE i,
            l_rc              TYPE i.
      DATA: lt_spfli          TYPE TABLE OF spfli.
      DATA: l_spfli           TYPE spfli.
      START-OF-SELECTION.
    *   Fill the internal table
        SELECT * FROM spfli INTO TABLE lt_spfli.
    *   Sort internal table
        SORT lt_spfli BY carrid.
    *   Start filling xml dom object from internal table
        LOOP AT lt_spfli INTO l_spfli.
          AT FIRST.
    *       Creating a ixml factory
            l_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
            l_document = l_ixml->create_document( ).
    *       Fill root node with value flights
            l_element_flights  = l_document->create_simple_element(
                        name = 'flights'
                        parent = l_document ).
          ENDAT.
          AT NEW carrid.
    *       Create element 'airline' as child of 'flights'
            l_element_airline  = l_document->create_simple_element(
                        name = 'airline'
                        parent = l_element_flights  ).
    *       Create attribute 'code' of node 'airline'
            l_value = l_spfli-carrid.
            l_rc = l_element_airline->set_attribute( name = 'code' value = l_value ).
    *       Create attribute 'name' of node 'airline'
            SELECT SINGLE carrname FROM scarr INTO l_value WHERE carrid EQ l_spfli-carrid.
            l_rc = l_element_airline->set_attribute( name = 'name' value = l_value ).
          ENDAT.
          AT NEW connid.
    *       Create element 'flight' as child of 'airline'
            l_element_flight  = l_document->create_simple_element(
                        name = 'flight'
                        parent = l_element_airline  ).
    *       Create attribute 'number' of node 'flight'
            l_value = l_spfli-connid.
            l_rc = l_element_flight->set_attribute( name = 'number' value = l_value ).
          ENDAT.
    *     Create element 'from' as child of 'flight'
          CONCATENATE l_spfli-cityfrom ',' l_spfli-countryfr INTO l_value.
          l_element_from  = l_document->create_simple_element(
                      name = 'from'
                      value = l_value
                      parent = l_element_flight  ).
    *     Create attribute 'airport' of node 'from'
          l_value = l_spfli-airpfrom.
          l_rc = l_element_from->set_attribute( name = 'airport' value = l_value ).
    *     Create element 'to' as child of 'flight'
          CONCATENATE l_spfli-cityto ',' l_spfli-countryto INTO l_value.
          l_element_to  = l_document->create_simple_element(
                      name = 'to'
                      value = l_value
                      parent = l_element_flight  ).
    *     Create attribute 'airport' of node 'from'
          l_value = l_spfli-airpto.
          l_rc = l_element_to->set_attribute( name = 'airport' value = l_value ).
    *     Create element 'departure' as child of 'flight'
          l_value = l_spfli-deptime.
          l_element_dummy  = l_document->create_simple_element(
                      name = 'departure'
                      value = l_value
                      parent = l_element_flight ).
    *     Create element 'arrival' as child of 'flight'
          l_value = l_spfli-arrtime.
          l_element_dummy  = l_document->create_simple_element(
                      name = 'arrival'
                      value = l_value
                      parent = l_element_flight ).
    *     Create element 'type' as child of 'flight'
          CASE l_spfli-fltype.
            WHEN 'X'.
              l_value = 'Charter'.
            WHEN OTHERS.
              l_value = 'Scheduled'.
          ENDCASE.
          l_element_dummy  = l_document->create_simple_element(
                      name = 'type'
                      value = l_value
                      parent = l_element_flight ).
        ENDLOOP.
        IF sy-subrc NE 0.
          MESSAGE 'No data into db table ''spfli'', please run program ''SAPBC_DATA_GENERATOR'' with transaction ''SA38''' TYPE 'E'.
        ENDIF.
    *   Creating a stream factory
        l_streamfactory = l_ixml->create_stream_factory( ).
    *   Connect internal XML table to stream factory
        l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
    *   Rendering the document
        l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                              document = l_document ).
        l_rc = l_renderer->render( ).
    *   Saving the XML document
        l_xml_size = l_ostream->get_num_written_raw( ).
        CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            bin_filesize = l_xml_size
            filename     = 'c:\temp\flights.xml'
            filetype     = 'BIN'
          CHANGING
            data_tab     = l_xml_table
          EXCEPTIONS
            OTHERS       = 24.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.

  • Our etext output needs a combination of XML tags from multiple levels

    Our etext output needs a combination of XML tags from multiple levels. Each unique combination of <OutboundPayment>/<Payee>/<SupplierNumber> and <OutboundPayment>/<DocumentPayable>/<ReferenceNumber> needs to be on a unique line. That means we need to combine information from different levels into a single e-text line before there is an end of record.
    Right now, it pulls the supplier number for the first invoice and matches it up to the proper line, but each line after that just repeats the supplier number it pulled the first time and uses that on each line matched to the different invoices instead of looping back and picking up the correct supplier associated with each invoice in the Format Payments Instructions.
    I have Oracle Support trying to resolve this in an SR, but so far they have made no progress. Has anyone else done this before? What command do I need to use to combine these two levels into one line of output.
    If I create a header line just above the detail line just for the supplier number it gives me exactly what I need, but on two lines in the etext output. I need it all on a single line.
    Thanks.

    If anyone needs the solution, I finally have it:
    I created a level for grouping criteria as PaymentReferenceNumber/Payee/Address/AddressName, DocumentInternalIDSegment2, called InvoiceDetailLevel. The base level is OutboundPayment.
    I then added a level (InvoiceDetailLevel) between OutboundPaymentInstruction and the DocumentPayable level.
    Then in the syntax for the supplier number and the address I entered this in the Data column:
    ../../ OutboundPayment/Payee/SupplierNumber
    and
    ../../ OutboundPayment/Payee/Address/AddressName
    That did the trick and now it is working correctly on every line, looping back to get the proper information.

  • Is there a way to create a playlist from the now playing screen on ios7?

    Is there a way to create a playlist from the now playing screen on ios7? I want to be able to hear a song in my collection and immediately add it to an existing playlist or create a new playlist.
    Thank you in advance

    Hi Cornellius,
    From the now playing screen there's a Create button at the bottom that allows you to create a
    Genius Playlist
    New Station form Artist
    New Station from Song
    IPhone Help, Browse and play
    http://help.apple.com/iphone/7/#/iph3cf21a82
    The Now Playing screen provides playback controls and shows you what’s playing.
    For information on Genius Playlists, see
    Archived - Genius for iPod and iPhone
    http://support.apple.com/kb/HT2978
    I don't see an option to add it to an existing playlist.
    Best Regards,
    Nubz

Maybe you are looking for

  • Restrict creation of inspection lot for certain work centers

    Hi My client needs to restrict the creation of inspection lot at certain work centers although QM is active for all material processed in these work centers. I am using the  function module 'EXIT_SAPLQAAT_002' of QAAT0001 for this purpose. Z04 inspec

  • How to use Sql Loader in Unix Environmant

    Hi All, Can anyone explain me please how to use sql Loader in unix environment. Actually i have one control file i want to run that file in Unix how can i achive please explain me Thank's

  • Print on network printer

    How can I print from I pad 2 on my desk top printer which is shared on the network? when I click select printer I pad is unable to find the printer it does not give any other options to find it. I could not find anything in settings which helps set u

  • Custom databases (oracle tables versus abap 'z' tables)

    We are relatively new to SAP PI.  Many of our developers come from a EAI background rather than an abap background.  How to do you recommend creating customized tables - directly create an oracle database and schema and administer outside of the sap

  • Toggle between fields

    Hi, I have two fields order & contract on my screen. I want to ensure that only one field is input-enabled at any given point. I would like some sort of radio-button functionality wheerin if a user selects which field he wants to edit and subsequentl