Skip to Content

XI Mapping - Replace character with an empty tag

I am looking on how to replace the ? character with an empty tag. For example, when field1 = ? , I need just an empty tag for field1 or <field1></field1>

Or in other words, if field1 = ? , produce empty tag, or else produce whatever value it holds.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Dec 23, 2015 at 07:52 PM

    Hi Ryan

    use replace all method in udf

    field1.replaceAll("\\?","");

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 23, 2015 at 08:06 PM

    Ryan,

    Use the below function. (FixValues)

    Thanks!


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 23, 2015 at 09:02 PM

    you can use replaceString text function - replace ? with blank constant.

    Add comment
    10|10000 characters needed characters exceeded

    • Okay sorry, I overlooked at it. You are correct, but still not sure if it will help his requirement. It's upto Ryan to test it out that suits his need.

      For example, let say he wants to replace 100 with blank space for Field1, your logic will work if the field is 100 or if the field is 200 or etc.. But it defeats the purpose if the Field1 has 100000. The result will be 000. Isn't it.. I'm sorry if I'm missing any logic here..

      Thanks!

  • Dec 24, 2015 at 05:37 AM

    Hello Ryan,

    Try replaceString function(String Function)

    Input----------------------

    Constant ?---------------- Replace String---------------------Output

    Constant[]--------------

    http://wiki.scn.sap.com/wiki/display/HOME/Message+Mapping++Replace+String

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 28, 2015 at 05:33 PM

    Hi,

    You can use if-else function, if it equals "?" then pass empty constant else pass the same value.

    Source field - TAGE , Target field -D_98

    Thanks,

    Nidhi


    SCN_1.JPG (19.4 kB)
    Add comment
    10|10000 characters needed characters exceeded