How to update Elements value inside existing xml file

Hi Gurus,
Am somehow new to java and working on xml with java, i have a scenario where i want to update the elements of my existing xml file, i know its possible as i have posted one code on this forum which updates the values of the arrtibutes of existing xml file. Ref :
http://forum.java.sun.com/thread.jsp?forum=34&thread=186091&start=15&range=15&hilite=false&q=
But am not able to use the same code to update the vlaues of the attribute.
if i have this xml file :
<?xml version="1.0"?>
<RootElement>
<Transaction>
<Task9>
<TaskID>Task9</TaskID>
<Description>My Test Case</Description>
<Time>12/12/2004</Time>
</Task9>
</Transaction>
<Transaction>
<Task2>
<TaskID>Task2</TaskID>
<Description>Testing my xml</Description>
<Time>12/12/2004</Time>
</Task2>
</Transaction>
</RootElemen>
Now i want to update teh </Description> and </Time> field using the code that i have given above in the link.
If any one can help me ill really appreciate.

The value of an element is stored in a child node of that element. For example, let's say that "e" references the node <Description> then:
e.getFirstChild().getNodeValue() => "My Test Case"

Similar Messages

  • How to retrieve elements from 3 different xml file in one url

    Hi all,
    Could anyone please let me how can we retrieve elements from 3 different xml file in one url?
    i just can only do it with one file only, any help would very appreciate.
    Thank in advance
    Jim

    Hi Philip
    Thanks for replying me.
    I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The  Hierarchy already appears in Axis1".
    SELECT
    {[Measures].[Internet Sales Amount] } ON 0,
    NON EMPTY
    {[Customer].[Gender].allmembers } ON 1 -- Used
    FROM
    [Adventure Works]
    WHERE
    [Customer].[Gender].&[M]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].&[XL]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].&[Australia]
    Can you provide alternate ways to get resolved.
    Thanks in advance

  • How to update the value inside a field symbol ?

    ASSIGN COMPONENT 'MENGE' OF STRUCTURE <fs_line> TO <fs_field>.
    <fs_field> = itab_stpo-menge.
    COLLECT <fs_line> INTO <fs_table>.
    .processing some code......
    ASSIGN COMPONENT 'MENGE' OF STRUCTURE <fs_line> TO  <fs_field>.
    <fs_field> = ( itab_stpo-menge * itab_plpo-vgw03 ).
    COLLECT <fs_line> INTO <fs_table>.
    Hi, guys,
    May i know is there a way to update the value in inside a field symbol?
    I feel hard to figure out the way to solve this situation. Kindly give me some help or perhaos tell me other altenative way to do it also can.
    Thanks in advance.
    Edited by: Jiansi Lim on Apr 25, 2008 8:09 PM

    hi check this...
    For a structured data object s, you can use the statement
    ASSIGN COMPONENT comp OF STRUCTURE s TO FS.
    Here the comp is the component name or its index number in the structure.
    Find the following sample code -
    DATA: BEGIN OF LINE,
    COL1 TYPE I VALUE '11',
    COL2 TYPE I VALUE '22',
    COL3 TYPE I VALUE '33',
    END OF LINE.
    DATA COMP(5) VALUE 'COL3'.
    FIELD-SYMBOLS: <F1>, <F2>, <F3>.
    ASSIGN LINE TO <F1>.
    ASSIGN COMP TO <F2>.
    DO 3 TIMES.
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1> TO <F3>.
    WRITE <F3>.
    ENDDO.
    ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>.
    WRITE / <F3>.
    The output is:
    11 22 33
    33
    I need to update one field in Internal table
    regards,
    venkat

  • How to add tags to the existing XML file?

    Hi,
    I have a requirement wherein I have to add a tag to the existing xml data.
    For Eg:
    <ROW>
    <EVNT_ID>7333976</EVNT_ID>
    <DISTRCT_CD>67</DISTRCT_CD>
    <TIME_OFF>06-May-2008 10:50:04 AM</TIME_OFF>
    </ROW>
    The desired output is,
    <DI_DATA>
    <ROW>
    <EVNT_ID>7333976</EVNT_ID>
    <DISTRCT_CD>67</DISTRCT_CD>
    <TIME_OFF>06-May-2008 10:50:04 AM</TIME_OFF>
    </ROW>
    </DI_DATA>
    I have to add <DI_DATA> </DI_DATA>at the start and end of the input.
    Could any of you help me on this?
    Thanks,
    GV

    If your XML is just in a CLOB, you can just use string manipulation to prepend/append the nodes on. If you have it in an XMLType you could just do the following
    select appendchildxml(XMLTYPE('<DI_DATA/>'),
                                  'DI_DATA',
                                  XMLTYPE('<ROW>
    <EVNT_ID>7333976</EVNT_ID>
    <DISTRCT_CD>67</DISTRCT_CD>
    <TIME_OFF>06-May-2008 10:50:04 AM</TIME_OFF>
    </ROW>'))  -- this would be your variable
      from dual;which will put your data within the DI_DATA node.

  • How to create Bar chart  from existing XML file

    Hi all,
    i'm new to flex, i need your help to develop a flex for
    dashboard app. we have sample.xml file. by using this i need to
    create a bar diagram or piechart.
    Please help me out
    The XMl looks like this.....
    <?xml version="1.0" encoding="utf-8"?>
    <user id="123412343">
    <fullName>
    <lastName>Telles</lastName>
    <firstName>vijay</firstName>
    </fullName>
    <preferences>
    <modWidth>235</modWidth>
    <modHeight>250</modHeight>
    <totalWidth>1650</totalWidth>
    <totalHeight>1650</totalHeight>
    <modsX>4</modsX>
    <modsY>2</modsY>
    </preferences>
    <module id="Status2">
    <windowOpen>true</windowOpen>
    <pointsToShow>
    <p label="Proposed"/>
    <p label="Draft"/>
    <p label="DEP Adpt"/>
    <p label="EPA Adpt"/>
    </pointsToShow>
    <dataSetsToShow>
    <label>2006</label>
    <label>2007</label>
    </dataSetsToShow>
    </module>
    </user>

    convert this xml to ArrayCollection called chartData
    var charOption:String = "totalHeight"; /Use this to set the
    yField property...
    <mx:ColumnChart showDataTips="true" id="barChart"
    width="100%" height="100%" dataProvider="{chartData}"
    color="0xffffff">
    <mx:horizontalAxis>
    <mx:CategoryAxis
    dataProvider="{chartData}"
    categoryField="hour" />
    </mx:horizontalAxis>
    <mx:verticalAxis>
    <mx:LinearAxis labelFunction="addDollarSign"/>
    </mx:verticalAxis>
    <mx:series>
    <mx:ColumnSeries yField="{chartOption}"
    showDataEffect="interpolate"
    creationCompleteEffect="interpolate"/>
    </mx:series>
    </mx:ColumnChart>

  • How to reference a value in an XML file

    Hey guys!  I have a valid XML structure, and in it is the following info:
    <app>
         <settings>
              <setting name="defaultModuleSlug" value="apples"></setting>
              <setting name="defaultPageSlug" value="oranges"></setting>
         </settings>
    <app>
    The XML info is in an application object called application.config.
    So, How do I reference the defaultPageSlug variable?  I know I can use:
    application.config[ 'app' ][ 'settings' ].xmlChildren[ 2 ].xmlAttribute[ 'value' ]
    However, I'd like to be able to reference the setting by it's name attribute (defaultPageSlug) and not assuming it's the 2nd element in that node.  Can someone help?

    Nevermind, I guess I can just use XPath.

  • How do i update an existing XML File?

    Hello, I have the following xml file gps.xml:<?xml version="1.0"?>
    <!DOCTYPE gps SYSTEM "gps.dtd">
    <gps>
       <latitude>43.00000</latitude>
       <longitude>-83.00000</longitude>
    </gps> I already have methods written to get the values. But how can I change these values and update the file to reflect these changes?
    thanks for your help!

    Hi, I already have this following code. I would just like to add a method to it to update the existing XML file with different lat/lon coordinates. Could you please help me out with it? thanks
    import java.io.*;
    import java.io.PrintWriter;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class Gps implements java.io.Serializable {
        private double latitude_;
        private double longitude_;
        public Gps(Document doc) {
            setup(doc.getDocumentElement());
        public Gps(String uri) throws IOException, SAXException, ParserConfigurationException {
            setup(uri);
        public void setup(Document doc) {
            setup(doc.getDocumentElement());
        public void makeElement(Node parent) {
            Document doc;
            if (parent instanceof Document) {
                doc = (Document)parent;
            } else {
                doc = parent.getOwnerDocument();
            Element element = doc.createElement("gps");
            int size;
            URelaxer.setElementPropertyByDouble(element, "latitude", this.latitude_);
            URelaxer.setElementPropertyByDouble(element, "longitude", this.longitude_);
            parent.appendChild(element);
         public Document makeDocument() throws ParserConfigurationException {
            Document doc = UJAXP.makeDocument();
            makeElement(doc);
            return (doc);
        public final double getLatitude() {
            return (latitude_);
        public final void setLatitude(double latitude) {
            this.latitude_ = latitude;
        public final double getLongitude() {
            return (longitude_);
        public final void setLongitude(double longitude) {
            this.longitude_ = longitude;
       public final void updateXmlFile(double latitude, double longitude) {
         // something???
        public final void updateXmlFile(double latitude, double longitude) {
            this.latitude_ = latitude;
            this.longitude_ = longitude;
        public String makeTextDocument() {
            StringBuffer buffer = new StringBuffer();
            makeTextElement(buffer);
            return (new String(buffer));
        public void makeTextElement(StringBuffer buffer) {
            int size;
            buffer.append("<gps");
            buffer.append(">");
            buffer.append("<latitude>");
            buffer.append(Double.toString(getLatitude()));
            buffer.append("</latitude>");
            buffer.append("<longitude>");
            buffer.append(Double.toString(getLongitude()));
            buffer.append("</longitude>");
            buffer.append("</gps>");
        public String toString() {
            try {
                return (makeTextDocument());
            } catch (Exception e) {
                return (super.toString());
    }

  • How to set variable value in an XML array

    Hi,
    Please let me know how to set the value for a xml array element using assign activity inside a for-each block in BPEL 11g
    I tried to set the variable value for result element using the below condition but i encountered selection failure message
    $outputVariable.payload/ns1:Student['i']/ns1:result or
    $outputVariable.payload/ns1:Student[$i]/ns1:result
    And the xsd used is as below
    <xsd:complexType name="StudentCollection">
    <xsd:sequence>
    <xsd:element name="Student" type="Student" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Student">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="location" type="xsd:string"/>
    <xsd:element name="mark" type="xsd:string"/>
    <xsd:element name="result" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    Thanks,
    Dhana

    Hi,
    At the back of button specify the following parameter:-
    CMD    1        Execute_planning_function
    Planning_function_name  1   xyz
    Var_name     1    variable_name
    var_value      1    blank
    Can also refer to link below:-
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0a89464-f697-2910-2ba6-9877e3088954?quicklink=index&overridelayout=true(can refer to page 20)
    http://www.sdn.sap.com/ddc5564a-337d-4cf9-a34e-2dab64df09be/finaldownload/downloadid-a61a6724ba8e7b7fbd9c5df9590ab50d/ddc5564a-337d-4cf9-a34e-2dab64df09be/irj/scn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be?quicklink=index&overridelayout=true
    Hope it may help

  • Updating an existing  xml file in java

    Hi,
    i need to update an existing xml file with new nodes. But i don.t know how to do that. i can read and write a new xml file . But updaton seems too difficult for me.
    my xml structure is like this
    <main_node>
    <node1>
    <name> name1</name1>
    <id>ID</id>
    </node1>
    <node2>
    <name2> name2</name2.
    <id>ID</id>
    </node2.
    </main_node>
    i want to insert node3 in this structure.
    please help, it,s urgent;
    Thanks in Advance

    here is the code if ur using dom..
    Node node4 = doc.createTextNode(name3);
    Element element4=doc.createElement("name3");
    element4.append(node4);
    c one thing that u should take care here is that u have created and is reflected on ly in ur document object and not in xml..for that u have to write some more code like this
    // This method writes a DOM document to a file
    public static void writeXmlFile(Document doc, String filename) {
    try {
    // Prepare the DOM document for writing
    Source source = new DOMSource(doc);
    // Prepare the output file
    File file = new File(filename);
    Result result = new StreamResult(file);
    // Write the DOM document to the file
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(source, result);
    } catch (TransformerConfigurationException e) {
    } catch (TransformerException e) {
    look this code..that will help u
    regards
    [email protected]

  • How to get a value from Specific XML Node

    Hi all,
    I'm just trying to introduce to XMLType and see the potencialities of that.
    DB version:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Productio
    NLSRTL Version 10.2.0.5.0 - Production
    I'm a table with just one CLOB field:
    CREATE TABLE asm_test
    (doc XMLType NOT NULL)
    XMLTYPE doc STORE AS CLOB;
    Then i've inserted the following XML data:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ReceiptDesc>
    <appt_nbr>2142473</appt_nbr>
    - <Receipt>
    <dc_dest_id>401</dc_dest_id>
    <po_nbr>2142473</po_nbr>
    <document_type>P</document_type>
    <asn_nbr />
    - <ReceiptDtl>
    <item_id>509720</item_id>
    <unit_qty>83.0000</unit_qty>
    <receipt_xactn_type>R</receipt_xactn_type>
    + <receipt_date>
    <year>2012</year>
    <month>09</month>
    <day>17</day>
    <hour>15</hour>
    <minute>33</minute>
    <second>49</second>
    </receipt_date>
    <receipt_nbr>6902340</receipt_nbr>
    <container_id>1</container_id>
    <to_disposition>ATS</to_disposition>
    <user_id>NTCPO01</user_id>
    <catch_weight />
    </ReceiptDtl>
    - <ReceiptDtl>
    <item_id>509740</item_id>
    <unit_qty>17.0000</unit_qty>
    <receipt_xactn_type>R</receipt_xactn_type>
    + <receipt_date>
    <year>2012</year>
    <month>09</month>
    <day>17</day>
    <hour>15</hour>
    <minute>33</minute>
    <second>49</second>
    </receipt_date>
    <receipt_nbr>6902344</receipt_nbr>
    <container_id>1</container_id>
    <to_disposition>ATS</to_disposition>
    <user_id>NTCPO01</user_id>
    <catch_weight />
    </ReceiptDtl>
    </Receipt>
    </ReceiptDesc>
    And then i have started to make some tests to retrieve data from.
    SELECT EXTRACTVALUE(doc, '/ReceiptDesc/appt_nbr') FROM asm_test; -- got the correct value 2142473
    SELECT EXTRACTVALUE(doc, '/ReceiptDesc/Receipt/dc_dest_id') FROM asm_test; ---- got the correct value 401
    select count(*) from asm_jam_test d where (d.doc.getClobVal()) like '%NTCPO01%'; -- got 1
    But i need to find a Specific data from XML (the main goal is to update a value inside XML).
    If i try this:
    select extract(doc, '/ReceiptDesc/Receipt/ReceiptDtl/item_id/text()').getstringVal() from asm_test                     
    where existsNode(doc,'/ReceiptDesc/Receipt/ReceiptDtl/receipt_nbr') = 1;
    got: 509720509740 -- which are the concatenate of 2 Item_ids
    when i try to find out the Item_id of specific receipt_nbr i got a NULL response.
    select extract(doc, '/ReceiptDesc/Receipt/ReceiptDtl/item_id/text()').getstringVal()
    from  asm_test                     
    where existsNode(doc,'/ReceiptDesc/Receipt/ReceiptDtl/receipt_nbr') = 1 and
    extract(doc,'/ReceiptDesc/Receipt/ReceiptDtl/receipt_nbr/text()').getstringVal() = '6902340';
    What i'm doing wrong or which is the best way to get data from XML?
    Many thanks in advance

    Hi,
    Thanks for providing db version and sample data in the first place.
    Don't forget to use the &#x7B;code} tags to preserve formatting.
    Also, when posting XML, do not copy/paste directly from your browser as it retains +/- signs and therefore needs extra processing on our side.
    select count(*) from asm_jam_test d where (d.doc.getClobVal()) like '%NTCPO01%'; -- got 1No, don't do it like that.
    Use existsNode() function in this situation :
    SQL> select count(*)
      2  from asm_test
      3  where existsNode(doc, '/ReceiptDesc/Receipt/ReceiptDtl[user_id="NTCPO01"]') = 1
      4  ;
      COUNT(*)
             1
    when i try to find out the Item_id of specific receipt_nbr i got a NULL response.Yes, that's because this :
    extract(doc,'/ReceiptDesc/Receipt/ReceiptDtl/receipt_nbr/text()').getstringVal()returns :
    69023406902344So obviously it cannot be equal to '6902340'.
    When you have to deal with repeating nodes individually, use XMLTable function to break the structure into relational rows and columns.
    The resultset you'll get acts as a virtual table (or inline view) you can then manipulate with SQL operations :
    SQL> select x.*
      2  from asm_test t
      3     , xmltable(
      4         '/ReceiptDesc/Receipt/ReceiptDtl'
      5         passing t.doc
      6         columns item_id     varchar2(15) path 'item_id'
      7               , receipt_nbr varchar2(15) path 'receipt_nbr'
      8       ) x
      9  ;
    ITEM_ID         RECEIPT_NBR
    509720          6902340
    509740          6902344
    Now, you can just add a WHERE clause to filter the RECEIPT_NBR you require :
    SQL> select x.item_id
      2  from asm_test t
      3     , xmltable(
      4         '/ReceiptDesc/Receipt/ReceiptDtl'
      5         passing t.doc
      6         columns item_id     varchar2(15) path 'item_id'
      7               , receipt_nbr varchar2(15) path 'receipt_nbr'
      8       ) x
      9  where x.receipt_nbr = '6902340'
    10  ;
    ITEM_ID
    509720
    That can also be achieved with EXTRACTVALUE and a single XPath expression (assuming RECEIPT_NBR is unique) :
    SQL> select extractvalue(
      2           doc
      3         , '/ReceiptDesc/Receipt/ReceiptDtl[receipt_nbr="6902340"]/item_id'
      4         ) as item_id
      5  from asm_test
      6  ;
    ITEM_ID
    509720

  • Updating an existing xml file using java code

    hi friends,
    I have simple problem, I have an existing xml file and I want to update some of the values in the file.
    can any one send me the java code for that.
    bye.
    -harish

    org.w3c.dom.Document d = parseXmlFile("D:/www/Detailcache/detail.xml", false);
    public static Document parseXmlFile(String filename, boolean validating) {
    try {
    // Create a builder factory
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(validating);
    // Create the builder and parse the file
    Document doc = factory.newDocumentBuilder().parse(new File(filename));
    return doc;
    } catch (Exception e) {
    System.out.println("ERROR-->");e.printStackTrace();
    return null;
    look at .. for more related examples
    http://javaalmanac.com/egs/javax.xml.parsers/BasicDom.html?l=rel

  • How to get the attribute value of an XML file??

    How to get the attribute value of an XML file??
    For example, how to get name and age attributes?
    <student name="Joe" age="20" />

    What are you using to read the XML file??
    On the assumption of JDOM - www.jdom.org. Something along the lines of:SAXBuilder builder = new SAXBuilder(true);
    Document doc = builder.build(filename);
    Element root = doc.getRootElement();
    List children = root.getChildren();
    Element thisElement = (Element)children.get(n);
    String name = thisElement.getAttributeValue("name")
    try
         int age = Integer.parseInt(thisElement.getAttributeValue("age"));
    catch (Exception ex)
         throw new InvalidElementException("Expected an int.....");
    }Ben

  • How I can append new node in existing  XML file

    I've just begun learning DOM XML , so I'm currently at a very beginner level.
    I have an existing XML file that I would like to add an additional node to before saving it to another variable.
    how I can append new node in this file.
    now this code is overwrite new data over old data
    The code looks like this:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.TransformerFactoryConfigurationError;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    public class VerbXMLWriter
        static String EVerb3;
        static String englishTranslate3;
        public void VerbXMLWriter(String EVerb, String englishTranslate )
             EVerb3 = EVerb;
             englishTranslate3=englishTranslate;
        File xmlFile = new File("VerbDB.xml");
        DocumentBuilderFactory factory =  DocumentBuilderFactory.newInstance();
        try
         DocumentBuilder builder = factory.newDocumentBuilder();
         Document document = builder.newDocument();
        Element root = document.createElement("Verb");
         document.appendChild(root);
         Element verb = document.createElement(EVerb3);
         verb.setAttribute("EnglishTranslate",englishTranslate3);
         root.appendChild(verb);
         Source xmlSource = new DOMSource( document );
         Result result = new StreamResult( new FileOutputStream(xmlFile) );
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer =
        transformerFactory.newTransformer();
        transformer.setOutputProperty( "indent", "yes" );
         transformer.transform( xmlSource, result );
      catch(TransformerFactoryConfigurationError factoryError )
        factoryError.printStackTrace();
       catch (ParserConfigurationException pc)
           pc.printStackTrace();
       catch (IOException io)
          io.printStackTrace();
       catch(Exception excep )
           excep.printStackTrace();
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Verb>
    <Play EnglishTranslate="playing" />
    </Verb>Edited by: itb402 on Mar 9, 2008 6:05 AM

    in your code you are already appending new nodes to the root node. so what exactly is your problem? The following steps are usually taken for appending a new node:
    1. Read the XML document
    2. Build a DOM tree
    3. Navigate to the node under which you want to insert the new node
    4. Create a new node.
    5. Insert the new node to the node selected in point #3.
    ~Debopam

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • SOP: How to update ratio values

    Hi everyone,
    I have defined an Information Structure with some characteristics and ratios, all of them associated to some ZTable fields.
    Well, I would be very grateful whether someone could tell how to update ratio values in my Information Structure. I mean I would like to know which are the steps I have to follow in order to update tha value of my ratios everytime its associated ZField changes its value.
    I have the idea of using this Information Structure in a "Level-by-Level" planning type using Product Groups.
    Thanks in advance and best regards.
    Ben.

    Hi again,
    Actually I have already created my planning type with some macro instructions and I have checked that they work properly in MC94. I have also created a planning hierarchy as you requested.
    But my problem doesn't deal with this. The key figures that I have included in my structure represent values in SAP (i.e. Sold units, Security stocks...).
    What I need to do is update the value of that key figures in my structure for all the combinations of my characteristics.
    I hope my explanation is quite better this time.
    Thanks.

Maybe you are looking for

  • Family sharing between two existing Apple ID accounts?

    Greetings, My wife and I have two long standing Apple ID accounts and were exciting at the prospect of Family Sharing in iOS8. What we would like to do is to be able to see and share the purchases we have made over the years instead of having to log

  • Cannot use aipprint from iphone 4 with ios 5.0.1. does not find the hp m1212nf laser.

    have a hp m1212nf mfp(airprint compatible according to the hp web site) hooked up via usb to mac running OS 10.6.8., other mac hooked up via router to same network, Can print from both machines to the printer, which has the latest firmware installed.

  • IPod preferences not sticking

    Hi... I've had a new problem crop up with my iTunes and iPod syncing.... In my iPod prefs I set music to be managed manually, ipods to update automatically and contacts and calendars to update automatically.... I use this on both my office Mac and my

  • I need to erase the down arrow on a I tune app that I do not want to download

    I have an iPod 1. I want to watch video. Each time I click a video it runs for about 60 seconds then freezes. My system says it is up to date. Any ideas on what I can do to correct?

  • Ipad wont open word docs

    My ipad won't open any attachments such as word docs or jpegs. I have reset ipad, have re reset email account, talked with apple care, that was no help. Any ideas? All other functions of email work fine.