on 11-22-2011 11:44 AM
Hi All,
I have a scenario wherein I need to populate the default value NA if a VM lookup fails and send an email which lists all the values in a message for which the VM failed.
I tried achieving the same through 1:N mapping populating both the required target message and mail message from same source message. This setup works fine when the VM is absent. But the mail message gets generated, without any content, even if the VM is present. I have set the cardinality of the mail message in the mapping signature as 0 to 1.
Please suggest of a possible way to achieve the above.
Note: we are using PI 7.3
Regards,
Diptee
Multiple alerts are being generated, reopening to find a solution for the same.
Hi All,
I am mapping a graphical variable to the send mail function.
However, this works only when the graphical variable is created after the last source node which is being value mapped.
This leads to multiple alerts when the parent node ofthe graphical variable is generated more than once.
Please suggest a way out.
Regards,
Diptee
Edited by: diptee s on Dec 9, 2011 12:29 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use enhanced determination and do lookup during mapping and decide the target messages including mail reciever.
Please see this link (go through multiple inbound interfaces topic)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Baskar,
Thanks for the link.
The solution with multiple service interfaces works fine when the VM is present; that is no alert email is generated.
However, when the VM is absent, the message fails in error RoutingException: InterfaceDetermination did not yield any actual interface.
Note: The multiplicity of my target interfaces are 1 for the required target message and 0..1 for the optional mail alert. The message mapping works fine when VM is absent, that is it generates both the target and the alert mail message.
Regards,
Diptee
Hi Deepti,
in your case mail adapter would always be called and it will generate mail. An option would be to call(Conditional based) RFC in message mapping to a function module which will send mail from abap stack. Again, it is not a better solution but you can try it.
-Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try sending the mail with the VM values from the message mapping itself, no need to use multimapping in this case.
Refer the foll link for how to send an email from a udf.
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=90570965
Regards
Thanks Shiladitya,
The UDF has been really useful in generating the mail through MM directly.
I am using the UDF as below
1. perform VM lookup for source value
2. if VM lookup fails send the default value NA as the output of VM function.
3. check through a if - else condition whether the output of VM function equals NA.
i. if yes, i am feeding the output of the mail UDF (set to be the value NA) to the then condition, ultimately sent to the target
ii. if no send the mapped value to target
However, the mail UDF is getting executed even when the VM is present.
Any pointers where I am going wrong?
Regards,
Diptee
Hi Experts,
Just confirmed that the 'then' block of a 'if-then-else' function is always evaluated even if the 'if' condition yields a false. Only that the value sent as output of the 'if-then-else' function in this case, is that of the 'else' block.
I have got around this through the addition of a UDF, for collecting all values for which the VM lookup is failing, which would be applied after the VM lookup.
Now this UDF needs to work upon a global variable which will have to be intialized to a empty string.
Can you suggest how and where to declare the global variable?
Regards,
Diptee
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.