on 10-09-2008 2:46 PM
Hello Guys,
I have a unique problem with my mapping.
There is a IF condition which checks for number of line items and maps accordingly to the target.
In the else part, if the number of line items is not matched as per a field, am calling an RFC lookup to update the error status into the table and further the mapping wont work.
But unfortunately, IDOC gets created and also the table gets updated with Error status.
Scenario 1:
Number of line items = 5
Actual Line items = 5
So this test scenario should successfuly create an IDOC.
The IDOC do gets created, but also the else parts gets executed.
Scenario 2:
Number of line items = 5
Actual line items in file = 3
So, in this scenario the idoc should not be created and only should update the error status. This scenario is working perfectly.
But am not able to understand why in scenario 1, it is acting weird by executing both the IF and the else condition.
Regards
KRish
Probably the IF clause is looped.
In the first scenario you'll have a case where 5 = 5, so the idoc is created, and other cases where 1 = 5, 2 = 5,... so the error update is created.
In the second case, you'll only have 1 = 5, 2 = 5 and 3 = 5, so the error message is created, but the idoc not.
br.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's quite difficult to say, as I don't know what your mapping looks like...
If you do the check on ITEM level, this will normally be the case, because the mapping will go through each ITEM (and it should).
You should perform the check on header level.
Something like
IF NOT count (line items) = coung(Actual Line items) --> throw error
ELSE proceed
As I said, I don't know what your mapping and file structures look like, so it's quite hard for me to imagine what is going on.
Hi
use UDF to do this operation
Graphical mapping if function is a known bug
Refer SAP note 1053706 and 1061202
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It could be because of a bug in Graphical IF node, in some XI/PI service pack levels the IF and ELSE branches are executed regardless of whether the IF condition is TRUE or FALSE.
Please refer the SAP Note: 1061202 - Function "if" evaluates both branches
Solution:
1. Apply the corrections mentioned in the SAP Note
(or)
2. Use UDF instead of standard IF node and do the condition checking inside the UDF
Regards,
Ananth Chinnaraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.