cancel
Showing results for 
Search instead for 
Did you mean: 

Reciever determination help

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hello Grzegorz,

firstly thanks for all you help.

In my case i think i would have to go for ASMA+DC, but i am really bad at JAVA, so can you please send me the JAVA code for UDF. Or can you send me the procedure for receivere determination steps.

I mean can you breifly explain steps to follow

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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

rajasekhar_reddy14
Active Contributor
0 Kudos

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

former_member184681
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hello Raj,

Thanks very much for your help, but if you dont mind can you please re-check the Java code,

it is throwing errors. It would be a great favour to me if you can help me out with this.

Chandrika

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Are you passing UDF method parameter as var1 ?  That's why you get this error. whatever name you pass in the method specifiy in the if condition accordingly.  Hope that helps

Former Member
0 Kudos

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.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Create UDF in message mapping and map UDF to root node of your target message.

Select receiver file adapter ASMA properties check box Directory.

Best Regards,

Raj

rajasekhar_reddy14
Active Contributor
0 Kudos

Before UDF you have to write a logic in PI Mapping using standard function to check wether  E1EDP02-ZEILE and QUAL=001 then send E as a input to UDF other wise NE.

rajasekhar_reddy14
Active Contributor
0 Kudos

Title is dynamic configuration UDF and mapped to root node of target message

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks all for you help Raj,

I mean it.

Answers (1)

Answers (1)

Former Member
0 Kudos

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...