Capture xml payload contents in abap variables

hi,
we have a requirement to capture the xml payload  contents (in srm system) in an abap variable. is there is any API  in abap to achieve this?

If i understand correctly you want to get the XML parsed to some string ?

Similar Messages

  • Special Character Handling (&) in the payload content in PI 7.1

    Hello All,
    My Scenario is Idoc to File. I need to handle some special characters like "&" in  XML payload content in PI 7.1. I am receiving & character in the text field.
    eg:
    <RECORD>
       <BEGDA>20100901</BEGDA>
       <STAT1>A</STAT1>
       <NAME1>Grandview&MO CLMR</NAME1> 
      <PERL_SUB_AREA>0005</PERL_SUB_AREA>
    </RECORD>
    I created java mapping by using the blog: http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420. [original link is broken] [original link is broken] [original link is broken]
    "The code used in java mapping is converting & into &amp"
    Mapping is working fine in the test tab of Operation mapping and the message is successfully handling the record with & character(message with Chequered Flag).In the result tree view,it is showing 
    <PERL_TEXT>Grandview&MO CLMR</PERL_TEXT
    and in the source XML view
    <PERL_TEXT>"Grandview&ampMO CLMR"</PERL_TEXT>
    Issue:
    Now the record is written as
    <RECORD>
      <CUST_STATUS>A</CUST_STATUS>
      <COMPANY>1050</COMPANY>
      <PERL_AREA>1MOB</PERL_AREA>
      <PERL_TEXT>"Grandview&ampMO CLMR"</PERL_TEXT>
      <PERL_SUB_AREA>0005</PERL_SUB_AREA>
    </RECORD>
    Since & is coming as part of text, "it is converting & -> &amp" in the text field and the record is written in the file as
    "A|1050|1MOB|Grandview&ampMO  CLMR|0005 ....."
    While it should come as:
    A|1050|1MOB|Grandview&MO  CLMR|0005 .....
    Java mapping code used is as:
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    public class HandleAmpersand implements StreamTransformation {
         public void setParameter (Map param) { }
         public void execute (InputStream in, OutputStream out) {
              try {
                   int read_data;
                        while ((read_data = in.read() ) != -1) {
                             if (read_data != '&') {
                                  out.write(read_data);
                             } else {                         
                             out.write("&amp;".getBytes());
                        out.flush();
         } catch (Exception e) {  }
    Also, i am using message mapping after java mapping in operation mapping
    Please guide me where it is going wrong.
    Thanks
    Shikha Jain
    Edited by: Jain Shikha on Jan 5, 2011 4:42 AM

    Hi Jain Shikha,
    I have faced similar issue in our production system.
    Our issue:-
    Sender system is sending :- DEKOR " OBS!
    Other middleware is converting it and sending to SAP PI as :- DEKOR &amp ;quot; OBS!
    Because of this, there is increase in size from 12 characters to 21 characters. We were getting error as the target side ABAP table has column width 15.
    Our solution:- Wrote a java mapping to convert &amp;quot; to u201C
    if (strContent.contains("&")) {
                        getTrace().addInfo("& is present");
                        strContent = strContent.replaceAll("&amp ;", "&");
                        strContent = strContent.replaceAll("&quot ;", "\"");
                        strContent = strContent.replaceAll("&apos ;", "\'");
                        strContent = strContent.replaceAll("&amp ;", "&");
                        strContent = strContent.replaceAll("&lt ;", "<");
                        strContent = strContent.replaceAll("&gt ;", ">");
    Note: - quote ("), apostrophe ('), ampersand (&), less than (<), greater than (>) are special characters in XML. They should not be present in data. http://www.w3.org/TR/REC-xml/
    Not Well formed XML:
    <Name>Raghuu2019s</Name>   <Name> Raghu & Vamsee </Name>
    Well formed XML:
    <Name>Raghu&apos;s</Name>   <Name>Raghu &amp; Vamsee</Name>
    Graphical mapping, XSLT, DOM, SAX need well formed XML as input, otherwise they give parser exception.
    Your solution:-
    I understand you are using a graphical mapping. Follow below steps
    Step 1: Convert u201CNot Well formed XMLu201D to u201CWell formed XMLu201D, using java mapping (which your doing already).
    Step 2: Use Graphical mapping for your transformation logic.
    Step 3: Again convert back u201CWell formed XMLu201D to u201CNot Well formed XMLu201D (As this what target system is expecting. Use below java mapping.
    Regards ,
    Raghu
    Edited by: Raghu Vamsee on Jan 6, 2011 1:45 PM
    Edited by: Raghu Vamsee on Jan 6, 2011 1:59 PM

  • Capture XML data payload into database table (Oracle EBS R12)

    Hi All,
    We have a XML Publisher report which generates output in PDF format. We want to capture the XML data payload generated by this report and put it into a DB table once the PDF is generated.
    This report is generated through Oracle EBS R12 and XML Payload is stored by oracle by default in $APPLCSF/out directory.
    Any pointers would be helpful
    br

    Couple of options, this one is probably the easiest without knowing other requirements (e.g., do you have to store the output as XML, or do you just the data available so you can output in XML later?).
    Capture the SQL statement that generates the output in the first place. If you have that statement, you can insert into some table using the select statement. Once you have the report data (and you can tag that particular set of data with a job ID, timestamp, whatever, in case you need to store it and distinguish it from other reports down the road), you can generate XML output using the PL/SQL built-in DBMS_XMLGEN.
    Is that what you are looking for?

  • Getting BAM Error: BAM-06008: The XML payload is invalid; extra contents we

    Hi All,
    Version: 11.1.1.4
    We are getting the BAM Error: "BAM-06008: The XML payload is invalid; extra contents were found" after I added a another field to a BAM Object. I can see the new field in BAM and I can also see it when I pull up and map to a BAM adapter in my SOA composite. However, when I have the process send a payload with the newly added field it fails with the above error. However, if I add a new data object in BAM with the field it works fine. What would be causing BAM to think that the newly added field should be in payload?
    Any suggestions would be greatly appreciated.
    --S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    If the layout of the data object changes then you need to restart BAM server for changes to take effect. Also make sure, your mapper file isn't adding extra elements than expected.
    Thanks
    Jahangir Pasha

  • BAM-06008: The XML payload is invalid; extra contents were found.

    Hi All,
    Version:11.1.1.6
    We are getting the BAM Error: "BAM-06008: The XML payload is invalid; extra contents were found" after I added a another field to a BAM Object.I have added that extra field to corresponding data objects .wsdl file as well as in the .xsd. I can see the new field in the BAM DO. However, when I used to send a payload with the newly added field it fails with the above error. However, if I add a new data object in BAM with the field it works fine.
    Why  am  I getting this error?
    Thanks,
    Rahul

    I have followed the following steps:-
    1.Make entry of new field in ".wsdl" file which is in the BAM folder.
    2.Make entry of new filed in ".xsd" file.
    3.Make appropriate mappings in ".xsl" file corresponding to the sensor's action.
    Initially i was only restarting BAM and was facing above mentioned error. After restarting SOA as well as BAM server, it started working.

  • Problem in accessing an ABAP variable in XML code

    Hi all,
    How do we access an abap variable in an xml code..
    Thanks in advance.

    Durai,
    sorry abt the duplicate post.....
    I am looping the internal table....... i even tried using a workarea......it is still not working.....
    My table is holding the values( Checked it while de-bugging)......but i think its not taking up the values in the XML code........
    I tried out the following.....
    <Point>
    <Value type="x"> <%= workarea-field > </Value>
    <Value type="y"> <%= workarea-field > </Value>
    </Point>
    But its not working................Is my syntax right......
    null

  • Enhancement Fields missing in the Inbound XML payload

    We are using XI3.0. We need to send some Purchase Order data from R/3 to SRM(SUS), in addition to what is available in the standard content. We have created the required datatype enhnacement. we have mapped these additional fields in the message mapping to their respective sources. We have also generated and activated the ABAP proxies on the SUS side. However at runtime whenever a PO is created, none of the additional fields are available in the inbound XML payload.
    Can some one help me to know what could be wrong ?
    Thanking You
    Regards
    Vinay Rane

    Hi Vinay,
    You can try one of the following options:
    1) Clear/reload XI cache using trx SXI_CACHE, after that try to test again and check whether you are getting the correct fields.
    2) Are you using the RFC adapter? if you do; then try to restart it. This adapter also caches a lot of meta data and information during runtime.
    3) Last but not least; (You probably know this better than me , but just in case...) If you had previously generated the proxy classes, and after that you did some changes in the repository then you certainly will need to regenerate those proxy classes.
    Cheers,
    R.

  • Table for XI (PI) message payload content?

    Hello Colleagues,
    I need to know in what table I am able to find the Payload what is displayed normally under SXMB_MONI for different message processing over XI.
    We need to archive (only) payload content for special interfaces in a usefully way.
    Many thanks in advance!
    Regards,
    Jochen

    Hi Sudhir,
    Many thanks for the providing informations.
    During my investigation I found similar information.
    So, I afraid too that where is no easy way for export message payload.
    Maybe the XML Data Archiving process could be here an answer but i haven't try it before.
    Documented at "XML Data Archiving: Configuration Guide for ABAP Applications".
    Many thanks for support Sudhir!
    Regards,
    Jochen

  • How to separate XML element content

    Hi All,
    How can i separate XML element content in to two strings, where each string will be copied into new variables.
    For ex:
    The input I get is
    <XmLElement>C:/documents/sharedFiles/apple.pdf</XMLElement>
    now I want to break the content into two parts like
    <aaaa>C:/documents/sharedFiles/</aaaaa>
    <bbbbb>apple.pdf</bbbbbb> ( I want to separate file name from the string)
    and now I want to copy this into two other variables. How can I achieve this in BPEL. Appreciate your help.
    Thanks,
    Edited by: kameshb on Mar 25, 2013 11:16 AM

    I am getting the following error
    <bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is substring(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),1, oraext:last-index-within-string(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),'/') -1) . The XPath expression failed to execute; the reason was: internal xpath error. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>
    This is the code inside XPATH
    <assign name="BreakURL">
    <copy>
    <from expression="substring(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),1, oraext:last-index-within-string(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),'/') -1) "/>
    <to variable="outputVariable" part="payload"
    query="/ns1:Toutput/ns1:Location"/>
    </copy>
    <copy>
    <from expression="substring(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),1, oraext:last-index-within-string(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),'/'),) "/>
    <to variable="outputVariable" part="payload"
    query="/ns1:Toutput/ns1:Filename"/>
    </copy>
    </assign>

  • In PI how do I convert the XML payload (input) to a text file and send out

    I am extracting data from SAP and sending thru XI / PI to a file (non-sap system).
    On the receiving end, I need the file to be a text file, with one row for each "FTZ_Row concatenated_data" tag in the input.  It needs to be just a plain text file with no XML tags.
    Currently the file gets one record which matches exactly to the XML payload below.
    I want it to create a file that looks like this :
               CONCATENATED DATA 1
               CONCATENATED DATA 2
                012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12
    here is the payload going thru XI
      <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
      <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
      <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
      <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
      </n0:FTZ_Concatenated_Row>
    thanks
    jay

    thanks for the input but I am still having issues - I get an empty file when I use the content conversion option.
    My payload coming into XI is :
            <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
    <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
    <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
    </n0:FTZ_Concatenated_Row>
    Here is the layout of my data type - I am using the same for input & output
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" targetNamespace="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone">
       <xsd:complexType name="FTZ_Concatenated_Row">
          <xsd:sequence>
             <xsd:element name="FTZ_Row" maxOccurs="unbounded">
                <xsd:complexType>
                   <xsd:attribute name="concatenated_data" type="xsd:string" />
                </xsd:complexType>
             </xsd:element>
          </xsd:sequence>
       </xsd:complexType>
    </xsd:schema>
    I mapped these items :  FTZ_Concatenated_Row & FTZ_Row & concatenated_data
    I set up my content convesion with :
      recordset structure   FTZ_Row
    FTZ_Row.fieldSeparator     #
    FTZ_Row.endSeparator     'nl'
    I am not sure why the following row looks like this ??
        <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    I thought FTZ_Row would be one tag and "concatenated_data" would be another one.
    any help would be appreciated.
    I have read many entries/blogs/etc in SDN but and tried many different setups, but nothing is working.
    thanks

  • How to assign Javascript variable to ABAP variable

    Hi All,
    I have a requirement to create a page where each of the table cells will have drop down boxes with Red, Yellow and Green colors.
    When the user selects the color it has to be saved to database.
    Now the problem is, I'm using HTML as HTMLB was very complicated for the kind of layout the client needed.
    I have created a onChange event for each of these drop down boxes (please keep in mind the dropdown ids are dynamically created by looping the ABAP internal table).
    I'm passing this.id on change event and capturing the id name. Now using this id I have to read an internal table.
    But the problem is, this is javascript variable and cannot be passed directly to read table statement.
    Please help me in this regard.
    Lots of points will be given for valuable inputs.
    PS: I have gone through the thread Assign a Javascript variable value to a ABAP variable
    But doesn't seem to work for my case as I'm using HTML.

    Hi Chait,
    you need to populate a HTML form field with the variable. Most commonly people use the...
    <INPUT type="hidden" id="param1">
    construct.
    In your javascript you can then just set the value of param1.
    Of course you could also dynamically create the elements at runtime in your javascript code.
    Cheers
    Graham Robbo

  • XML payload search in Xi messages

    Hi All,
    I need to get the XML pay load for a message which contains a specific value for a specific field. Also I need to get the XML message ID of this message. Is there any option available in Xi for this purpose?
    Thanks in advance..

    Hi,
    sure it is but you need to use trex search engine for that
    http://help.sap.com/saphelp_nw04/helpdata/en/43/6030fae92f5f87e10000000a1553f6/content.htm
    once you configure trex you will
    be able to search for XML payload from RWB
    (runtime workbench of XI)
    this is the first - fast way
    there are also some non standard ways
    but these are pretty slow and if you have many messages
    they will not be very efficient in use:
    /people/alessandro.guarneri/blog/2006/02/14/super-message-monitor-for-sap-xi
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • XML Payload extraction from XI Message

    Hi to all,
    I use the SXI_MONITOR transaction to see the XML Payload of XI Messages. In this transaction, each successfully message has a field "MainDocument" under "Response" section that contains the XML Payload of the message.
    <B>There is a function module that I can use to extract the XML from MainDocument field?</B> I've tryed to look into SXMSCLUP and SXMSCLUR abap data tables but here I founded only the SOAP Header and SOAP Body data of the message. Here I can't see the "Payloads" data, so the MainDocument tag.
    Can anyone help me?
    Thanks!

    Ciao Gabriele,
    there are differente way to do it.
    one time I got same issue and I got some answer on the community.
    Unfortunately there was no more need for it so i did not implement but
    easily speaking in all the mapping got the payload therefore u need just to create a full mapping adn to process the data u get.
    In java for example is given as input stream that u can store some where and process.
    I pasted the result below:
    IN java
    How to get the whole payload
    in abap
    /people/udo.martens/blog/2006/02/16/own-logging-of-xi-messages
    please rewars point is useful thanks.
    regards,
    Giamma

  • XML Payload to Transaction Input

    Hi,
    For clarification, used to be (and still appears to be) that for transaction input properties, data type needed to be 'simple' (ie: string etc), and although we can have transaction input properties of type XML, they still appear in the WSDL as string.  Although I can see that this works fine even if the string content is actually XML, and the inbound data (which in fact is XML as a string) still looks like XML in the transaction, is this still the recommended approach?  Or is there another recommended way to get an XML payload passed in to a transaction using Runner / SOAPRunner from an external application.
    Additionally, when calling the Runner (or SOAPRunner) from an external application, is there then any limit to the length of the URI call?  I know that browsers have limits on the path, but here we're playing with a path + query string outside of browsers? 
    Are there any limitations on the Netweaver side?
    By the way, currently using MII V12.2.2
    Regards
    Kevin.

    Hi Kevin,
    You can pass XML as string to a transaction and make input parameter as XML in transaction.
    That is perfectly fine.
    As far as I know about the limit of URL, It depends on the server.
    However there are two methods to call a http webservice. GET and POST.
    Use the POST method which is having more limit than GET method. I have faced issue with GET on high volume of data so replaced it with POST method. I have used the url with query parameters of a few MB's (approx 4-5) and never faced the limit issue with POST. You can check exact limit with some load testing on the server.
    Thanks
    Anshul

  • How to create an xml from xsd in abap

    HI Experts,
       i want to create an xml file from xsd and i want to validate an xml file against an xds.is this possible in abap.if it is possible can any one give me an sample code
    for this one.
    how to create an xml file in abap.i have seen so many blogs which parses the xml file but i didn't get blog for creating an xml file.how can we do that one.
    any suggestions will be appriciated
    thanks in advance
    With Regards
    Naidu

    HI
    GOOD
    IT IS POSSIBLE IN ABAP
    Extensible Markup Language (XML) is a simple, very flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere.
    XSD->
    XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content and semantics of XML documents. in more detail.
    XDS->
    XDS can process data images from CCD-, imaging-plate, and multiwire-detectors in a variety of formats. Detector specific Input file templates greatly simplify the use of XDS; they are provided as part of the documentation.
    XDS runs under Unix or Linux on a single server or a grid of up to 99 machines of the same type managed by the MOSIX system; in addition, by using OpenMP, it can be executed in parallel on up to 32 processors at each node that share the same address space.
    http://www2.stylusstudio.com/SSDN/default.asp?action=9&fid=23&read=2926
    /people/r.eijpe/blog/2006/02/19/xml-dom-processing-in-abap-part-iiia150-xml-dom-within-sap-xi-abap-mapping
    THANKS
    MRUTYUN

Maybe you are looking for

  • Do we need separate Apple ID's?

    The details: Our family has 1 Mac desktop which has all our ITunes content under 1 Apple ID Wife has iPod touch Husband has iPod touch, but he set it up with a new ID Daughter has iPad currently using same iTunes Apple ID Son has Nano Apple TV-1st ge

  • I need to re-install iCloud on my windows 8.1 64 bit.

    I keep getting a message that local files can not by synced or something to that effect and to re-install iCloud. I found iCloud 3.1 but that is only for a 32 bit installation according to the installation error message. I followed the link that was

  • Fonts Not Compatible with Windows 8

    We've had some problems with fonts not working in Windows 8. Are all OTF available via Adobe Type campatible? The files we're having problems with have the extension of .PFB. They are visble via c:Windows/Fonts but do not work in our applications.

  • Where do deleted bookmarks go?

    I deleted a bunch of bookmarks but wanted them back later. But once they are gone they are gone correct? you can't go into trash and get them, right?

  • Premiere Elements 10 has stopped recording narrative.

    I have used Premiere Elements 10 to make a number of home videos on my 2013 Dell XPS 8500.  Never had a problem.  This time I am unable to record/insert Narrative into the Narrative Track.  The program recognizes the mic (which I have always used).