cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding IfThenElse

Former Member
0 Kudos

hi @,

I have a scenario where using exists and ifthenelse function i need to check for existence of a field and then if source field is present then map to a target field and if it is not present then map target with different field.

But the problem is when the source field is present then it is getting mapped to target but when it is not present in source message then target is nt getting mapped to another field which is contant.

I am not able to figure it out where the problem is?

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In the condition part use mapWithDefault instead of exists function.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi Bhavesh & Jai,

TO which category of standard function it belongs .I have searched it but not able to locate ?

REgards,

bhavesh_kantilal
Active Contributor
0 Kudos

It is available under "NodeFunctions".

I think this is available from Sp 13 or SP 14 in XI 3.0

Regards

Bhavesh

Former Member
0 Kudos

Hi Bahvesh,

Thx i have chked it it's there.

I have another requirement where if the node is present map it to target else send a aleart notification and reject the complete message.

Any suggestion in this regards.

Thx in advance

bhavesh_kantilal
Active Contributor
0 Kudos

Well, use this blog of mine to trigger the alert from a User Defined Function.

/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function

Use EXISTS and if it does not exists call the UDF as shown in my blog , trigger the alert and then throw a runtime exception.

or,

just throw a runtime exception and use XI alerts to trigger the alert (mapping alert)

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

Regards

Bhavesh

Former Member
0 Kudos

Use a UDF to throw the alert. Have a look at Bhavesh's weblog on how to do this.

/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function

Guess, I am litl late

Regards,

Jai Shankar

Message was edited by:

Jai Shankar

bhavesh_kantilal
Active Contributor
0 Kudos

late by a few minutes jai.. not an issue at all.

The answer is relevant and i guess that matters

Regards

Bhavesh

Former Member
0 Kudos

Bhavesh,

My doubt is when i will throw an alert whether the message that was used to throw an error will remain in the queue /source structure or it will be deleted automatically.

Is there any way to remove that message from the queue?

Regards

Former Member
0 Kudos

>>Is there any way to remove that message from the queue?

You dont need that. When a error is thrown, the message processing will be stopped. So, you dont need to do any thing with queues.

Regards,

Jai Shankar

bhavesh_kantilal
Active Contributor
0 Kudos

Like poined by jaiShankar, trigger the alert and then throw a runtime exception in the mapping.

This will stop the processing of your message and the messge will be in Error in MONI.

Regards

Bhavesh

Former Member
0 Kudos

But if i have EOIO processing then putting the message will cause problem to other messages in the queue i suppose.

Regards

bhavesh_kantilal
Active Contributor
0 Kudos

> But if i have EOIO processing then putting the

> message will cause problem to other messages in the

> queue i suppose.

Did not think of this . I guess in this case, using a BPM is a better approach.

Regards

Bhavesh

Former Member
0 Kudos

thx Bhavesh,

As per my understanding there willnot be an issue if the QOS is EO

Regards,

bhavesh_kantilal
Active Contributor
0 Kudos

Amit,

We have used this with QOS as EO and it worked without issues.

Without EOIO it will not work as one message in error in MONI will make the other messages stuck in the queue . You need a BPM if you are using EOIO.

Regards

Bhavesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Amit,

mapWithDefault is in <b>Node Functions</b>.

Thanks,

Maheshwari

Shabarish_Nair
Active Contributor
0 Kudos

Then -


> The source filed

Source -> (Exists) -> If -


> target

Else -


> Constant

try that rule, it should ideally work else using mapwithdefault in case u r passing a constant would be ideal.

Ref -

Node functions in

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

bhavesh_kantilal
Active Contributor
0 Kudos

> hi @,

> I have a scenario where using exists and ifthenelse

> function i need to check for existence of a field

> and then if source field is present then map to a

> target field and if it is not present then map

> target with different field.

There is a standard function available for this.

Use <b>MAPWITHDEFAULT</b>.

It checks if the source field exists and maps it to the target if it does not it maps the default value provided. To add default value, double click on the MAPWITHDEFAULT.

Regards

Bhavesh