on 03-23-2008 10:39 AM
Greetings
is there any way to exit the current mapping using?
I have a scenario where I need not to skip mapping if a specific condition is met.
Regards,
HI,
You have to skip mapping is it means that if certain condition will be staified then your mapping should execute else the interface should have to be failed.....or vice versa
For this kind of requirment you could generate the SMART Exception in XI.
Refer below blog....
SAP Network Blog: Throwing Smart Exceptions in XI Graphical Mapping
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
SAP Network Blog: XI/PI: Throwing Generic Exceptions from any type of Mapping
/people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
If you have mulitple mappings based on condition then
you can actually choose your mapping based on the input data using xpath in your interface determination
ref: /people/suraj.sr/blog/2006/01/05/multiple-inbound-interfaces-within-a-service
Thanks
Swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem solved thanks for Ranjit and all of you experts,
1. My main message mapping do and RFCLookup and map it to ValueX, if a null was returned Value=0.
2. I created an additional validation map which creates the message only when ValueX is not 0, I used creatif the required filed is not equal to 0 and made the main node as optional in my datatype.
Many thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The suggested answer created another problem, it causes the message queues to stop because of raising an exception
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lets say-
obj is a context object i have created and assigned to say a field <IFNumber>in the source xml
and now I have to use a different mapping when obj(IFNumber) equals to say "1000"
this can be checked at runtime using the condition editor in the receiver determination.
there i need to put the condition, and what i can do is - i create a different receiver and a different interface mapping that this receiver should use.
Hence whenever obj=1000 the condition editor will help to choose the other receiver and this is how i control the flow at runtime.
i know my explanation is little clumsy but i think u can get the idea at least.
Ranjit
please refer this:
http://help.sap.com/saphelp_nw04/helpdata/en/43/a513f2632c332ce10000000a11466f/frameset.htm
Ranjit
No,
even the receiver determination solution has no use to me.
inside my message mapping I am doing an RFCLookup through a UDF to get a value. if this value was null I want to skip mapping the current record. in webMethods I can do this by doing a branch on the RFC output. But couldn't find a similar way in XI
Hi Baheej,
how about using 2 mappings in a sequence?
say in the first mapping you do your RFC look up in an udf and get the value from RFC in to a field
Now in the subsequent second mapping step what you can do is - put a condition based on the value of this field and map it to the parent tag of your record
e.g lets say following is your target xml struct of the first mapping in which "Field1" is the result of RFC lookup
<DATA>
<Field1>null</Field1>
<Field2>
<Field3>
</DATA>
Now in the next mapping you use the same source and target xml wherein put a condition for tag <DATA>
like: DATA=createIf(Field1!=null)
Then you can skip the record if Field1 is "null".
The above created Message mappings can be put one after another in one IM.
i hope this gives a stimulus.
Ranjit
Now you have got on the right track.
DATA=createIf(Field1!=null) was just to give you an idea,
but this you can impliment in 2-3 ways if you want.
1. If you see u have used the boolean notEquals function which is why you get this error.
first of all you need to know in what format you will get the result of the RFC (string/boolean etc.)
Now it is in your hand to return the value in the UDF u r trying to use for RFC look up
if you get the null as response what you can do is - just put a condition while writing the return statement in UDF as:
if(RFCReturn == null)
return ""+0; //as the return parameter expected is in string format
else
return ""+RFCReturn;
and in this manner in the mapping you can now use the notEquals as:
notEquals(Field1,"0")
2. You can use the Text functions like compare or equalsS along with ifElse to achive your target
like this it is up to you how to do it.
Ranjit
I have done it all now,
however, if I got a valid RFC lookup my map is good, however if I got the other exception value (0) the map will fail with "Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd"
I am comparing two text, if they are not equals , then creatif the first element
I have done it all now,
however, if I got a valid RFC lookup my map is good, however if I got the other exception value (0) the map will fail with "Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd"
I am comparing two text, if they are not equals , then creatif the first element
Hi Baheej,
it is realy very hard to visualize your problem.. until i touch ur mapping i cant be of real help- all i can do is guide you..
as far as i think this is very basic one and you have to really need to read and analyze the errors that you get.
you know the errors that the java code throws are not very simple to understand- and that to combined with xml- it gets worse.
but anyway- i think you should check with the occurences of your tags this kind of errors you wil get in case there is a tag with occurence 1..unbounded and you might have run ur scenario with only one record which is faulty -because of which it cudnt create at least one of it or it is 1..1
please check for this kind of basic things.
Ranjit
Problem solved thanks for Ranjit and all of you experts,
1. My main message mapping do and RFCLookup and map it to ValueX, if a null was returned Value=0.
2. I created an additional validation map which creates the message only when ValueX is not 0, I used creatif the required filed is not equal to 0 and made the main node as optional in my datatype.
Many thanks
>
> inside my message mapping I am doing an RFCLookup through a UDF to get a value. if this value was null I want to skip mapping the current record. in webMethods I can do this by doing a branch on the RFC output. But couldn't find a similar way in XI
If that's the case, won't mapping ResultList.SUPRESS satisfy your needs? Map this value to the current record if your condition is met after Lookup.
Regards,
Henrique.
Hello again
I have applied "Throwing Smart Exceptions in XI Graphical Mapping"
but the problem with it will through an exception in the queue and it will stop all messages in the same queue.
what i needed is just to skip the mapping on some cases. Can I do this without holding the queues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks a lot Swarup
This what I was looking for:
SAP Network Blog: Throwing Smart Exceptions in XI Graphical Mapping
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.