cancel
Showing results for 
Search instead for 
Did you mean: 

How to write condition logic in message mapping??

Former Member
0 Kudos

Hi <Removed by Moderator>,

    Can you please let me know how to write a condition logic in message mapping?

    I need to write a logic to exclude entering into message mapping if one of the fields in message mapping contains

    a string called "TEST". Which means i should not enter into the message mapping if the field has value "TEST" in one of the fields

    from message mapping; Hope you got my point. Any help appreciated? Thank you.

Regards

Rupa

Message was edited by: Prateek Raj Srivastava

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You can write condition very similar to the following blog...fig 6 or fig 7.  You need to use constant function and if else condition to compare the value of the field whether it is TEST or not and if so map to the target structure.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

Answers (1)

Answers (1)

former_member184789
Active Contributor
0 Kudos

Hi Rupa,

I believe you want to create top target node if a particular source field contains a particular String say TEST. You can have a UDF with execution all values of context:

int a = var1[0].indexOf("TEST");

        if (a !=-1)

        {

        result.addValue("");

        }

        else

        {

            result.addSuppress();

            }

Here provide the input to the UDF as the field for which you want to test if it contains that String. Map the output of this UDF to the top target node.