Skip to Content

UDF to get only the values from the input message type/xml based on filed fixed length

We have requirement to post the output as string concatenating the input parameters(240) from the messagetype/node..we are using HTTP receiver adapter .

Please help us to define the UDF

Example;

MT_Account/Customerdetails

match="AccountNumber"> <xsl:value-of select="substring(concat(., ' '), 1, 9)"

match="DOB"> <xsl:value-of select="substring(concat(translate(., '/', ''), ' '), 1, 8)

match="LastName"> <xsl:value-of select="substring(concat(., ' '), 1, 16)

Expected output = 3254678 02041986STALIN

Thanks,

RaviTeja M

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 17, 2017 at 10:50 AM

    Ravi,

    Would you mind sharing a sample input file and expected output for the same ?

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 11:52 AM

    Hi RaviTeja!

    If you need to implement mentioned functionality using UDF in graphical mapping you can use approach like this:

    https://archive.sap.com/discussions/thread/3955709

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi RaviTeja!

      I gave you an example of similar logic implementation using java code. Further you can modify and extend it according to your requirements.

      For example, if you need to check field lengths, you could use Map object containing collection of field names as keys and its lengths as values. While iterating the NodeList you check current element name against its length in Map and adjust it accordingly.

      Regards, Evgeniy.

  • Apr 21, 2017 at 05:01 AM

    Thanks Evgenly - we did by using the standard graphical mapping and xsl code....scenario is working fine....

    - http://www.w3.org/1999/XSL/Transform" version="1.0"> - Unnormalized: " " Normalized: " "

    Add comment
    10|10000 characters needed characters exceeded