Skip to Content
avatar image
Former Member

Need UDF for the following requirement

Hello All,
    I have the following requiremnt in  SAP PI. Could you please help me in writing the UDF.
For example i have source field contains value 1 in the field. Also next if the same value 1 comes in the field of next node the out put should be incremented by 1. Here are the following in detail.

Source side                                                                                                     Target side
Node1                                                                                                              Node1
  A=1                                                                                                                 A=1
Node 2                                                                                                             Node 2
A=1                                                                                                                    A=2
Node 3                                                                                                             Node 3
A=2                                                                                                                     A=1
Node 4                                                                                                             Node 4
A=2                                                                                                                    A=2                                   
Node5                                                                                                              Node5
A=2                                                                                                                      A=3
Node6                                                                                                                Node6
A=3                                                                                                                       A=1
Node7                                                                                                                 Node7                                                                                                           
A=4                                                                                                                    A=1

That means if the same value gets repeateed in source side for different nodes, the output gets incremented by one. And if the different value comes in source side for different nodes. The output will be 1.

Thanks in advance for help....  :):)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 21, 2014 at 01:43 PM

    Hello,

    I think u can use graphical mapping to achieve ur requirement.

    BTW, i believe by next node u mean next instance of the same node? right?

    If my assumption is true, then u can check below mapping (in case ur input values are not sorted then u can use sort function also):

    Thanks

    Amit Srivastava


    Capture.PNG (21.3 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Amit Srivastava

      Hey Amit,

          

           Really thanks alot for your great help. It is absolutely working fine as expected. Stil in case of aany changes in the requriment i wil contact you. Thanks alot again... ๐Ÿ˜Š๐Ÿ˜Š๐Ÿ˜Š