Modify XML via Python problem

Hi,
Using this: http://www.oracle.com/technology/documentation/berkeley-db/xml/gsg_xml/cxx/modifydocument.html as my inspiration, I am attempting to update a value in dbxml via th Python bindings. The XML document in question looks something like:
<foo><bar>123</bar></foo>
and my code looks like:
def open(self, dbname):
self.dbname = dbname
self.manager = dbxml.XmlManager()
self.container = self.manager.openContainer(self.dbname)
self.qcontext = self.manager.createQueryContext()
self.ucontext = self.manager.createUpdateContext()
self.mcontext = self.manager.createModify()
self.isopen = True
def get(self, x):
if self.isopen == False: return None
query = "collection('" + self.dbname + "')" + x
expression = self.manager.prepare(query, self.qcontext)
for object in expression.execute(self.qcontext, 0): return object
def set(self, object, query, value):
if self.isopen == False: return
if object == None: return
select = self.manager.prepare(query, self.qcontext);
self.mcontext.addUpdateStep(select, value);
self.mcontext.execute(object.asDocument(), self.qcontext, self.ucontext); # XXX
The object returned by "get" is "foo" using a query string of "/foo" (which works just fine). This object is in turned passed to "set" using a query string of "/foo/bar".
The trouble area is marked with "XXX" above. The error message is:
File "/opt/dbxml-2.2.13/lib/python/dbxml.py", line 748, in execute
def execute(*args): return dbxml.XmlModifyexecute(*args)
NotImplementedError: No matching function for overloaded 'XmlModify_execute'
If I remove "asDocument()", then the error message is:
File "/opt/dbxml-2.2.13/lib/python/dbxml.py", line 748, in execute
def execute(*args): return dbxml.XmlModifyexecute(*args)
RuntimeError: Error: XmlModify::execute: Cannot perform a modification on an XmlValue that isn't either Node or Document type
Any idea what I am doing wrong? Much thanks.
-Tom

Tom,
Your objects are not of the correct types for the various overloads.
You can determine what type they should be by looking at the
C++ documentation -- the Python bindings are quite similar.
Here's a working script for you to look at as well (I"m sure you'll
have to reformat to get the indentation correct):
from bsddb3.db import *
from dbxml import *
from _dbxml import *
book_content = r"<book><title>Knowledge Discovery in Databases.</title></book>"
book_name = r"book1"
def remove_database():
    """Removes the databases so we can start with a fresh environment for
    each test."""
    import os, glob
    databases = ["test", "test1", "test2"]
    for database in databases:
        files = glob.glob(database + "*.dbxml")
        files += glob.glob("__db*")
        files += glob.glob("log.*")
        for file in files:
            os.remove(file)
def doModify():
    mgr = XmlManager()
    uc = mgr.createUpdateContext()
    container = mgr.createContainer("test.dbxml")
    container.putDocument(book_name, book_content, uc)
    qc = mgr.createQueryContext()
    results = mgr.query("collection('test.dbxml')/book", qc)
    # print original document
    for value in results:
        document = value.asDocument()
        print document.getName(), "=", value.asString()
    mod = mgr.createModify()
    exp = mgr.prepare("./title", qc)
    mod.addInsertAfterStep(exp, XmlModify.Element, "new", "text")
    # apply modification to results (original document),
    # update, and then look at new content
    results.reset()
    for value in results:
     mod.execute(value, qc, uc)
        document = value.asDocument()
     container.updateDocument(document, uc)
    doc1 = container.getDocument(book_name)
    print "after: ", document.getContent()
if __name__ == "__main__":
    import sys
    remove_database()
    doModify()Regards,
George

