on 04-14-2009 12:19 AM
Hello Experts,
Source Message
HDR
Name
MainMeasure
DTL
Measure
Serial
Target Message
Message1
Name_target
Serial_target
Mapping
Name maps directly to Name_target
If MainMeasure = Measure then Map Serial to Serial_target
File that comes in is a flatfile
HDR001 ProdName1 EA 000001
DTL001 ProdName1 CS 000002
DTL002 ProdName1 EA 000003
DTL003 ProdName1 EA 000004
When I map i only want it to map DTL002 and DTL003 because that is the only instance where MainMeasure = Measure. So it should only create if the condition is met for serial.
Currently I get both
Just the CS one has no serial.
Any help is appreciated.
Chirag
Hi,
Source Message
HDR 1
Name
MainMeasure
DTL ---1..unbounded
Measure
Serial
Target Message
Message1
Name_target
Serial_target
MainMeasure--
Measure--removeContext
MainMeasure--
/ then map Name to Name_Target
Measure--removeContext
for Serial source node also same as above intead of name map Serial source to target fields accordingly
Thanks and Regards,
Kubra fatima
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Everyone for the responses.. i tried all the methods explained above but still have a problems
Rita - Tired this before, Get an error because the first DTL is CS. Works if the first DTL is EA.. but that means it never looks at 2nd DTL.
Sweta - Is this the same as doing it graphical. Basically instead of checking MainMeasure = Measure.. you are storing it in a variable? Also It wont look at DTL until it already has mapped 'Name' If it Maps name then I will get data without Serials.
Pavan - I already have in place.
Kubra - I tried this method but i am getting a mapping exception error when DTL is CS first.
Error - <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
So what i explained was a narrowed down version of this
First Image is Graphical Mappin
http://i9.photobucket.com/albums/a68/tkc204/mapping_details.png
Image 2
Is the Mapping at the Message. This is the part that is causing the issue when the HDR Measure isnt the same as the DTL Measure.
http://i9.photobucket.com/albums/a68/tkc204/message.png
Image 3
Mapping of serial number
http://i9.photobucket.com/albums/a68/tkc204/gtin.png
I tried going with XSLT but i ran into a problem comparing two elements.
Hi,
As per your source and target structure screen shot you should do the mapping like below.
1.MT_MaterialIn_custom structure is (1-Unbounded). Because depending up on the detail record you are creating the target.
Mapping:
1.MainUOMUseOneAsManyEqualsS-RemovecontextCreateIf---MT_MaterialIn_custom
DETAIL -- UOM--
UOM --
2.ProductUseOneAsMany-Product
Detail --
UOM --
What are the header field you having you should map the target with UseOneAsMany function.
3.GTN--GTN.
For Detail Records directly map to the target.No need of any conditions.
Regards,
Prakasu.M
Prakasu.. after further investigation I got your method to work.. Inside Test mode in the IR. but once its run through XI it fails.
Then i review it and made a few tweaks, and it works, thanks so much for the help
Much Apperciated.. Only been developing in XI for 2 months. And I'm the primary develop/support for it
Hi Chirag,
Try this......
Add 2 variables(var1 and var2) under target node.
right click on the target node - select add variable.
In var1, save the output of the Mainmeasure.(direct mapping Mainmeasure to var1)
In var2,save the output of the Measure(direct mapping Measure to var2)
Now if var1 = var2 then map serial to serial_target.
if serial_target occurence is 1.1, if the above mapping fails,it will throw an error.else it wont.
to solve that error, you can map else mapwithdefault() in the nodefunctions.
Please let me know if want any more details.
Thanks & Regards,
Pragathi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Chandra.. Tried changing the context and that failed to work. Got the same error.
Prakasu - Thanks for the effort, I tried your method but now im getting an error for all messages.
This is the error.
<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Turkey_MaterialInCustom_BPM_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
Hi
You can use the Standard function available in graphical mapping.
main mesure-->equals(under text function)->
Measure--
>serial_target.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this:
1. When you are mapping Name to Name_target then save the 'MainMeasure' Value in a global Container Variable using UDF.
Code to store Global container Value:
public String setGlobalContainer(String globalContainerName,String globalContainerValue,Container container){
AbstractTrace trace = container.getTrace();
GlobalContainer gc = container.getGlobalContainer();
gc.setParameter(globalContainerName,globalContainerValue);
return globalContainerValue;
2. When you are mapping serial to Serial_target then get the 'Main'Measure' Value you stored above using UDF and compare it with current DTL- Measure. If it is same then create the Serial_traget.
Code to get the global container Value
public String getGlobalContainer(String globalContainer,Container container){
AbstractTrace trace = container.getTrace();
String gctmp;
GlobalContainer gc = container.getGlobalContainer();
gctmp = (String) gc.getParameter(globalContainer);
return gctmp;
}
Regards,
Shweta.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
1) You can easily achive this by using node Functions like If else conditions functions
2) If still if it is complex go for UDF's
3) Or else just try to give condition in the Routing Steps giving condition in the X path I mean Receiver determination Condition Step then only it will process to Receiver other wise leave it
4) simply achive in BPM using Correlation Conept but it may issue performance issues but as the above fields are less I think it wont make any issue and hence u can easily go for BPM also no issues.
Regards::
Amar Srinivas ELi
Hi Chrag,
Map your target message root node (say "TargetMessage") with the condition "If MainMeasure = Measure"
Try:
MainMeasure =(equals) Measure -> createIf -> TargetMessage
Br,
Ritu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.