Skip to Content

greater function(Arithmetic) not working in graphical mapping

Hi SapAll.

in an Idoc To File Interface i have got a requirement where i need to compare occurance of two child segments G02,G02 Under parent Segment G01 and then determine the occurance of target Record Structure.

the IDOC structure is G01

G02

G03

MAPPING IS like G01->count->

greater(Arithmetic Function) IF THEN G02 else GO3 ->TARGET RECORD

G02->count->

when i use Equals(Boolean Function) then it is comparimg occurance of two child and if equals then created target node as per the occurance of source node G02 but when i use Greater(Arithmetic),its not working .

can any one help me how i can achieve this ?

regards.

Varma

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2010 at 10:24 AM

    If you are in XI3.0 then go through this blog..

    /people/thorsten.nordholmsbirk/blog/2006/08/25/new-arithmetic-and-statistical-functions-in-message-mappings-in-sp18

    Otherwise write an UDF with 2 input parameters and pass "G01 & 2->count->UDF"

    if ( G01 > G02 )

    {

    return "true";

    }

    return "false";

    now use if function and pass the output of UDF and based on that you map G01 and G02 to the target.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Alejandro Pertierra

      >

      > Hi,

      > i think that no UDF is neccessary, your mapping should be

      >

      > G01 >Count >(greater(G02 >Count) >IFTrue(G03)--->ELSE (G04)

      >

      > all context of the fields must be setted to IDOC.

      >

      > by way you will have many occurance in the target node as per as the number of the occurrance of G03 or G04

      Don't think just try it.. 😉 It will not work.

  • Posted on Sep 10, 2010 at 01:16 PM

    the IDOC structure is G01

    G02

    G03

    MAPPING IS like G01->count->

    greater(Arithmetic Function) IF THEN G02 else GO3 ->TARGET RECORD

    G02->count->

    your mapping should be

    G01 >Count >Greater (count G02)--> IF THEN G02 else GO3 ->TARGET RECORD

    but remember to change the context (to IDoc) of G01 and G02 . to do this in the mapping editor press right click >Context node >Name of the IDoc

    if you dont do this the count of both will be always 1.

    refer to

    /people/rohit.kalugade/blog/2009/02/09/context-and-queue-in-message-mapping-udf-150-part2

    /people/rohit.kalugade/blog/2008/12/08/context-and-queue-in-message-mapping-udf

    Edited by: Rodrigo Alejandro Pertierra on Sep 10, 2010 10:33 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2010 at 07:35 AM

    Hi,

    From the error description >> java.lang.IllegalArgumentException: the length 0 of the array 'sortedFunctionKeys' is not equal to the number 1 of functions.<< it seems that u have created the UDF in Definition tab and not Functions tab in the message mapping. When a udf is created in the Definition tab directly it does not get reflected in Functions tab. And hence the error.

    Try creating the UDF in Functions tab and check if number of UDFs in Definition and Functions tab are same.

    Regards,

    Rahul

    Edited by: Rahul on Sep 13, 2010 1:13 PM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.