on 05-17-2012 10:22 AM
Hello experts,
I had recently developed a IDOC to file xml, the IDOC is INVOIC.INVOIC01. My requirement is i want the target xml file to be redirected to different folders when the field E1EDP01-E1EDP02-ZEILE when QUAL=001 is missing from the source side.
What i mean is i want to send the XML to folder A, if E1EDP01-E1EDP02-ZEILE when QUAL=001 is there in the source side. if the feild E1EDP01/E1EDP02/ZEILE when QUAL=001 is missing then the XML should be redirected to different folder with different file name.
I guess it is possible by using Xpath conditions in receiver determination. but i am not aware of the steps to be followed.
Can any one please help me out with this.
Regards
Chandrika
Hi Chandrika,
With use of conditions in Receiver Determination, your scenario would require lots of unnecessary work, because you would have to define a dummy receiver system only for the other directory & receiver communication channel. Instead, use Variable Substitution or Adapter-Specific Message Attributes + Dynamic Configuration to dynamically assign the target directory name during mapping, based on any content-based condition you like. Find more details about how to configure VS and ASMA+DC here: http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To understand and apply DC, Variable substitution, please check this link.. This wiki describes the difference and how to apply each of them in a simplest way...
http://wiki.sdn.sap.com/wiki/display/XI/Combining+three+different+aspects+of+PI+in+one+shot
Hope that helps
Hi,
First check in mapping use standard mapping function if E1EDP01-E1EDP02-ZEILE when QUAL=001 then send input to UDF as E or NE.
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
if(var1=="E")
{
Strind TDir="/directoirtyname/abc";
conf.put(key, TDir);
}
else
{
Strind TDir="/directoirtyname/123";
conf.put(key, TDir);
}
return "";
var1 argument to udf and select ASMA Properties directory name.
Best Regards,
Raj
Hi,
Use the following code (just a simple change, comparing to the code in the Wiki):
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
conf1.put(key1,input);
return input;
Simply set the execution type to Single Values and use one input parameter named input. In mapping, you need to provide the required directory (a constant or something, as required) as an input field for this UDF.
Regards,
Greg
This is my advice. There are plenty of code available for the dynamic configuration directory and file name lookup and updates.
Raja code has one typo issue..... Hope that causing the error... might be
if(var1=="E")
{
Strind TDir="/directoirtyname/abc";
conf.put(key, TDir);
}
else
{
Strind TDir="/directoirtyname/123";
conf.put(key, TDir);
}
Use String not Strind...
Directory name has spell error.. reference the directory name accordingly
Hello Baskar,
thanks for your help,
but it is still throwing the below error.
Source text of object Message Mapping: MM_Goodman_Invoice_Out | http://com.commscope.com/GoodmanXMLEDI/Invoice has syntax errors: |
My question might be dumb, but i have zero Java knowledge, please help me out.
Regards
Chandrika
Hello Baskar,
you are right, now UDF is ok but can you please help me where i have to use it'
to be honest i did not understand the below logic given by Raj. Can you please explain me.
First check in mapping use standard mapping function if E1EDP01-E1EDP02-ZEILE when QUAL=001 then send input to UDF as E or NE.
Hello Raj,
thanks for your help, but i have one more doubt.
where would i mention that to which directory the xml has to go if the condition is not satisfied.
i mean my actual requirement is as mentioned below
i want to send the XML to folder A, if E1EDP01-E1EDP02-ZEILE when QUAL=001 is there in the source side. if the feild E1EDP01/E1EDP02/ZEILE when QUAL=001 is missing then the XML should be redirected to different folder with different file name.
please explain me where i have to mention this different folder with different name?
Regards
Chandrika
Chandrika,
if you can do VS or DC as suggest above it will be better, but if at all you want to go with conditional receiver determination - you just need to click on condition portion of RD, it will redirect you to a window for setting condition using payload/xpath, you just follow the screen and you are done win setting XPath...
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.