XML Header information

Mark, when i try to generate the xml from the database using XMLELEMENTS , i do not get the header information like.
<?xml version="1.0" encoding="ISO-8859-1"?>
And this becomeas aproblem to the parser which reads the files generated from my system.
Is there anything i am missing.
So as a workaround i pad the string with the select statements.
here the the select statement for reference.
SELECT Orderid,
'<?xml version="1.0" encoding="ISO-8859-1"?>'||XMLELEMENT("MEPInputData"
, XMLAttributes
'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"
,'InputOrder.xsd' AS "xsi:noNamespaceSchemaLocation"
, model AS "Model"
, '1.0' AS "Version"
,XMLELEMENT
("XMLInputOrder"
,XMLELEMENT("OrderID", OrderID)
,XMLELEMENT("TimeStampInputOrder", TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS'))
,XMLELEMENT("TimeStampInputOrderText", TO_CHAR(SYSDATE, 'DD.MM.YYYY HH24.MI.SS'))
,XMLELEMENT
("ResultOutPut"
,XMLELEMENT("NameResultFile", 'Result_'||OrderID||'.xml')
,XMLELEMENT("DirectoryResultFile", 'X:\Moehwald\PrismaNT\DSShare')
,XMLELEMENT
("UsedDatas"
,XMLELEMENT
("UsedData", XMLAttributes('Typdata' AS "UsedDataType")
, XMLELEMENT("UsedInpDatum"
,XMLAttributes
'Typdata' AS "Typ"
,typ_version AS "Version"
,typ_LastTimeStamp AS "LastTimeStamp"
), TYPEDATA
,XMLELEMENT
("UsedData", XMLAttributes('Sequdata' AS "UsedDataType")
, XMLELEMENT("UsedInpDatum"
,XMLAttributes
'Sequdata' AS "Typ"
,seq_version AS "Version"
,seq_LastTimeStamp AS "LastTimeStamp"
), ABLAUFDATA
,XMLELEMENT
("UsedData", XMLAttributes('RegistryKonfig' AS "UsedDataType")
, XMLELEMENT("UsedInpDatum"
,XMLAttributes
'RegistryKonfig' AS "Typ"
,NULL AS "Version"
,NULL AS "LastTimeStamp"
), REGISTRYKONFIG
).GetStringVal() AS "INPUTORDERXML"
FROM VW_XMLInputOrder
Thanks

Nope you not missing anything, we are. There is a new SQL/XML operator XMLROOT scheduled for a future release of the database that will generate this. In the mean time the only 'work-around' I know of is
XMLType('XML prolog' || xmlelement(....).getClobVal())
This will work with small documents, but not with larger documents....
I've used something like this when I've needed to. Note XMLParse is only available in 10.x.
create or replace function XMLROOT (XML XMLType,
PI varchar2 default NULL)
return XMLType deterministic
is
tempCLOB clob;
tempXML XMLtype;
begin
select xmlparse(DOCUMENT '<?xml version="1.0" encoding="UTF-8"?>' || PI || XML.getClobVal() WELLFORMED)
into tempXML
from dual;
return tempXML;
end;
xmlparse is simply a more efficeint way of creating a Non Schema based XMLType from the 'XMLText'. On a Pre 10x database you could substiture XMLType for XMLParse.

Similar Messages

  • Header information not getting displayed in the lines

    Hello Everyone
    I have a very basic question - its very simple but not working for me with so many attempts
    My XML structure looks like this . In the RTF , I have header information and then a table for line information looping through G_LINES.
    IN this lines table I need the SHIP_CUSTOMER_ID of the header to be displayed. I have tried all options like <?../SHIP_CUSTOMER_ID?> or <?../G_ORDERS/SHIP_CUSTOMER_ID?> , however nothing seems to be working and I am not getting the field to be displayed. Can someone please help?
    XML structure is as follows:
    <XXSTOL_29251_PICK_TKT>
    <LIST_G_ORDERS>
    <G_ORDERS>
    <CUSTOMER_NUMBER>1411</CUSTOMER_NUMBER>
    <SHIPPING_INSTRUCTIONS1></SHIPPING_INSTRUCTIONS1>
    <SHIP_CUSTOMER_ID>256</SHIP_CUSTOMER_ID>
    <G_LINES>
    </G_LINES>
    <G_LINES>
    </G_LINES>
    </G_ORDERS
    </LIST_G_ORDERS>
    </XXSTOL_29251_PICK_TKT>

    Are you grouping within G_LINES? If so, use ../../SHIP_CUSTOMER_ID
    or send me the xml and RTF template to [email protected] so that I can get a better look at the data structure and try to help.
    Thanks,
    Bipuser

  • How can I include the Header Information....for a File to IDOC Scenario

    Hi,
    I made a File to IDOC Scenario with DEBMDM06 for MDM>XI>SAP R/3. The Header Information in the XML File which is at the XI end is Missing. For that reason In Tcode SXMB_MONI we are getting an Error that <b>"HEADER Information Missing: Message should Start with EDI_DC40"</b> i.e the Header Information.
      My Question is that whether we can do some changes in the Message mapping Step in the Integration Repository. I HardCoded the Few mandatory Fields that were there but it Again gave me the Same Error as above.
    Can you please Suggest some Solution for this. Since the data is Coming in from MDM part the Header information is not there but It actually Important as it has got all the Port Information.
      Kindly Inform me some Solutions.
    Thanks & Regards
    Somnath

    Hi Suraj,
      Thanks for ur Reply, but Since we are Doing a File to IDOC Scenario the IDOC DEBMDM is on the Right Side in Message Mapping and as U know it is Mandatory to Map an IDOC on the Right Part. EDI_DC40 is coming as it is there in the IDOC but our XML File Does not have that. If we Don't Map then it Becomes RED, which is an Error.
      Furthermore in the Receiver Agreement we have put the Necessary Details such as Sender Service and Receiver Service along with the IDOC Communication Channels.
      Can U give as a Better Insight on this Note how to check the Header Part as it is mandatory to MAP.We also tried to HARDCODE it by putting those Values and Mapping them to a Constant but it is Giving the Same Error.
    Thanks and Regards
    Somnath

  • Xml header in transformation strans

    Hello,
    I would like to create an xml file with the following header information:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <tem:mygesttem>
    <tem:mytem>
    So, I have created the following piece of code in transaction STRANS:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
    <tt:root name="ROOT"/>
    <tt:template>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <tem:mygestem>
    <tem:mytem>
    However, as soon as I launch it with CALL TRANSFORMATION in my ABAP program the xml file is different from I would expect:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
    <tem:mygestem xmlns="http://tempuri.org/">
    <tem:mytem>
    Could anyone tell me why the header is different from expected?
    Thank you,
    Oscar

    Any ideas? please.

  • Accessing SOAP header information in a custom adaptor module

    Hi Guys,
    Could anyone point me in the direction of information on how to access the SOAP:Header element when writing a custom adaptor module for a http/ SOAP communication channel?
    I'm trying to add some WS-Security stuff which isn't available in XI 3.0.
    Many thanks,
    John

    The solution is as follows:
    Mark as Do Not Use SOAPEnvelope in the communication channel.
    It may be possible to use the SAP implementation of MessageFactory, SOAPEnvelope etc., I forced XI the Apache Axis implementation, a thread on which can be found here Link: [Accessing SOAP header information in a custom adaptor module;
    The SOAP Envelope is created by
    javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
    This doesn't work it creates a com.sap.engine.services.webservices.jaxm.soap.SOAPMessageImpl
    org.apache.axis.message.SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
    org.apache.axis.Message iSoapMessage = new org.apache.axis.Message(env);
    SOAPMessage sm = iSoapMessage;
    SOAPBody iBody = se.getBody();
    if(iBody!=null)
         iBody.addDocument(iDoc);
         addDocument failed for some reason when called in XI returning
         Exception caught by adapter framework: Exception in method process.
         The code below is copied straight from the addDocument method, but it works.
         org.w3c.dom.Element iDocRoot= iDoc.getDocumentElement();
         org.apache.axis.message.SOAPBodyElement bodyElement = new org.apache.axis.message.SOAPBodyElement(iDocRoot);
         iBody.addChildElement(bodyElement);
    In order to get a document representation of the Envelope you can use
    Document iEnvelopeDoc = ((org.apache.axis.message.SOAPEnvelope)env).getAsDocument();
    You are now in a position to add or adjust the SOAP Envelope as your require. It enabled me to add WS-Security information to a message.
    It is normally possible to use javax.xml.transform.Transformer on the various classes SOAPEnvelope, SOAPBody etc. as they implement Node. However doing this in XI caused a crash.
    The final document can be then be set in the xmlPayload before being sent out the door.
    Hope this helps someone,
    John

  • Extension of Standard SOAP Header Information in SOAP Adapter

    We are currently trying to call an eBay Web Service via SAP XI and we are using the SOAP Adapter in XI to achieve this.
    The following Authentication Information is required in the SOAP Header for accessing the eBay Web Service:
    - Token
    - ApplicationID
    - DevelopmentID
    - CertificationID.
    Unfortunately, the standard SOAP Adapter supports only certain SOAP Header Information (like User Authentication or Certificate Authentication).
    Is it possible to extend the SOAP Header Information in the SOAP Adapter (or somewhere else in XI) beyond the standard configurations?
    Thanks for your support.
    Alexander Bange

    Hi Jin,
    thanks for your input and sorry for my late reply but I wanted to wait for feedback from SAP who actually confirmed your recommendation.
    I had a second thought about this and it came to my mind that I actually don't want to extend the SOAP Header elements but simply fill the mentioned authentication elements with values. This cannot be done in the message mapping as only the SOAP body elements (i.e. the payload) can be mapped.
    Do you know if and how I can fill the SOAP header elements with values in XI?
    I already tried to include this information as fixed values in the WSDL description and load it into XI. Then I looked into the WSDL description and an error message occured stating that XI could not parse the XML Document (Fatal Error: com.sap.engine.lib.xml.parser.ParserException:  = expected in attlist(:main:, row:18074, col:54)).
    If there is no solution for the latter, I will have to try nosoap solution. Still this would be a little awkward.
    Thanks again for your valuable support.
    Best Regards.
    Alex

  • Encoding missing from XML header

    I have to manipulate an XML document. Using Java 1.4.1, I build a Document object based on the XML file, manipulate the Document and output it as attached below.
    The problem is that the xml header in the output does not contain the "encoding" information. I could of course manipulate the output afterwards, but it would not be a neat solution. Any ideas?
    DOMSource domSource = new DOMSource(document);
      StreamResult streamResult = new StreamResult(
           new OutputStreamWriter(System.out , java.nio.charset.Charset.forName("UTF-8"))
      TransformerFactory tf = TransformerFactory.newInstance();
      Transformer serializer = tf.newTransformer();
      serializer.transform(domSource, streamResult);

    When you serialize your output to a Writer, the parser has no way to tell what encoding the Writer uses, so it's up to you to ensure that the parser knows what encoding the Writer is using. Otherwise it will not specify any encoding, essentially assuming the Writer is using either UTF-8 or UTF-16 encodings.
    In your case you don't have a problem, because "no encoding" means that the document is encoded in UTF-8 or UTF-16; it's easy for a parser to examine the first few bytes of the file and tell which it is. Yours is encoded in UTF-8, so it's correct.

  • SOAP header information [continued]

    Dear,
    It all started here Get SOAP header information
    The fact is that I get the WSDL delivered and I need to upload that into the ESR.
    Next step is to create/generate a Service Interface.
    What I see in the WSDL binding
    After I generated a Service Interface
    Where is my SOAP header part? It seems to be gone in the Service interface?
    I tried this for both SOAP 1.1 and 1.2. Both the same phenomenon.
    Any suggestions?
    Thanks a lot
    Kind regards, Dimitri

    Hello Dimitri,
    Have you got any solution of the issue ?
    I think William's blog answer's that :
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/07/30/how-to-read-soap-header-information
    However, It suggests to modify XML structure for sender interface as well. By doing so , it gives other challenge as described below :
    If we modify the message structure , it changes the WSDL as well and generating request message something like below :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aif="urn://transport.nsw.gov.au/test/poc/aif">
      <soapenv:Header/>
      <soapenv:Body>
          <aif:Envelope>   <------- Added by Modifying the structure
             <Header>
                <FileType>?</FileType>
             </Header>
             <Body>
                <BusinessPartner>
                   <!--Optional:-->
    How can we use  "Do not use SOAP Envelop" feature without modifying the WSDL structure?
    If we don't modify the message structure , it is failing to identify the receiver and also we would not be able to see the fields while doing graphical mapping.
    Let me know if you got any other alternative.
    Thanks & Regards,
    Dijesh Tanna

  • ERROR:XRFC-Document has no valid From-header information

    Hi,
    I am trying to invoke a business connector service using RFC-XML document.
         This service invokes one rfc which stores data in the SAP table.
        But while executing this service with RFC-XML i got error as "com.wm.pkg.sap.BCException: com.sap.aii.af.ra.ms.api.PayloadFormatException: XRFC-Document has no valid From-header information".
    Could you please resolve my problem?

    Shweta
    Can you check the url:
    Re: InterfaceNamespace in the Business Connector envelope
    ---Mohan

  • Header Information Repeating in the Same Page

    Hi Buddies,
    I have an issue with PO Print Report. I am trying to reapet the header information by using <?start:body?> after the header informaiton and <?end body?> before the footer informaiton.
    If i have two different headers, it displayed in the same page. For e.g I have po header details for PO 30124 and PO 30124-1. These two headers information displaying in all the pages and main body and footer informations goes to the next page.
    pls guide me how to solve this one?
    Regards
    Prabu

    Hi,
    Are you saying that you need conditional headers? If so, then use <?IF ...> statements.
    If your footer is not working correctly make sure your syntax is correct?
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Error says: Warning: Cannot modify header information

    I keep receiving an error message after my form is sent (the form still send the information I need just wont re-direct to the next page)
    It redirects to a page that says:
    Warning: Cannot modify header information - headers already sent by (output started at /home/tommyle/public_html/newp.php:10) in /home/tommyle/public_html/newp.php on line 41
    my php code looks like this:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Tommy Lemonade Beta</title>
    <link href="style1.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <?php
    /* Set e-mail recipient */
    $myemail = "profiles@tommylemonade";
    /* Check all form inputs using check_input function */
    $name = check_input($_POST['name'], "Enter your name");
    $subject = check_input($_POST['subject'], "Enter a subject");
    $email = check_input($_POST['email']);
    $message = check_input($_POST['message'], "Write your message");
    /* If e-mail is not valid show error message */
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
    show_error("E-mail address not valid");
    /* Let's prepare the message for the e-mail */
    $message = "
    Name: $name
    E-mail: $email
    Subject: $subject
    Message:
    $message
    /* Send the message using mail() function */
    mail($myemail, $subject, $message);
    /* Redirect visitor to the thank you page */
    header('Location: thanks.html');
    exit();
    /* Functions we used */
    function check_input($data, $problem='')
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    if ($problem && strlen($data) == 0)
    show_error($problem);
    return $data;
    function show_error($myError)
    ?>
    <html>
    <body>
    <p>Please correct the following error:</p>
    <strong><?php echo $myError; ?></strong>
    <p>Hit the back button and try again</p>
    </body>
    </html>
    <?php
    exit();
    ?>
    </body>
    </html>
    This is line 41:
    header('Location: thanks.html');
    Can anybody see what I'm missing?

    Yeah, rework the code so you don't get any output before the php code is executed (like below):
    <?php
    /* Set e-mail recipient */
    $myemail = "profiles@tommylemonade";
    /* Check all form inputs using check_input function */
    $name = check_input($_POST['name'], "Enter your name");
    $subject = check_input($_POST['subject'], "Enter a subject");
    $email = check_input($_POST['email']);
    $message = check_input($_POST['message'], "Write your message");
    /* If e-mail is not valid show error message */
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
    show_error("E-mail address not valid");
    /* Let's prepare the message for the e-mail */
    $message = "
    Name: $name
    E-mail: $email
    Subject: $subject
    Message: $message
    /* Send the message using mail() function */
    mail($myemail, $subject, $message);
    /* Redirect visitor to the thank you page */
    header('Location: thanks.html');
    exit();
    /* Functions we used */
    function check_input($data, $problem='')
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    if ($problem && strlen($data) == 0)
    show_error($problem);
    return $data;
    function show_error($myError)
    ?>
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Tommy Lemonade Beta</title>
    <link href="style1.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <p>Please correct the following error:</p>
    <strong><?php echo $myError; ?></strong>
    <p>Hit the back button and try again</p>
    </body>
    </html>
    <?php
    exit();
    ?>

  • Create a new line in the xml-header structure.

    Hi,
    Can any one tell me how to create a new line in the xml-header structure.
    I am doing a IDOC-XI-HTTP scenario.
    Actually my mapping create this file:
    <b><?xml version="1.0" encoding="utf-8"?>
    <ORDERS05>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1"> </b>
    The result must look like this.
    <b><?xml version="1.0" encoding="utf-8"?>
    <ORDERS05>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1"> </b>
    Thanks and Regards,
    Eren

    Hi,
    thanks for you quick answer.
    I found a xsl script.
    It works fine.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes"/>
       <xsl:template match="*">
          <xsl:param name="depth">0</xsl:param>
          <!-- New line with indenting. -->
          <xsl:if test="$depth > 0">
             <xsl:text>    </xsl:text>
          </xsl:if>
          <xsl:text>&#xA;</xsl:text>
          <xsl:element name="{name(.)}">
             <xsl:for-each select="@*">
                <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
             </xsl:for-each>
             <xsl:apply-templates>
                <xsl:with-param name="depth" select="$depth + 1"/>
             </xsl:apply-templates>
          </xsl:element>
       </xsl:template>
    </xsl:stylesheet>
    Best regards
    Eren

  • Missing header information on a pdf image?

    How do I ensure the header information is on my pdf image

    I'm not aware of any apps that edit PDF documents. Many that let you edit word documents, but unfortunately, not PDF's.

  • Header information not displaying in ABAP Webdynpro record working time

    1. I am not seeing the header information, personnel number, name, cost center, on the ABAP Webdynpro record working time timesheet. When I run the timesheet profile in CAT2 the header contains the personnel number, name, cost center, but these do not display when the ABAP Webdynpro timesheet is run
    2. Is there a version of the ABAP webdynpro timesheet that prompts for the personnel number, date and profile prior to executing the timesheet?  I want to define an ESS link for managers to update timesheets of individual teammates.  The teammate do not necessarily have to be their direct reports

    Hi David,
    CATS Webdynpro application is a OIF fpm. Please check if you have performed the FPM IDR configuration properly.
    In standard, the ESS CATS does not prompt for the personnel number except in CE scenario. In MSS addon, you have an option to launch the ESS CATS application on-behalf of the employee. Please refer to the sap library documentation.
    Hope this helps,
    Regards,
    Roy

  • Work order header information from BAPI_ALM_ORDERHEAD_GET_LIST

    Upfront I'll admit that this question likely falls outside of MII as I am getting bad results in SE37 as well.  Was hoping others in this group have experience with this.
    When I use BAPI_ALM_ORDERHEAD_GET_LIST there are several work orders that do not get returned, and I can't figure out why, or even what is the common thread between them.  The missing orders are viewable via iw33, and information can also be returned from BAPI_ALM_ORDER_GET_DETAIL.
    Right now, the only thing I pass in OPTIONS_FOR_ORDERID with a range of orders (ie 20 or so).  Orders are returned in the correct range, just not the one I am looking for.
    Rod

    Hi Rod,
    The only thing I can think of is that there are times where orders (or other objects) are created outside of normal procedures.  My experience was with Batch histories, but if the objects are not created in the normal process (a nebulous term at best), they will sometimes not be stored in all the proper tables.  Can you check the processing history of the orders missing to see if there are any discrepancies there? 
    Otherwise, you may need to get some ECC side help.  The ABAP code in the underlying function module may direct you to all the tables which should be populated with the correct data so you can check which tables are not populated. 
    An alternative option for getting the work order header information would be to go back to the old reliable RFC_READ_TABLE.
    Good luck,
    Mike
    Edited by: Michael Appleby on Feb 12, 2011 4:13 PM

Maybe you are looking for

  • Delivery and Goods Receipt without goods value

    Hi! this is my first post in this forum, hi everybody Now the question: My goal: warehouse manager shouldn't see goods value (prices) of purchased material and final products (sold goods). That means I would like to remove all value data (Unit Price,

  • Can i make an external button to power up the computer using wake up on lan?

    With the feature of Wake up on Lan I am assuming that the computer can be shutdown completly but via wake up on Lan? If this is the case I have my mac pro hidden from sight but obviously need to turn the computer still. I do not want to use the Sleep

  • Photoshop CS crashes when opening some files

    Occasionally, I run into an image file where Photoshop CS "unexpectedly quits" when I try to open that file. What could be causing this? I load the file from a CD, composed of images I've scanned and burned on the CD. Only one or two files (so far) h

  • Unexpected severe error has occured in Jdeveloper

    Hello everyone, today i installed Oracle Jdeveloper 11.1.1.7. I tested o create some Java & HTML Applications and it worked.  After i had installed the BPM-Studio Extension,i tested the creation of BPM-Projects. Every creation of a BPM-Process was fo

  • Error in configuration b/w database application table comnnector and OIMg11

    Hi Gurus, I am getting following error while configuring database application table connector for reconcillation with OIMg11. Any idea what might be the issue here, I have searched the forums and tried the possible solutions mentioned there. Caused B