on 08-21-2006 8:07 AM
Hello everybody,
in my target message interface a special tag - let's call it <special> - should only be generated if several fields in the source structure occur.
To do this you normaly use the function <b>exists</b>.
But I have more than 50 fields in the source.
My idea was to <i>concat</i> all the 50 fields in a user defined function.
This works but it looks very ugly.
I hope you have some better ideas?
Regards Mario
Mario,
Just an idea.. How about using a GLOBAL VARIABLE in the JAVA section?
Use EXISTS against each source field individually. If it does not EXIST , then set the FLAG and then write a SIMPLE UDF, that will check for the Global Variable FLAG and then create the Tag in the target if needed?
This way, you can avoid multiple ( 50 ) entried to the UDF.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check out this URL
http://help.sap.com/saphelp_nw2004s/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
Thanks,
Prakash
Hi Bhavesh & Prakash,
your idea sounded good.
Unfortunately it is not practicable.
The mapping is done sequentielly.
But the target-field that depends on the occurence of the fifty other fields is mapped first!
So when I call the UDF <b>get</b>GlobalParameter, the UDF <b>set</b>GlobalParameter have not been processed and is NULL!
Regards Mario
If it's really sequential and not random, you could do it like this:
Create two boolean global variables on the java section. One is the flag that you use to check whether the special tag will be created or not. The other one is a flag which you set only on the last field UDF, after you have updated or not the first flag.
For the special tag, your UDF would be something like this:
while (flag2 == false) {
//wait for the last UDF to run
}
if (flag1 == true) {
//create special tag
}
Regards,
Henrique.
Edit: as it's probably random and not exactly sequential, it'd be better if you created a integer variable and in each udf you just increment it. Then, in the special tag udf, you make a while like
while (count < 50) {
//wait for all the mappings to be completed
}
(you could use a Thread.sleep(10) in the while, to make the loop to wait for 10 milisseconds)
Also, I don't know if it will work because I don't know what is the treatment that XI has for parallel access to global variables. But it's worth a test.
Hi,
I am still confuse weather above suggestion would work. I have another method to handle this type of problem.
Create two mapping and put up in same Interface mapping
First mapping between your source structure and semi-target Structure. Create your mid-target almost same as your target but difference in sequence of tag and put special tag at the last Tag for particular context. Now apply Global Container method for its creation.
Second Mapping between your semi-Target Structure and actual target structure having simple direct mapping (for changing the sequence of tag).
Hope this will solve your problem.
Regards,
Vijay Singh Rajput
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.