on 12-09-2009 5:20 AM
Hello Experts,
We have an Orders IDoc with segment E1EDK02 with Occurence 0..10.
In this segment there are two fields QUALF & BELNR.
We want to map a value (Yes or No) to 2 target fields based on the incoming values of QUALF & BELNR .
Now the problem is that for the first occurence of segment E1EDK02 the mapping is working fine.
But for the subsequent occurences of the segment wrong value is mapped to the target field.
The context of both QUALF & BELNR is set to E1EDK02.
Please help!
Thanks in advance,
Suraj
Hello Suraj,
Thanks for ur inputs.
The Problem got solved by mapping in the below fashion:
Constant'NO'----
|then
QUALF= 'CMG' ---| AND -| RemoveContext|-sort(descending)-|CollapseContext|----
if -
| targetfield1
BELNR = C----
|
Constant ('YES')----
| else
This is shown for targetfield1. Same applies for targetfield2 also.
I am also curious about one more thing. How do u copy and paste the screenshots in SDN?
Thanks,
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suraj,
Try mapping like this
Don't change any context
BELNR --|mapwithdefault--| then
QUALF= '<your value>' ---| if ---------splitbyvalue--| targetfield
Constant ('')-----------------| else
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Suraj,
Let me elaborate the conditions:
If QUALF = 'CMG' and BELNR = A or D then TargetField1 = 'NO' else TargetField1 = 'YES'
If QUALF = 'UVA' and BELNR = C then TargetField2 = 'NO' else TargetField2 = 'YES'
The values of both the fields change in each occurence of segment E1EDK02.
Thanks,
Suraj
Hi Suraj,
Duplicate the target field and do this two mapping
Constant'NO'----------|then
QUALF= 'CMG' ---| AND ---|if ---------splitbyvalue--| targetfield
BELNR = C--------|
Constant ('YES')------------| else
Constant'NO'------------|then
QUALF= 'UWA' ------| AND ---|if ----------splitbyValue -| targetField(2)
BELNR = A --|OR----|
BELNR = D --|
Constant ('YES')---------------|| else
Regards
Suraj
Hello Suraj,
Its still not working. I tried with all the different options of SplitByValue function.
Right now in the first occurence of segment E1EDK02 the Qualf = UVA & BELNR = C. So TargetField1 = NO. This is working fine.
But when in the third occurence of segment E1EDK02 the Qualf = CMG & BELNR = D, the target field2 = YES is the result. It should be 'NO'
The Display Queue for 'if' function is showing it correctly to be 'NO' at third position but I think the value is taken from the first position as 'YES'.
Thanks,
Suraj
Hi Suraj,
Check the occurrence in target field
MT_ORDERDATA 1..1
TargetField1 0..1
TargetField2 0..1
maxOccurs is 1 so the TargetField1 and 2 will come for maximum 1 time.. but in source the max-occurrence for E1EDK02 is 10 and hence it can come 10 times..but because of the target max-occurs 1 output will have only 1 value.. you shoudl try changing the max-occurs in target..
E1EDK02 1..10
QUALF 0..1
BELNR 0..1
Regards
Suraj
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.