on 03-02-2012 2:58 PM
Hi Experts
Scneario is Idoc to target jdbc structure.
Under a parent segment S1 (repeating three times) there is a child segment S2 which is repeating 4 times, each one having a field KSCHL and field BETRG.
KSCHL BETRG (value)
1 K1 V1
2 K2 V2
3 field not present V3
4 K4 V4
Mapping rule is : If KSCHL is K4 send value (V4) to target field.
Context change is on the parent segment S1, since the mapping rule needs to generate the jdbc structure 3 times - one for each occurrence of S1.
However since the field is not present in 3, the value V3 goes into the target field instead of V4.
I have tried context changes, split by value etc. but cannot get the solution
Please can you indicate whether this can be solved using graphical mapping or a UDF is needed.
If yes please specify the UDF to be used
Hi Gary,
Switch back to the initial context (segment S2) for the fields you map, then use the IF function to test the required condition (KSCHL = K4) and put RemoveContext and then SplitByValue(Each Value) between the IF and the target field. This will solve your problem.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg
Another one, if you can guide me in the right direction.
In the same scenario, case no. 3 - KSCHL is not present in the segment, but BETRG (value) is present.
When I try to send that value by using KSCHL not exists again the context queue imbalance comes into play. Tried all combinations of raising the context and without raising the context of KSCHL and BETRG, but the V3 value does not get passed to target.
I had to switch the mapping rule to another field KOTXT that exists in the segment, but wanted to avoid that since that field has free text.
Is there a way where I can keep the mapping rule to KSCHL, but send BETRG when it does not exist.
dont change the context of KSCHL and BETRG fields and then use mapwithdefault after KSCHL and ur mapping logic....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.