on 12-08-2006 10:52 AM
Hi everybody!
I want to map the value of a source field through a <b>FixValues</b> function to the target field. Unfortunately this is an IDoc field which sometimes doesn't even exist (i. e. it's not just empty - it's not even there). In this case the <b>FixValues</b> function suppresses the output, and there is <i>no</i> output - not even the <i>default</i> value of <b>FixValues</b>. However, the requirement is that I always have to generate a default output - even if the input field is empty/missing.
Ony ideas how this could be done?
Regards, Joerg
Hi,
where ever you required default values check if the condition exists pass map the source to target othere wise map the constant (what is the default that you assign in constant)...you need to use the If else condition to achive this.
Regards,
Venu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joerg,
You have two options:
Under node function:
1) use the Exists functions , which will check the existance of that field and then use the if -then -else to populate the default ..
2) Or there is a "mapwithdefault" function available under the node function .. .
Either one will solve...
Cheers,
Himadri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thaks for the ideas.
Unfortunately this <i>doesn't</i> work for me - if the target field doesn't exist, either way the target is suppressed as well. This might have to do with the fact that I have several conditional <b>createIf</b>'s in the target hierarchy "above" the target field, i. e. the target field itself is created only conditionally - and maybe these different conditions get in each other's way...
I have notice, that the queue of my target field contains a SUPPRESS value (among others) - does this have something to do with my problem?
Regards, Joerg
Hi Himadri!
Thanks for the quick response! I tried to create such a que. However, it doesn't remove the SUPPRESS from the queue. Here's the code:
// Two input params: src[] and def[]
// src contains the input queue (with SUPPRESS values)
// dst contains (hopefully) only one value - the default value
int n=src.length;
result.clear();
if (n==0) {
result.addValue(def[0]);
}
else {
for (int i=0; i<n; i++) {
if (src<i>.equals(ResultList.SUPPRESS)) {
result.addValue(def[0]);
}
else {
result.addValue(src<i>);
}
}
}
What am I doing wrong?
Regards, Joerg
Hi Joerg,
It is checking for two consequetive context changes :
Try this:
int n=src.length;
result.clear();
if (n==0) {
result.addValue(def[0]);
}
else {
for (int i=0; i<n; i++) {
if (src<i>.equals(ResultList.CC) && src[i+1].equals(ResultList.CC)) {
result.addValue(def[0]);
}
else {
result.addValue(src<i>);
}
}
}
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.