Skip to Content
avatar image
Former Member

Mapping error simple issue

Experts,

I am trying to do a simple mapping. My Source

<root>

<a>a</a>

</root>

My target

<root>

<x>constant<x>

<y><y>

</root>

y is aoptional in the target and this shpuld be produced only if the value of a = a. I am trying the graphical mapping if ...then ...

I get error when the value of <a> is anything othan than a. Instead of erroring, it should just not produce the target node.

Sabbir

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Aug 29, 2008 at 01:47 AM

    >>y is aoptional in the target

    I hope you have given occurrence of "Y" as 0-1 or 0-unbounded,if not,then please do that

    If-Else should work in this case,if possible can you please upload a screen shot of the message mapping on flickr and post the link here on SDN

    Thanx

    Aamir

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 29, 2008 at 05:21 AM

    Hi Sabbir,

    intead of using if.......then you better use ifWithoutElse, It will not give you error as if the condition is false this will give "SUPPRESS" value which does not make any Node.

    Thanks

    Sunil Singh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 29, 2008 at 06:36 AM

    use the following mapping

    root---------------->
                            equalsS(text function)--------->createif-------->y
    Constant[a]---->

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 29, 2008 at 07:03 AM

    Hi,

    change the <y> element occurances to 0-1.

    Use if function like below..

    source <a> -- EqualsS(Text Function)Ifmap the <a> to (Then)---Target<y>

    Constant(a) --

    Regards,

    Prakasu

    Edited by: prakasu on Aug 29, 2008 9:03 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 29, 2008 at 08:45 AM

    Hi Shabir,

    Please do this:

    If A=Constant(A) then Y=Constant

    No need to give if then else, just try with If then. This will solve your problem.

    While testing you just try to give A for source A then you can get Target Y otherwise it wont visible.

    Regards,

    Nutan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 07:55 AM

    Any update on this?

    Same problem here, check screenshot below. Tried to use createif but

    still doesn't work.

    RuntimeException in Message-Mapping transformation: Cannot produce target element /ORDERS/SROORDERS3

    http://www.flickr.com/photos/24514021@N04/2881862080/sizes/o/

    Works if MATNR = 420951. If MATNR != 420951 I don't want it to do anything instead

    it keeps throwing an exception. Why isn't this working?

    Regards,

    Sven

    Edited by: Sven Buttler on Sep 23, 2008 9:57 AM

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 23, 2008 at 08:48 AM

    Use node function

    Createif ->create node only condition if particular condition is true.

    follow the way as suggest by Malini,your problem would be solve.

    Add comment
    10|10000 characters needed characters exceeded