cancel
Showing results for 
Search instead for 
Did you mean: 

File redirection

Former Member
0 Kudos

Hello Experts,

I have recently developed a Invoice Idoc to CSV file interface.

I have a requirement to redirect the target CSV file to different directory when Inovice amount i.e.. E1EDSO1/SUMME from source IDOC is equal to 0.

Can any one please tell me how to accomplish this without using Dynamic configuration.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member190624
Active Contributor
0 Kudos

Hi Sridhar,

public String Redirect(String var1, String SUMME Container container) throws StreamTransformationException{

DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");

int i= Integer.parseInt(SUMID);

if(i== 0)

{

String TDir="Alternate folder path";

conf.put(key, TDir);

}

else

{

String TDir="Regular folder path";

conf.put(key, TDir);

}

return "";

}

Let me know the result.

Regards

Hari.

Answers (1)

Answers (1)

former_member189387
Active Contributor
0 Kudos

Hi ,

You can use condition in Interface determination .Then you need to create 2 different CC.

Former Member
0 Kudos

Hi Rajan,

you mean, do i have to create 2 different communication channels with two different Business components.

Regards

former_member189387
Active Contributor
0 Kudos

Hi Sridhar ,

1. One interface determination , with 2 diffrent receivers based one condition either one could be selected .

2.  Two different receiver agreement .

(Else )

But you can try to define  Variable Substitution for Target Directory/File Name

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/44/6a316af5a23672e10000000a114a6b/content.htm

Former Member
0 Kudos

Hi Rajan,

I am getting error saying that object already exists when i am trying to create another receiver agreement.

Let me make my self clear; i need to create two CC, two receiver conditions in Interface determination and 2 receiver agreements.

Regards

former_member189387
Active Contributor
0 Kudos

Hi Sridhar ,

Let me make my self clear; i need to create two CC, two receiver conditions in Interface determination and 2 receiver agreements.

I misinterpreted , In your case it is simple condition hence

  1. In Receiver determination (  Type standard )

     1.  create condition with  E1EDSO1/SUMME = O  then assign an business component [ For this you need to create and Interface determination and receiver agreement .

    2.  create another  condition with  E1EDSO1/SUMME not equals  O  then assign an business component [ For this you need to create an Interface determination and receiver agreement .

   Hence 2 different cc with different directory paths . Hope this clarifies .

But it is better to use dynamic config /Variable substitution .

Please revert in case of any issues ..

Former Member
0 Kudos

Hi Rajan,

The above trick seems to be working but.................can you please help me with the condition in Receiver Determination

I want the condition if E1EDSO1/SUMME = O

when E1EDSO1/SUMID = 011

I am really new to PI and have no Idea on Xpath conditions.

Regards

Former Member
0 Kudos

you have to refer SCN before posting this kind of Questions( can you please help me with the condition in Receiver Determination ) because no of threads are availble in SCN.

for ex refer : abhishek salvi Blog

http://scn.sap.com/people/abhishek.salvi/blog/2009/07/15/sap-pi71-receiver-determination-xpath-and-y...

former_member189387
Active Contributor
0 Kudos

Hi ,

As said , there are number of blogs ,

The following blogs image shows how to define .. Just get into the system you can easily define but using given options

http://scn.sap.com/servlet/JiveServlet/showImage/38-50187-60025/ReceiverDetermination.JPG

Former Member
0 Kudos

Hi Sankar,

Thanks for the info, but can you please help me with the above, because its a urgent requirement.................no time to learn and read.

Regards