cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple values in the constant function

Former Member
0 Kudos

hi,

Wanted to know if there is a way we can specify more than one value in the 'constant' function. For example the target node will be created if the value in the input string is A or B. Can i simply put the two constants (A,B) in the contant field.

If not, how do i accomplish this?

thx,

Pradip

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hay Pradip,

Is your problem got solved? What did u change? How you passed multiple values to constant?

-Gouri

Former Member
0 Kudos

small udf.

say input string is a.

if ((a == A) or (a == B)){

return "1";

}

else{

return "0";

}

and further use if function..

i mean if source string = 1,

use createlf (node function) to map to the target node, that you want to create.

Input -[udf]-if [1]-createlf-targetnode.

Regards

Pushkar

Message was edited by:

pushkar anand

Former Member
0 Kudos

Hi,

Still its not clear to me..

well..do you want to concatenate the values of A & B?

Regards

Pushkar

Former Member
0 Kudos

hi,

Let me try it another way. Let's say i have an idoc segment on the sender side and i am populating some structure on the receiver side based on some values in teh idoc segment. So now my target node (structure) should be created only if the constant values on the sender side are A or B.

For a single constant value, i would just use a if-then statement and pass a constant 'A' to the function and get the output. Now my question is how do i take care of more than one constant values?

Pradip

justin_santhanam
Active Contributor
0 Kudos

Pradip,

As you said the constant value will be populated in only one field right. Please consider the below example

<Record>

<Constant>A</Constant>

</Record>

<Record>

<Constant>Z</Constant>

</Record>

<Record>

<Constant>B</Constant>

</Record>

The Record is unbounded , and the constant may have different values in it. You have to map only if the constant field has value A (or) B, am I right?

Try the below logic

http://www.flickr.com/photos/8764045@N06/

Let me know it works for you or not!!

Best regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

Pradip,

Is the link opening for you? Did you solved your issue.

Best regards,

raj.

vuyyurujyothi
Participant
0 Kudos

Hi Pradip,

I just tried your scenario. Try in the following way:

1. First take the equalsS function from Text functions. Pass source field and Constant (A) as arguments to that function.

2. Give the output of that function to If Then Else Boolean Function. For Then part, pass Constant (A) as argument and for else part pass Constant (B) as argument

Now by second step, you have checked for 'A'. Now you have to check for 'B'. That's why we are passing 'B' to else part.

3. Now pass the output of ifelse statement to ifwithoutelse boolean function and also Source field as another argument. For then Part, pass cconstant 'B'

4. Pass the output of this funtion to createIf node function which produces empty value if argument is true (create node with value 'B') else Result.Supress (won't create node)

I think you understood the concept. If you have any doubts please let me know.

Regards,

Jyothi.

Former Member
0 Kudos

hi.. how will you decide, what to select ..i mean A or B.

We can put the values as per the condition. using if else.

Not a big deal.

Regards

Pushkar

Former Member
0 Kudos

hi Pushkar,

That is fine - i know we can use the if-then to work with this. My question is i want to create the target node for both value A or B. Currently the way the if then is setup - is passing only one value (A) as a constant and then creating the node. Can i in the 'constant' function put 'A,B' - will this be the right way

thx,

Pradip