Raise error in an external-function of XSLT-mapping (ABAP)

Hi,
we implemented a xslt-mapping (ABAP) in PI with external-functions.
It's a great feature and works fine.
Now, we have to implement an error handling:
The external-functions are reading data from an abap table. We have to stop the mapping (if a value in the table is missing).
We wanna show an error inside the PI-Monitoring (red flag) with a valid error text.
How can I raise an error inside an external-function?
regards
Wolfgang Hummel

Hi Michal,
thanks a lot for your answer.
Can I set dynamic configuration inside an external funktion of an ABAP-XSLT?
I added the CX_MAPPING_FAULT-Exception to my external-function method and raised an exception inside my external-funktion ... and I got an "UNCAUGHT_EXCEPTION" inside my mapping - bad
regards
Wolfgang

Similar Messages

  • What are the Built-In-Functions in XSLT mapping?

    what are the Built-In-Functions in XSLT mapping?

    hi praveen
    check the below blogs
    XSLT MAPPING                                   
    Step u2013 By u2013 Step Simple Approach for XSLT Mapping                                   
    Step – By – Step Simple Approach for XSLT Mapping                                   
    XSLT mapping for multiple segments of XML                                   
    XSLT mapping for multiple segments of XML                                   
    IF - ELSE IF and XSLT - A Better work around ?                                   
    IF - ELSE IF and XSLT - A Better work around ?                                   
    Calling instance (object) method of ABAP Class into xslt mapping by using SAP: CALL-EXTERNAL                                             
    Calling instance (object) method of ABAP Class into xslt mapping by using SAP: CALL-EXTERNAL                                             
    xpath functions in xslt mapping                                             
    xpath functions in xslt mapping                                             
    Using XSLT Mapping within the J2EE Adapter Framework                                             
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken]                                             
    EDIFACT to XML - Stylus Studio Solution                                             
    EDIFACT to XML - Stylus Studio Solution                                             
    Running NetWeaver's XSLT processor from XMLSpy                                             
    Running NetWeaver's XSLT processor from XMLSpy                                             
    generic xslt mapping part 1                                             
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1                                             
    generic xslt mapping part 1          part2                                   
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a                                             
    xslt recursive templates                                             
    XSLT: Recursive Templates                                             
    Generating Generic XML / HTML files without using XSLT Mappings                                                       
    Generating Generic XML / HTML files without using XSLT Mappings                                                       
    regards
    kummari

  • How to call external java functions in XSLT Mapping Programs

    Hi All,
    I am unable to call java programs in XSLT MAPPING.
    I tried by following the blog...but getting error :
    XSLT Mapping With JAVA Enhancement ( For Beginners)
    I need some input from you all.
    Waiting For quick reply.
    Rgds Somu.

    i wrote the code...
    and getting error in interface mapping..
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:MyLib="java:datetime.DateandTime">
         <xsl:template match="/">
              <Order DocType="OrderCreate" Version="2.0.2">
                   <Header>
                        <RequestingDocumentIdentifier>
                             <DocumentIdentifier>
                                  <xsl:value-of select="concat('IDOC',//EDI_DC40/DOCNUM)"/>
                             </DocumentIdentifier>
                        </RequestingDocumentIdentifier>
                        <RequestingDocumentDateTime>
                             <DateTime DateTimeQualifier="On">
                                            <xsl:if test="function-available('MyLib:getDateValue')">
                       <xsl:value-of select="MyLib:getDateValue()"/>                   
      </xsl:if>
                                        </DateTime>
                        </RequestingDocumentDateTime>
                        <From>
                             <PartnerInformation>
                                   <PartnerName>BASF SA</PartnerName>
                                    <PartnerIdentifier Agency="AssignedByBASF">
                                     <xsl:value-of select="//E1EDK14[QUALF='014']/ORGID"/>
                                    </PartnerIdentifier>
                             </PartnerInformation>
                        </From>
                        <To>
                        <PartnerInformation>
                             <PartnerName>BASF CORP CHEM DIV</PartnerName>
                             <PartnerIdentifier Agency="D-U-N-S">001307032</PartnerIdentifier>
                        </PartnerInformation>
                   </To>
                   </Header>
              </Order>
         </xsl:template>
    </xsl:stylesheet>

  • Using sap:external-function in XSLT

    In the definition of sap:external-function I don't see any way of specifying the target system. Does this mean that the system is by default the ABAP stack on which XI is running?
    <sap:external-function name="prefix:fName" method="instanceMethod" kind="instance">
       <sap:argument      param="PARAM_1"/>
       <sap:argument      param="PARAM_2"/>
       <sap:result        param="RESULT"      type="xslType"/>
    </sap:external-function>
    Kind Regards,
    Tony.

    Yes. You are right.
    Nilesh

  • External methods in xslt mapping

    can we call external JAVA and ABAP methods in XSLT mapping ? 
    thanks
    kumar

    Kumar,
    Yes you can, please refer the below webelogs.
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    Best regards,
    raj.

  • Function in xslt mapping?

    Hi guys,
            I want to split the resultset containing many rows coming from database into a set fo individual rows using xslt mapping. I know we can acheive this using "split by value" node function in graphical mapping. But want is the name of the function used in this case present xslt mapping.
    Regards,
    Suresh.

    HI,
    XSLT supports java script as well, but XI has few restrictions that it could support particular versions of parsers, and limitations on XSLT capabilities.
    Thus I will suggest you to use some of the string APIs to split the resultset by adding the contextChange in it.
    You could use XSLT mapping with Java Enhancments
    Refer below link
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    (Observe the example given in above link)
    Thanks
    Swarup

  • Need help for Count function in XSLT Mapping

    Hi All,
    We have a requirement in our project,to do the xslt mapping from OAGIS 9.0 to EDI XML.In the EDI XML we have a SE tag whose value is the count of the no. of complex elements that will be generated in the EDIXML file( which is the target).
    Please do let me know if anybody has done this functionality in the xslt mapping.
    Thanks in Advance.
    Regards,
    Kaavya

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Error while trying to load the xslt mapping

    Hi,
    while testing the xslt mapping, the following error is encountered:
    "TransformerConfigurationException occurred when loading MAP.xsl; details: Could not compile stylesheet"
    Please help me in the resolving this.
    Regards,
    Meenakshi

    Hi Meenakshi,
      Select XMLTOOLKIT option in operation mapping,and execute your XSLT Mapping.....
    Check this thread for more help...
    XSLT mapping issue
    Regds,
    Pinangshuk.

  • Process external functions within xsl maps

    Hi,
    i am working with xslt maps, and i have now the problem to generate the current date/time.
    I found some postings with the solution to implement some new java classes.
    Does somebody know, how to use the registerd java libs within xslt maps ?
    - publish the xslns
    - define the xsl:script
    - use the class
    Thanks
    Bernd

    Hi Rasto,
    very good.
    Could you please send the whole xslt.
    The following does not work (in XMLSPY):
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="java:java.util.Date" xmlns:formatter="java:java.text.SimpleDateFormat">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="ROOT">
         <xsl:variable name="v_dNow" select="date:new()"/>
         <xsl:value-of select="$v_dNow"/>
         <!-- <xsl:variable name="v_formatter" select="formatter:new('yyyyMMdd')"/> -->
         <!-- <xsl:variable name="v_dateToday" select="formatter:format($v_formatter, $v_dNow)"/> -->
         <!-- <xsl:value-of select="$v_dateToday"/> -->
         </xsl:template>
    </xsl:stylesheet>
    Thanks Regards
    Mario

  • Java Mapping, XSLT Mapping, ABAP Mapping

    Hi Experts,
                     Could any one explain what is the main features of the following Mapping. How to pick the mapping?
    Java Mapping - When to use and what is the advantage.
    ABAP Mapping - When to use and what is the advantage.
    XSLT Mapping - When to use and what is the advantage.
    Graphical Mapping - When to use and what is the advantage.
    cheers,
    Sunee

    There are 4 types of mapping in XI
    1. Graphical Mapping
    2. XSLT Mapping
    3. JAVA Mapping
    4. ABAP Mapping
    When to use Message mapping
    1 When the logic for your mapping is simple and straight forward, you can use
    Advantages of message mapping
    1)Easy to use.
    2) has GUI drag and drop.
    3) used for simple mapping cases
    4) it does not involve any complex logic
    Disadvantages of message mapping
    1)has limitation in terms of complex hierarchy
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Disadvantages of Java mapping
    1)SAX parser is not easy to develop
    2)DOM parser is intensive
    3) Java knowledge is required
    4) bit complexer
    XSLT Mapping - When to use
    1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    3)When data is to be filtered based on certain fields (considering File as source)
    4)When data is to be sorted based on certain field (considering File as source)
    5)When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    1)XSLT program itself defines its own target structure.
    2)XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    4)File content conversion at receiver side can be avoided in case of text or html output.
    5)Multiple occurrences of node within tree (source XML) can be handled easily.
    6)XSLT can be used in combination with graphical mapping.
    7)Multi-mapping is also possible using xslt.
    8)XSLT can be used with ABAP and JAVA Extensions
    Disadvantages of using XSLT mapping
    1)Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    2)Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    3)XSLT mapping requires more memory than mapping classes generated in Java.
    4)XSLT program become lengthier as source structure fields grows in numbers.
    5)XSLT program sometimes become complex to meet desired functionality.
    6)Some XSL functions are dependent on version of browser.
    Advantages of Abap Mapping
    1) A person comfortable with OOABAP can go for ABAP mapping instead.
    Disadvantages of Abap Mapping
    1) Abap knowledge is required
    2) bit compexer
    For further info on each of the mapping, refer to these links,
    Graphical Mapping,
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    XSLT Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    http://www.w3.org/TR/xslt20/
    Java Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    DOM parser API
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
    Check this blog on Mapping:
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    Also, check this thread for more info,
    Different types of Mapping in XI

  • Proxy error when consuming External Web Service (WSDL) in ABAP

    Hi all,
    I am trying to consume an external WS in ABAP but I have some issues :
    1. Is it allows to use tag <xsd:complexcontent> with restrictions and extensions in it ? If not, how can I replace it ?
    2. Do we need to still change the <complexType> structure such as :
    Coding, not working:
    <xsd:complexType name="OrderRequestMsg">
    <xsd:sequence>
    <xsd:element name="shop" type="xsd:string"/>
    u2026
    </xsd:sequence>
    </xsd:complexType>
    <message name="OrderRequest">
    <part name="input" type=" tns:OrderRequestMsg"/>
    </message>
    Coding, working::
    <xsd:element name="OrderRequestMsg">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="shop" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <message name="OrderRequest">
    <part name="input" element="tns:OrderRequestMsg"/>
    </message>
    3. When I am testing the WSDL they send me in SOAPUI, I don't have any issue but when I am trying to integrate in ABAP, it is blocking on an URL saying it cannot find it  (the URL http://fk.se/SHS/xsd/tanden)
    <xsd:schema version="20110317" targetNamespace="http://fk.se/SHS/xsd/tanden" xmlns:tns="http://fk.se/SHS/xsd/tanden" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="qualified" attributeFormDefault="unqualified">
    Do I need to change something ? Since when I am modifying it, it cannot find the type reference afterwards...
    Thanks in advance for your answer.

    Hy Brad, I got the same error by trying to generate a 'Consumer Proxy' from a external WSDL. u2019Incorrect value: XSD name space not available'. I have solved it in this way: The report RSSIDL_DESERIALIZE_DEMO has the same check routines as the R3-Proxy Generator. I debugged this report using a saved external WSDL and compared it with using a saved WSDL (Server) generated under /nse80.
    -> In the WSDL, in part message the "type" isnu2019t allowed, because the dezerialization is done already.
    Coding, not working:
    <xsd:complexType name="OrderRequestMsg">
      <xsd:sequence>
         <xsd:element name="shop" type="xsd:string"/>
          u2026
      </xsd:sequence>
    </xsd:complexType>
    <message name=" OrderRequest">
      <part name="input" type=" tns:OrderRequestMsg"/>
    </message>
    Coding, working::
    <xsd:element name="OrderRequestMsg">
        <xsd:complexType>
           <xsd:sequence>
            <xsd:element name="shop" type="xsd:string"/>
       </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    <message name="OrderRequest">
         <part name="input" element="tns:OrderRequestMsg"/>
    </message>

  • Time Constraint Error when calling a Function module from Webdynpro ABAP

    Any help will be greatly appreciated - Thanks RM
    Time Constraint Error
    Information on where terminated
        Termination occurred in the ABAP program "SAPUP50R" - in
         "CHECK_TIME_CONSTRAINT_S1".
        The main program was "MP000000 ".
        In the source code you have the termination point in line 1069
        of the (Include) program "UP50RU01".
    Error occurred during batch input processing
    Source Code Extract
          l_is_inconsistent = 'X'.
        ENDIF.
      Check if there are inverted time periods.
        IF l_prelp_line-begda > l_prelp_line-endda.
          l_is_inconsistent = 'X'.
        ENDIF.
    Check if there are overlaps or gaps.
        IF NOT l_prelp_before IS INITIAL.
          l_date_difference = l_prelp_line-begda - l_prelp_before-endda.
          IF l_date_difference <> 1.
            l_is_inconsistent = 'X'.
          ENDIF.
        ENDIF.
        l_prelp_before = l_prelp_line.
      ENDLOOP.
      IF l_prelp_before-endda <> '99991231'.
        l_is_inconsistent = 'X'.
      ENDIF.
      IF l_is_inconsistent = 'X'.
        IF p_access_type = 'R'.
    490 Datenbankschiefstand Personalnummer & Infotyp &
          MESSAGE x490 WITH l_prelp_before-pernr l_prelp_before-infty.
        ELSE.
    491 Unzulässige Daten Personalnummer & Infotyp &
    Line 1069 Error occcurs >>>>  MESSAGE x491 WITH l_prelp_before-pernr l_prelp_before-infty.
        ENDIF.
      ENDIF.
    ENDFORM.                    " CHECK_TIME_CONSTRAINT_S1     "XYVN0352581
    *&      Form  clear_no_adapter_needed              new     "XREN844998
          text
    FORM clear_no_adapter_needed .
      CLEAR no_adapter_needed.
    ENDFORM.                    " clear_no_adapter_needed
    *&      Form  set_no_adapter_needed              new     "XREN844998
          text
    FORM set_no_adapter_needed .
      no_adapter_needed = 'X'.
    ENDFORM.                    " clear_no_adapter_needed

    Hi,
    Well, are you trying to do a batch input on infotype 0000? If yes you need to check that the proposed values respects the time constraint, meaning no gap, no overlaps and no inversions. Also fields SUBTY, OBJPS, SPRPS and SEQNR must remain initial when processing IT0000...
    Kr,
    Manu.

  • Error in XSLT mapping while using string functions

    Hi All,
    While using tokenize() and substring-before() functions in XSLT mapping,we are getting an error.The error message is Unexpected symbol "" So while using string functions in XSLT mapping do we have to use any header functions.
    Please through light on syntax etc.,of string functions in XSLT.
    Thanx in advance,
    Lokesh Dhulipudi
    Edited by: LOKESH DHULIPUDI on Dec 27, 2007 7:32 AM

    Hi,
    Hope you have gone thru this help:
    http://w3schools.com/xsl/default.asp
    Rgds, Moorthy

  • XSLT mapping throws error in XI, but not in XMLSPY

    Hi everybody,
    I got a really complex XSLT mapping. It works fine in XMLSPY.
    But when I execute the mapping in XI, I get the following error:
    Error during XSLT Transformation: Could not load stylesheet.com.sap.engine.lib.xml.util.NestedException: Operator or ')' expected.
    I asume there is a special character that XI cannot execute.
    has anybody an idea of finding this character?
    Thanks, regards Mario

    Hi Mario
    Check your input data, and also try to see test in Interface mapping test tab,
    you will get an idea about the input is correct or not
    see the below links..
    <u><b>XSLT Mapping</b>[/u
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    <u><b>XSLT Mapping with java enhancement</b></u>
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping - Using ABAP XSLT Extensions for XI Mapping
    Cheers..
    Vasu
    <i>** Reward Points if found useful **</i>

  • XSLT mapping error in PI 7.1

    Hi,
    The below xslt compiles and runs fine with SAPXML toolkit but the same fails with error
    u201CCannot find external method 'java.util.Map.get' (must be public).".
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
        <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="new-value"    
            select="concat($dynamic-value, 'subfolder\')" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
        <!-- copy payload -->
        <xsl:copy-of select="." />
    </xsl:template>
    </xsl:stylesheet>
    Regards,
    Vishal

    Hi,
    I am already using jdk 5 for the same.
    Can you please tell me what is the setting(s) that need to be done for XSLT to be used with JDK5.
    I have a knowledge on how to develop a XSLT mapping, but fail to understand what is the relation between XSLT and JDK5.
    It will be very helpful to me if you post your reply to my question here: Basic Settings in Operation Mapping
    Appreciate your help and time.
    Thanks.

Maybe you are looking for

  • User Mappings in R/3 system

    I am a bit of a novice at EP6 so i apologise if this turns out to be a simple issue. I'm building an iView portal component which invokes a bapi but I cant establish a connection with the R/3 system. I've read through several threads in the sdn forum

  • Help with viewing raw images in iPhoto 6

    Hi: When viewing raw images from my camera (a Canon 20D) in a large or full screen format, after about 5 seconds I see at least a dozen tiny white dots on the image. These occur 100% of the time. If I "retouch" the image and save it, they go away. Al

  • GotoAndStop depending on location of mc on stage

    I used swift 3d to create a spaceship for use in flash. I decided to make a game where you fly through space from the veiw point of behind your ship. I have 9 positions of the spaceship. Ex: directly behind, behind slightly turned left, etc. for the

  • SAP PS Abap Development

    Hi all, Is there a functional module to get period corresponding to the  dropdown in T-code IM32.

  • Transporter name to be included in Sales order

    Hi Gurus, In our Scenario, client wants to   enter at the time of Sales order : Name of the Transporter.? Transporter is not permanent and is one time Transporter.So the client wants to enter the same dynamically at the time of Sale Order Confirmatio