on 07-04-2011 11:27 AM
Dear Team,
Please find the source and target structures..
Source ::
->MT
-->records
--->matnr
--->batch
--->submatnr(s)
Target::
->ZRFC
-->Import
--->Item
-
>matnr
-
>batch
-
>submatnr
1) It is SOAP to RFC scenario. In Source strcuture for one matnr , we have one or more submatnrs.
2)RFC in R/3 contains Import parameters as..matnr,batch,submatnr(onlyone).
3)I want to build mapping - for each submatnr in source I want to create one complete record in target .i.e
if matnr contains 2 submatnrs in source , i want to create 2 records at target side like
first record - matnr,batch,submatnr
second record - matnr,batch,submatnr.
here in both records the matnr and batch values are same , which we have taken from source but submatnrs changed.
Can any body help me how to build mapping.
-Drumi
Hi,
submatnr --> removeContext -->Item. This will create one item record for each submatnr.
For duplicating the values of matnr and batch as per the no of submatnrs under that matnr, use function useOneasMany under node functions.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Drumi,
Suppose in your source you have two submatnr, in this case how your Source data looks?
Please paste your data here.
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,
I assumed that submatnr occurance 1 to unbounded...
here is the logic
map
Submatnr----->SplibyValue(ValueChange)-->RemoveContect-->Item
matnr1---->useoneAsmany(1st argument Matnr1,second and third arugument submatnr)--->splitbyValue(EachValue)-->Matnr1.
batch1---->useoneAsmany(1st argument batch11,second and third arugument submatnr)--->splitbyValue(EachValue)-->batch1
submatnr-->removecontext-->splitbyevalue(eachvalue)--->submatnr
Regards,
Raj
Hi Raj,
Its working fine for one record. but its not working for 2,3 recordsetc .
EX::
matnr1
batch1
submatnr
submatnr
submatnr
matnr2
batch2
submatnr
submatnr
submatnr
its giving error like...
"Too many values in the first queue in function useOneAsMany. It must have the same number of contexts as the second queue]"
I have tried to change the contexts ,no luck. UDF required for multiple records.
refer this link for same issue..
Thanks.
-Drumi
Hi Raj,
issue solved with this UDF. built the mapping as mentioned below. now its working fine for multiple records and for multiple submatnr's in same record.
cache:: context
inputs:matnr/batch, submatnr
for(int i=0;i<b.length;i++){
for(int j=0;j<a.length;j++){
result.addValue(a[j]);
}
if(i!=b.length-1){
result.addValue(ResultList.CC);
}
}
to item in target:
submatnr[context in MessageType, not in records]->splitbyvalue[eachvalue]->removecontext->item
to matnr in target:
matnr and submatnr(both in context record )->UDF->matnr
to batch in target:
batch and submatnr(both in context record )->UDF->batch
to submatnr in target:
submatnr[context in MessageType, not in records]->removecontext->splitbyvalue[eachvalue]->submatnr
-Drumi
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.