Similar Messages

  • Problemas no recebimento de XML via E-mail caracteres especiais

    Boa Tarde
    Estou com problemas no cenario de Validação de Assinatura com apenas um XML :
    Estou recebendo um XML via E-mail !
    Quando verifico o XML pelo Validador Online disponibilizado pelo SEFAZ RS ,a Assinatura é dada como Válida
    e quando é pelo PI usando o serviço de Validação da Assinatura(Verify) a mesma é dada como inválida... Através do Payload na SXI_MONITOR verifiquei que além dos cacacteres ENTER entre as TAGs aparecem ESPAÇOS ...(ex.: Tag1 valor fecha Tag1   espaço  Tag2 valor fecha Tag2).teria como tratar isso sem invalidar a Assinatura automáticamente ?

    Boa Tarde
    Não sei se você chegou a receber alguns casos  que lhe enviei ...! Quando ele chega ao e-mail ele já esta assim....!
    Esse é nosso grande problema as vezes o parceiro não se sente obrigado em ajustar o seu sistema,  uma vez que lhe é apresentado uma ferrameta do governo que valida esse mesmo arquivo rejeitado pelo serviço  de Validação de *** Digital(AS JAVA)SAP  ...,oque penso em  fazer  quanto a essa questão,.. desenvolver  uma  solução para tratar a excessão ..com calculo  de Hash ...comparação Binária.. e outras mais...!
    Só que eu não queria tomar um caminho muito distante doque a SAP possa vir a tomar com essa solução no futuro até mesmo para não depreciar essa ferramenta que é tão boa...!
    Att
    Ronaldo de Moraes
    Edited by: Ronaldo de Moraes on Oct 21, 2009 4:58 PM

  • How to retreive the modified XML data?

    Hi..
    i had a problem in retrieving the modified xml data.
    Iam using apache's DOMParser
    In the my class my xml data is stored in a string.so i used following statement to read xml data from that string:
    String abc="<? xml version=... some data goes here"
    InputSource in=new InputSource(new ByteArrayInputStream(abc.getBytes()));
              DOMParser domParser = new DOMParser();
              domParser.parse(in);
              Document doc = domParser.getDocument();
              Element root = doc.getDocumentElement();
    and i did some operations like adding ,removing and replacing elements etc.
    It was fine when the checked the data.
    but..i need my modified xml data as String.
    is there any method to retrieve the modified xml data "as it is" in String?

    You can use XMLSerializer.
    Here is an example that dump your document on the console:
    OutputFormat formatter = new OutputFormat();
    formatter.setPreserveSpace(true);
    XMLSerializer serializer =
    new XMLSerializer(System.out, formatter);
    serializer.serialize(doc);
    where doc is your Document.

  • Modifying XML files with JDOM

    Hi:
    I've been trying to get up to speed with JDOM, and while it seems pretty intuitive, I've been having a problem w/ modifying XML documents.
    Namely, once I get a Document object from a (skeleton) XML file, do changes made to the Document object through, say, addContent() propagate to the original file? My gut feeling is no, although this was certainly what I had expected initially.
    Here's a code fragment of what I had tried to do to populate a barebones XML file:
                   Document doc = builder.build(output);
              // add 100 elements, all the same
              for (int count = 0; count < 100; count++)
                   Element curr = new Element("book");
                   // create child nodes for book
                   Element title = new Element("title");
                   title.addContent("Book " + (count + 1));
                   Element author = new Element("author");
                   author.addContent("Author " + (count + 1));
                   Element price = new Element("price");
                   price.addContent("Price " + (count + 1));
                   curr.addContent(title);
                   curr.addContent(author);
                   curr.addContent(price);
                   doc.getRootElement().addContent( curr );
              }

    Mikael,
    This sounds like one of the many quirks (perhaps bugs) related to how FrameMaker handles non-FM files in books. The current book model doesn't play well with XML files as chapters and this seems like yet another problem. Apparently, if an xref does not target another .fm file in the book, Frame assumes that the target file is not in the book and therefore will not be in the book PDF.
    There have been discussions here about this in the past. The solution that I use is to run an API client before publishing that converts all XML files to .fm files, and redirect all xrefs appropriately. Then, book features work as expected and PDFs come out as normal. This is not feasible, however, without the automation from the API client.
    There may be some who would say that the best approach is to use XML and books the way that the designers did account for... that is, the whole book becomes an XML document with entity references to the separate chapters. In my work, though, this model was not appropriate... rather, I needed a binary FM book to act like a book, except with XML files as chapters. So, I think I understand your situation.
    Is API programming or FrameScript an option for you? I think it may be the only way to get what you are looking for.
    Russ

  • How to modify XML to copy items

    Hi,
    i need to copy from itemcode "XX" to itemcode "YY". i save it with XML as:
    Dim oBI As SAPbobsCOM.Items
    oBI = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
    oBI.SaveXML(sFileXml)
    I need to modify XML because i must change ItemCode and then add the new item
    <ItemCode>XX</ItemCode>
    ???<ItemCode>YY</ItemCode>
    How can i do this?
    Thanks
    Valentina

    I am trying to do the exact same thing right now.  I am having moderate success with oItem.GetAsXML into a string, then using REPLACE to change the itemcode value (it exists in about 18 places, for me, because the XML gives you other stuff, like the contents of OITW).
    Then I just write my string to a temp file and bring it back in to the new object and do the add.  Here's my code:
               tempXML = System.IO.Path.GetTempFileName()
                'retrieve template item object's xml into string
                itemObjectXML = zTmpltItm.GetAsXML
                'replace the template item code with the new one
                itemObjectXML = Replace(itemObjectXML, String.Format(ItemCodeXML, zTmpltItm.ItemCode), _
                                String.Format(ItemCodeXML, zNewCode))
                'replace the template item code with the new one          
              itemObjectXML = Replace(itemObjectXML, String.Format(ItemNameXML, zTmpltItm.ItemName), _
                    String.Format(ItemNameXML, zNewName))
             'some other code...
                'save the template to disk
                sw = New System.IO.StreamWriter(tempXML, False)
                sw.WriteLine(itemObjectXML)
                sw.Close()
                'retrieve the new item's xml into a new item object for adding to the DB
                oNewItem = oCompany.GetBusinessObjectFromXML(tempXML, 0)
                'oNewItem.ItemCode = zNewCode
                'oNewItem.ItemName = zNewName
                retval = oNewItem.Add
                If retval <> 0 Then
    The one thing I wonder about is how large can the XML string end up being.  I think .net has a 32K limit, but the GetAsXML function does return a string.
    I'm doing this in 2007 and I have a problem with some of the values returned, however (like the SHGHT1Unit field).  I have a separate post for that one.
    I don't know if my way is "best practice" or even advisable, but I do have it working.
    PS: you've got to have this statement before doing the xml copying:
    oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
    Added a PS
    Message was edited by: JC
            John Chadwick

  • Send xml via mail (IPhone SDK)

    HI all,
    i have some problem sending xml via mail(mailto). When the amil program caming up il see the subjet but the xml tag there aren't???
    any one has an idea how do this??
    thanks in advanced
    Claudio

    Go into settings - mail - account - and then look for the outgoing server - click in there and there should be a place for you to enter your password - just as you would when you first set up your email account.

  • Not able to generate AS2 MDN when receiving custom XML via AS2

    Hi friends,
    I have setup the trading partner and the corresponding TP certificate import for receiving the custom XML via AS2 channel.
    I am receiving the custom xml properly to oracle b2b and able to receive the same to bpel as well. however in the oracle b2b console under reports tab i am seeing only one record for inbound document receive and i am not seeing the other record for the AS2 MDN going back to vendor. I have setup the AS2 channel under the external trading partner --> Channel using the vendor AS2 URL and selected all the security parameters while creating the Outbound AS2 channel.
    1. Not able to generate AS2 MDN when receiving custom XML via AS2.
    2. eventhough i am able to decrypt the inbound custom XML and ablr to recieve it in bpel also for processing, in the reports tab the inbound message state is changing to MSG_ERROR and it has the folloing error message:
    Error Code
    B2B-50037
    Error Description
    Machine Info: (***********)  Description: B2B inbound message processing error
    Error Level
    ERROR_LEVEL_COLLABORATION
    for AS2 MDN generation for custom XML receiving using As2 protocol, do we need to setup anything other than the outbound As2 Channel using the external vendor AS2 URL?
    Can you please help me how can i generate the AS2 MDN for the inbound custom XML document i have received and also why the inbound message is failing even though i am receiving the custom XML properly to bpel?
    Thanks,
    Amirineni.

    Hi Prasanna,
    Vendor has enabled the ACK mode as SYNC.
    Below are the headers for the inbound message to B2B. and we are able to receive the input message to bpel also.
    Protocol Transport Binding
    ChannelName=******** AS2-To=****AS2 TE=trailers, deflate, gzip, compress Date=Thu, 02 Oct 2014 14:26:31 GMT AS2-Version=1.2 Accept-Encoding=deflate, gzip, x-gzip, compress, x-compress AS2-From=****AS2 Disposition-Notification-Options=signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, sha1 Disposition-Notification-To=https://******/as2 Message-ID=<CLEO-20141002_142630452-31X54N@****_*****AS2.pcwbedi1-O> Content-type=application/pkcs7-mime; smime-type=enveloped-data; name=smime.p7m Content-length=747006 MSG_RECEIVED_TIME=Thu Oct 02 10:26:39 EDT 2014 Subject=EDI ECID-Context=1.005175bK7U^AXNJCAnf9Cx0002pW000yjX;kXjE1ZDLIPGIj2QCYV8QoKSSILRO_PQT_IS Proxy-Client-IP=****** Recipient-Address=https://******/b2b/httpReceiver User-Agent=RPT-HTTPClient/0.3-3I (Windows 2003) X-Forwarded-For=****** Content-Disposition=attachment; filename="smime.p7m" Host=****** EDIINT-Features=CEM, multiple-attachments, AS2-Reliability Connection=Keep-Alive X-WebLogic-KeepAliveSecs=30 X-WebLogic-Force-JVMID=-1497702782 From=****** Mime-Version=1.0
    Message Digest
    Message Digest
    Digest Algorithm
    sha1
    Transport Protocol
    HTTP
    Transport Protocol Version
    1.0
    Url
    http://******
    security
    Transport Headers
    ChannelName=****** AS2-To=******AS2 TE=trailers, deflate, gzip, compress Date=Thu, 02 Oct 2014 14:26:31 GMT AS2-Version=1.2 Accept-Encoding=deflate, gzip, x-gzip, compress, x-compress AS2-From=****AS2 Disposition-Notification-Options=signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, sha1 Disposition-Notification-To=https://******/as2 Message-ID=<CLEO-20141002_142630452-31X54N@****AS2_*****AS2.pcwbedi1-O> Content-type=application/pkcs7-mime; smime-type=enveloped-data; name=smime.p7m Content-length=747006 MSG_RECEIVED_TIME=Thu Oct 02 10:26:39 EDT 2014 Subject=EDI ECID-Context=1.005175bK7U^AXNJCAnf9Cx0002pW000yjX;kXjE1ZDLIPGIj2QCYV8QoKSSILRO_PQT_IS Proxy-Client-IP=***** Recipient-Address=*******/b2b/httpReceiver User-Agent=RPT-HTTPClient/0.3-3I (Windows 2003) X-Forwarded-For=******* Content-Disposition=attachment; filename="smime.p7m" Host=***** EDIINT-Features=CEM, multiple-attachments, AS2-Reliability Connection=Keep-Alive X-WebLogic-KeepAliveSecs=30 X-WebLogic-Force-JVMID=-1497702782 From=***** Mime-Version=1.0
    Thanks,
    Amirineni

  • Exception in XML Parser (format problem?)

    Hi Experts,
    I am working on IDOC -> AS2 Configuration and the AS2 Configuration has the below structure
    <RecordSet>
         <Row1>
                       <row1 - field1>
                       <row1 - field2>
                       <row1 - field3>
         </Row1>
         <Row2>
                       <row2 - field1>
                       <row2 - field2>
                       <row2 - field3>
         </Row2>
         <Records>
              <Record1>
                        <Record1-Field1>
                        <Record1-Field1>
                        <Record1-Field1> 
              </Record1>
              <Record2>
                        <Record2-Field1>
                        <Record2-Field1>
                        <Record2-Field1> 
              </Record2>
         </Records>
    </RecordSet>
    We are getting the expected Structure when we AS2 Receiver has the xml format. But while doing module development with the strctxml2Plain, we are getting the below error  in RWB CC Monitoring.
    Message processing failed. Cause: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException''; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException'
    Any ideas, why this error we are getting.....
    Thanks in advance,
    Regards,
    Vasu

    Hi Vasu,
    Not in the Mapping of IR.
    In BIC Mapping Designer you have to test with the standard Mappings by providing the sample file whether the Conversion is happening correctly or not.
    You have to take the same input file that what ever you are having now.
    So that it will say clearly what is the problem in converting the XMLto the required EDI Format...
    Check whether you have any Date Format Values are comming from the input file.
    Regards
    Seshagiri

  • Attempt to process file failed with Exception in XML Parser-format problem

    Hi all,
    Iam getting an unusual error in the J2EE stack in XI.
    And the message is:
    006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)' 2006-11-30 17:31:07 Error Exception caught by adapter framework: null 2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    My scenerio iam posting IDOC to a flat file with content conversion in the receiver side,the mapping got executed successfully and in the audit log i found that the error was after the 'Start converting XML document content to plain text'.
    This means that error occured during content conversion of XML to the prescribed file format.
    Can anyone suggest any better approach using which we may trace the junk data in IDoc. Manual adhoc approach could take time and is error prone.
    Thanks in advance...
    karun

    Hi Bhavesh,
    Thanks for the early reply. I checked the mapping and everything is fine and the output is also in valid XML format.
    The audit log shows that the mapping got executed successfully and the error is after the step 'Start converting XML document content to plain text '. Is there any constraint in the file adapter regarding the message size for parsing.
    2006-11-30 17:30:50 Success Transfer: "BIN" mode, size 2912595 bytes, character encoding -
    2006-11-30 17:30:50 Success Start converting XML document content to plain text
    2006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)'
    2006-11-30 17:31:07 Error Exception caught by adapter framework: null
    2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    2006-11-30 17:31:07 Success The asynchronous message was successfully scheduled to be delivered at Thu Nov 30 17:36:07 GMT 2006.
    2006-11-30 17:31:07 Success The message status set to WAIT.
    2006-11-30 17:31:08 Success Acknowledgement creation triggered for type: SystemErrorAck
    2006-11-30 17:31:08 Success Acknowledgement sent successfully for type: SystemErrorAck
    2006-11-30 17:36:08 Success Retrying to deliver message to the application. Retry: 1

  • Xml schema validation problem

    Hi All
    How to tackle this xml schema validation problem
    i am using the sample code provided by ORacle technet for xml
    schema validation in the Oracle database(817).
    The sample code works perfectly fine.
    Sample as provided by http://otn.oracle.com/tech/xml/xdk_sample/archive/xdksample_093001.zip.
    It works fine for normal xml files validated against
    xml schema (xsd)
    but in this case my validation is failing . Can you let me know why
    I have this main schema
    Comany.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.company.org"
    xmlns="http://www.company.org"
    elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Person" type="PersonType" maxOccurs="unbounded"/>
    <xsd:element name="Product" type="ProductType" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    ================
    which includes the following 2 schemas
    Product.xsd
    ============
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="Type" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ==============
    Person.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="PersonType">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="SSN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    =================
    now when i try to validate a xml file against Company.xsd
    it throws an error saying unable to find Person.xsd.
    no protocol error
    Now where do i place these 2 schemas(.xsd files) Person & product
    so that the java schemavalidation program running inside Oracle
    database can locate these files
    Rgrds
    Sushant

    Hi Jinyu
    This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import java.util.*;
    import oracle.sql.CHAR;
    import java.sql.SQLException;
    public class SchemaUtil
    public static String validation(CHAR xml, CHAR xsd)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    byte [] docbytes = xsd.getBytes();
    ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
    XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    //Parse the input XML document with Schema Validation
    docbytes = xml.getBytes();
    in = new ByteArrayInputStream(docbytes);
    DOMParser dp = new DOMParser();
    // Set Schema Object for Validation
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.setPreserveWhitespace (true);
    StringWriter sw = new StringWriter();
    dp.setErrorStream (new PrintWriter(sw));
    try
    dp.parse (in);
    sw.write("The input XML parsed without errors.\n");
    catch (XMLParseException pe)
    sw.write("Parser Exception: " + pe.getMessage());
    catch (Exception e)
    sw.write("NonParserException: " + e.getMessage());
    return sw.toString();
    This is the code i used initially for validating a xml file against single xml schema (.xsd) file
    In the above code could u tell how to specify the second schema validation code for the incoming xml.
    say i create another Schemadoc for the 2nd xml schema.
    something like this with another parameter(CHAR xsd1) passing to the method
    byte [] docbytes1 = xsd1.getBytes();
    ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
    XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
    DOMParser dp = new DOMParser();
    How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
    How to go about it
    Rgrds
    Sushant

  • {"success":false,"msg":"package file parameter missing"} while trying to upload a package via python

    Hello,
    I try to write a command line script for administrating CQ5 via command line not using curl or wget. When I try to upload a package I get the following error message: {"success":false,"msg":"package file parameter missing"} So what parameter (sure "file") is missing or how do I have to "put it in"?
    To be more precise:
    When using curl, everything works fine, so I looked at the header and body curl sends and rebuilt both via python - without success. And curl does not send a "file" parameter by the way, or I didn't see it.
    Best regards,
    Rene

    For RMA Line. I am assuming you have already created a 'RETURN' type transaction Type, and tied that to the AR transaction type. if yes, then just follow the COPY UTILITY to copy the original line into a RMA line using the Copy Utility as below. Let me know if that was helpful.
    debug_message('Start Copying order..');
    l_copy_rec.api_version_number := 1;
    l_copy_rec.init_msg_list := 'T';
    l_copy_rec.COMMIT := 'T';
    l_copy_rec.Copy_Order := 'T';
    l_copy_rec.hdr_count := 1;
    l_copy_rec.append_to_header_id:= NULL;
    l_copy_rec.hdr_info := 'T';
    l_copy_rec.hdr_type := l_refund_order_type_id;
    l_copy_rec.hdr_descflex := 'T'; -- changed to 'T'; Dipanjan; 03/06/2012
    l_copy_rec.hdr_credit_card_details := 'F';
    l_copy_rec.hdr_scredits := 'T';
    l_copy_rec.hdr_attchmnts := 'T';
    l_copy_rec.hdr_holds := 'F';
    l_copy_rec.manual_order_number:= NULL;
    l_copy_rec.all_lines := 'F';
    l_copy_rec.line_count := l_line_ids.count;
    l_copy_rec.line_type :=&l_refund_line_type_id; -- replace with the 'Return' type transaction type Id
    l_copy_rec.incl_cancelled := 'T';
    l_copy_rec.line_price_mode := 1;
    --l_copy_rec.line_price_date := NULL;
    -- l_copy_rec.line_discount_id := NULL;
    l_copy_rec.line_descflex := 'T';
    l_copy_rec.line_scredits := 'F';
    l_copy_rec.line_attchmnts := 'T';
    l_copy_rec.line_payments := 'T';
    l_copy_rec.return_reason_code := 'WRONG ITEM';
    l_copy_rec.default_null_values:= 'F';
    l_copy_rec.copy_complete_config := 'T';
    l_header_id(1).id1 := &l_orig_header_id;--- replace with original header Id
    Oe_order_copy_util.copy_order( p_copy_rec => l_copy_rec
    ,p_hdr_id_tbl => l_header_id
    ,p_line_id_tbl => l_line_ids
    ,x_header_id => l_query_header_id
    ,x_return_status => l_return_status
    ,x_msg_count => l_msg_count
    ,x_msg_data => l_msg_data);
    debug_message('End Copying order..');

  • Read/write XML via OO4O

    We have some ASP code (Active Server Pages) that uses OO4O to select/insert data in an Oracle 8i rel. 2 database (The OO4O objects are from the same release 8.1.6). Now we would like to enhance it to read and store some XML documents directly (the XML documents are about 10 KB and have nested master/detail like structure).
    Our first idea was to write a stored procedure with a string argument to save the XML document, and to write a stored function also returning a string to retrieve the same data. But it appears that there is a 4KB limitation here (we thought it was a 32 KB limitation, but have only been able to get 4 KB?).
    Then we tried to use the RAW parameter type (although the documentation recommends not to), but this apparently requires the data top be transformed to binary format (the XML is in ISO8859-1 format).
    Have you any suggestions on how to overcome these limitations?
    Or are we simply going in the wrong direction (Is there a better way to use XML via OO4O than with stored procedures)?
    Regards
    Tom Bjerre.
    NB: The stored procedures written in Java look like:
    public static String get_xml(String key) throws SQLException{...}
    public static void set_xml(String key, String xmlStr) throws SQLException{...}
    with call specs of:
    CREATE OR REPLACE PACKAGE TEST AUTHID DEFINER AS
    FUNCTION GET_XML ("key" IN VARCHAR2)
    RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'Test.UtilXML.get_xml(java.lang.String) return java.lang.String';
    PROCEDURE SET_XML ("key" IN VARCHAR2, "xmlStr" IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Test.UtilXML.set_xml(java.lang.String, java.lang.String)';
    END TEST;
    null

    CHAR is limited to 2k.
    VARCHAR2 is limited to 4k.
    You should be using CLOB if you're
    saving XML strings.

  • Can't modify users via commadmin or DA after adding services

    after adding the following services
    Authentication Configuration          
    Instant Messaging Service          
    Presence Service
    i cannot modify users via commadmin (string index error -6) or via the DA (save operation failed) nothing in the slapd logs (error or access) - after removing these services i can modify via the DA.
    is this a known bug (or a feature?).
    after modifying, i can re add the services and proceed as normal.
    thanks,
    s7

    you can try what worked for me:
    remove services from user (in amconsole web app http://jes-server/amconsole) -
    login as admin, search specific user, see their services, remove them -
    run your commadmin command - it should work now
    re-add the removed services.

  • Can not create or modify objects via GUI

    I have installed Oracle SQL Developer version 1.5.1. The option to create/modify tables via the GUI is not available when i right click i get the options to explore directory, notepad, refresh, apply filter, clear filter (grayed), capture table (grayed), capture into existing model (grayed), quick migrate (grayed) and help i have looked aroung the entire workbench and have not found the option to create/modify tables with advanced options via teh GUI. i can create and modify tables if i type in sql commands but do not have the GUI. Is that a separeate adapter you have to install.
    Thanks
    NGM

    Hi NGM
    Could that be related to the user privileges? Please control with another account that can make create/alter table ?
    What are the privileges of your user?
    It works fine for me on the release : Oracle IDE 1.5.1.54.40.
    Try to Check for Updates in the help menu.

  • MSI 6712 (KT4V) : list of ATI AGP HD4* cards compatible (no VIA chipset problems

    I still have an MSI-6712 MB with an AGP ATI 9600XT but need to get a more powerfull card (no money for new MB and all that comes with this).  I had started looking at some AGP ATI HD4* cards but the first one I saw mentioned possible problems with VIA chipsets (dont recall which card). So this made me wonder.  I already have a problem where I cannot go higher the ATI Drivers 8.4 (problems with VIA chipsets) but maybe with a new card, I could pass over that problem. 
    There is no point in looking for AGP Nvidia cards as the strongest I could find was about the same as my ATI 9600XT. SO I am stuck with going for ATI. Also, having Linux partitions, the ATI drivers no longer support less then an HD* card (so does XP).
    I want to know which AGP ATI HD* cards have NO problems AT ALL with an MSI-6712 and all its VIA chipsets.
    I am just tring to get better graphics with my games (some stopped working) at the lowest cost possible until I have a better salary (probably next year).

    X1950 is a powerful AGP card. Still stands ground well. A little power hungry though, and mind you get one with a quiet fan - they can be a bit noisy. Don't know quite, but around 20 Amps on the PSU:s 12 volt line might do, perhaps a little more. Please have a look at the side of your PSU, especially if you are on a budget. - I'm always on a budget, but I'm a clerk sort of. 
    Haven't heard about the VIA comp. problems. Usually there are ways around every obstacle, or climb it for fun. 

Maybe you are looking for

  • How to create multiple backup profiles for 2  disks?

    Before I screw this up, I wanted to check with others here to see if I'm correct with my plan to use 2 disks to create 2 different types of backups. I have 1 external HDD that's always hooked up to my iMac. This HDD is for full machine backups. Howev

  • Three finger navigation stopped working

    The last two days the ability to go backwards and forwards through web pages with a three finger sideways swipe across the trackpad has disappeared. Unclicking and reclicking it in System Prefs doesn't bring it back, nor does restarting Safari. I tri

  • Is it possible to read the backups of my iPod's ipad documents on my win7 computer?

    Is it possible to read the backups of my iPod's ipad documents on my win7 computer? I guess I am looking for a backup document reader/editor And is it possible to remove or add text documents to the ipad's documents without emailing them and cut and

  • Cisco WiMax products and solutions

    Hi, I should need to provide a technical solution to our customer who asks for a WiMax solution to build a wireless campus between a train and  rail station along the railway and also under a tunnel. I am having a look to Cisco solutions but I have s

  • How to synchronized two Timer Task ?

    I need to execute 2 job job1 every sec job2 every min when one task is executing other task should wait so i created 2 timer timer1 will execute secjob every sec timer2 will execute minjob every min and one job object with synchronized execute method