on 07-15-2013 1:15 AM
Hi,
I am struck in a mapping logic,
If QUALF equals "013", then map the same context of IDTNR to target.
If QUALF not equals "013" and QUALF equals "001" then map the corresponding IDTNR value of 001.
001 -- Should fail
013 -- Should pass
<---Context change--->
001 -- Should pass for 001
Ideally the expected values are Should pass (013) and Should pass for 001 (001) with a context change.
The Should fail value occurs because the first context QUALF has the values 001 and 013 in the same set of records.
Need you inputs in getting the desired result without a UDF.
Hi Sherin,
Appreciate the way you explained the problem.
I think it will be overtly complicated without a UDF. Let me explain why!
Normally IDTNR with Qualf is associated with E1EDP19 segment and different values may or may not occur per IDoc. Now since you have to keep the context to E1EDP01 or above so in a context it will check for each value in sequence (01 first and then so on... it goes to else). You have 2 true conditions and which will propagate through the queue and rest will give suppress.
Since you have to populate the material id once in the target per IDoc, you cannot achieve it through just if and else or if without else.
It would be better if you write a UDF to meet your requirement.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sherin,
Here is the UDF:
Parameters
qualf map to QUALF (should be at context E1EDP01)
idtnr map to IDTNR (should be at context E1EDP01
____________________________________________
String output = new String();
for (int i=0; i< qualf.length;i++)
if(qualf[i].equals("001"))
output = idtnr[i];
else if(qualf[i].equals("013"))
output = idtnr[i];
result.addValue(output);
____________________________________________
Please find the mapping and test case below:
Hope this resolves your problem.
Ambrish
Better screenshot :
First E1EDP01 had 3 E1EDP19s with 001, 013 and 017 where should pass 13 should go
second E1EDP01 had 2 E1EDP19s with 001 and 017 where should pass001 should go
third E1EDP01 had 1 E1EDP19 with 018 where null should go since no relevant material id came through from SAP for target system.
Hope it is clear now
Ambrish
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
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.