on 01-25-2010 4:50 AM
Hi Friends,
I have a mapping requirement.I want to generate multiple idocs if a source segment X appear multiple times in the message and if X segment having field WERKS value start with P.
If X segment appear multiple times in source and field WERKS doesn't start with P, then dont create multiple idocs at target side.
I want to check WERKS value as P only for the first X segment,as if 1st segment contain WERKS value as P all other X segments in the message have same value by default.
Please help me with the complete mapping flow.
Thanks !!
Suresh.
Use the below mapping logic:
WERKS --> StartsWith (P) --> If (Then X) --> TargetIDOC_Node.
Blogs are given in your previous question on how to change the occurence of target IDOC strcuture....procedure will be similar
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhishek,
Thanks for the information !!
I have implemented the mapping logic provided by you. But this mapping is still not complete.
I wantt to generate multiple idocs at the target side whenever in the segment X the WERKS value is P.
But, whenever this condition satisfies the target multiple idocs should contain the same data of the parent nodes but the X segment data should vary based on the data multiple X segments in source.
For this i think i have to map source X with target X by using splitbyvalue. However i dont know how to fill the condition here.
Pls help !!
Regards,
Suresh.
I think useOneAsMany will fail as there is no field in the source with 1..1 occurence .... all the fields are repeating and hence the node function will throw an error saying more values found ..... if the source node ossurs just once in the entire message and you want to put that into the appropriate target nodes (repeatitive) then use the above function......otherwise as Suresh thought use the splitbyvalue.
Regards,
Abhishek.
Hi Experts,
I have mapped
1)WERKS(present in X segment) > StartsWith ('P'constant)-remove context--> If (Then X) --> WMMBXY( Target top node)
2) Source X with target X using Splitbyvalue(each value).
Now when i test the mapping with payload having WERKS as P and 3 'X' segments, i am getting the error
"cannot produce target element /ns0:Messages/ns0:Message1/WMMBXY[2]/idoc"
Please help !!
Regards,
Suresh.
1)WERKS(present in X segment) --> StartsWith ('P'constant)---remove context--> If (Then X) --> WMMBXY( Target top node)
Try this:
WERKS(mapByDefault-blank constant)-> StartsWith('P'constant)-remove context> If ( Then X->splitByValue)-->Target node.
2) Source X with target X using Splitbyvalue(each value).
Try this using useOneAsMany and splitByValue:
1st input(to useOneAsMany) would be the source field(from source header) and 2nd & 3rd inputs(to useOneAsMany) would be the repeating node in source message. Then use a splitByValue(Each Value) and map it to target field.
Hope this helps..
Regards
Soumen...
thanks for all the information !!
Now i have created the below mapping to whole structure except to the segment X and its fields where based on which multiple idocs need to get generated.
Source field>mapwithdefault----/
segment(X)-useoneasmany->target field
segment(X)\
Now i am trying to set the condition with source X segment with target top node.
I provide the requirement again:
If source field(in segment X) stars with P,then create multiple idocs at target (with same data in each idoc,only segment X changes)
WERKS(present in X segment) > StartsWith ('P'constant)-If (Then X,Else top source node) --> WMMBXY( Target top node).
With the above mapping multiple idocs are not generating.
Suppose if i use ifwithoutelse function and WERKS starts with P then multiple idocs are generating perfectly.
WERKS(present in X segment) > StartsWith ('P'constant)-If (Then-X)--> WMMBXY( Target top node).
But if WERKS is not P then nothing is generating at the target side.
Please help !!
Regards,
Suresh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Change the occurence of IDOC to unbounded by exporting the XSD to local system, changing the occurrence manually & importing as external definition.
And use the logic Avishek suggested.
Regards
Soumen...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.