on 03-25-2013 5:58 PM
Hi,
My scenario is File to Idoc (Orders)
My File looks like below
Customer ... Code Quantity
100 10 1000
200 2000
100 3000
300 20 4000
200 5000
300 40 6000
300 7000
1) Create one idoc for each customer
2) If there is more than one record for a customer, then E1EDP01 should be repeated.
3) E1EDP01 should be populated only when code value is blank. if the record has a value in the "Code" then that record should be skipped.
we are able to achieve 1 and 2 in the mapping.
But we are not sure how to do the mapping for the Point 3 above.how to skip the E1EDP01 when there is a value in the code field.
Appreciate your help.
Perform two levels of mapping, first level mapping is to create only records where only code value is Blank.
Second level mapping toi create IDocs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
iam trying your approach to go with 2 levels of mapping
1st Mapping to eliminate the records which has value in code.
2nd mapping is to map to the idocs.
iam facing a issue in the operation mapping, because 1st mapping the occurence is 1:1
in the 2nd mapping the occurence is 1: unbounded(creating multiple idocs).
How can i resolve this issue.
Thanks
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I assume that you want E1EDP01 to be repeated as many times as the no. of records come except the cases where code value is not blank. It can be done simply by: if length of field 'Code' = 0; then CreateIf->E1EDP01. But I have one doubt, is it such that for each customer say 100,200 the code may occur multiple times. In such a case the above logic may work fine. In case if it is such that the source will have one code per Customer & the no. of E1EDP01 will be one less than total no.of Customer minus the one where Code exists:
Customer Code
100 10
200 20
300 30
100
100
200
300
300
Thus you want to have two E1EDP01 for 100, one for E1EDP01,two for E1EDP01. In this case you can also have the logic sort the customer, then split by value(value change), count,then substract 1 as you will have one code for each customer. Using this count say inp1, you can have a small UDF for creating no. of contexts as per the count in var1. The input for inp2 will be code field:
for(int a=0;a<inp1.length;a++){
int temp = Integer.parseInt(inp1[a]);
for(int b=0;b<temp;b++){
result.addValue(inp2[a]);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
>>
we are able to achieve 1 and 2 in the mapping.But we are not sure how to do the mapping for the Point 3 above.how to skip the E1EDP01 when there is a value in the code field.
Your requirement not completely understood.As per my understanding ,in the above example for 100 client.In IDOC1--> E1EDP01 should open once.
for 200 client in IDOC2 E1EDP01 should open twice (as both doesn't have code)
for 300 client in IDOC3 E1EDP01 should open only once(two of them having code value and one doesn't have)
For example say you have 400 client too which is having one record then E1EDP01 shouldn't open in IDOC4.
Did my understanding correct ?
If yes ,use the below logic :
CustomerNumber--->remove context----->sortbykey-->count(Staticfn)-->splitbyval(eachval)-->o/p1
CustomerNumber--->remove context----->sortbykey------------------------------->formatbyexample->o/p2
Code->mapwithdef(empty)->remocont->/
Customer Number--->remove context-->sort->splitbyvalue(valuechange)-/
o/p1-->try udf or std fns to check for empty value in o/p2 nad pass them to o/p.
o/p2-/
Let me know if you are not able to do it.I will do.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Use below mapping logic
Customer Number--->remove contect-->sort-->splitbyvalue(value change)-->collapseContext-->IDoc.
Customer context should be root node.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
Thanks for your reply, I have already done the header mapping creating one idoc for multiple customer records in the file.
My problem is segment E1EDP01 should be populated only when code value is blank. if the record has a value in the "Code" then that record should be skipped.
Thanks
Srinivas
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.