cancel
Showing results for 
Search instead for 
Did you mean: 

Condition check (based on sender file name) at receiver determination step

Former Member
0 Kudos

Hi,

My scenario is File to AS2 (Sender side file adapter and receiver side AS2 adapter)

We have 5 customers, but the source location is same to pick the files, Here we are not using any ESR objects.

Based on the source file name PI need to determine to whoom this file need to send at receiver determination step

Craeted objects

1 Sender CC,

1 Sender agreement,

1 Receiver determination

5 Interface determinations

5 Receiver agreements

5 Receiver CCs.

Could you please provide me your valuable inputs.

Thanks

Ramesh

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member200962
Active Contributor
0 Kudos
Based on the source file name PI need to determine to whoom this file need to send at receiver determination step

Sender File Channel --> ASMA --> FileName

receiver Determination --> Condition Editor --> Select FileName (context Object)

This should work even when you dont have ESR/ IR objects

Regards,

Abhishek.

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Venkataramesh,

I understand your scenario as, picking files (different file naming standard for different target customer) from one source folder. Based on file name, that payload should be sent to corresponding target customer. You have mentioned u201CHere we are not using any ESR objectsu201D. I can see two reasons for this decision

1. PI is used to route the messages, i.e., no need to transform the payload. OR

2. Files can binary files like PDF, ZIP, JPG, GIFu2026

Now I can see two possible solutions

1. Simple solution, as proposed by u201CPrabhu Rajesh Janardananu201D, make it into 5 different scenarios (5 sender channels).

2. Bit complex solution, only one sender channel, using extended receiver determination

Step 1:- In Sender File channel check u201CAdapter u2013 Specific Message Adapteru201D in Advanced tab. File Name should be checked.

Step 2:- In Receiver Determination, Select Type of Receiver Determination as u201CExtendedu201D. http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce2a423a8e5430e10000000a42189b/frameset.htm

Step 3:- Do a Graphical Mapping (use it Operation Mapping in Receiver Determination).

Step 4:-

Source and target of graphical mapping will be same (below), because you donu2019t want to access input payload (it can be XML, flat file, JGP, GIF and you donu2019t have its structure).

<Receivers>
   <Receiver>
      <Party agency="" scheme=""></Party>
      <Service></Service>
   </Receiver>
</Receivers>

Step 5:- Write a UDF in Graphical mapping as below. http://help.sap.com/saphelp_nwpi71/helpdata/EN/43/03612cdecc6e76e10000000a422035/frameset.htm Pay attention to method declaration

public String Determine_Receiver( Container container) throws StreamTransformationException
{

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
String valueOld = conf.get(key);

//Put your logic here
if (valueOld.equal(u201Cuser1u201D)) {
return u201Cuser1u201D;}
if (valueOld.equal(u201Cuser2u201D)) {
return u201Cuser2u201D;}
if (valueOld.equal(u201Cuser3u201D)) {
return u201Cuser3u201D;}
}

Step 6: Now use this UDF to map to u201CReceiveru201D and u201C Serviceu201D.

This solution need more fine tuning.

Regards,

Raghu_Vamsee

Edited by: Raghu Vamsee on Jan 8, 2011 5:56 PM

Former Member
0 Kudos

one of the simple solution could be;

create 5 different folder in the same directory so that sender and receiver CC could do there jobs... like your wish.

OR

Provide a different naming conversions to the files in the source; sender CC will pick only those files and send it to respective CC

Edited by: Prabhu Rajesh Janardanan on Jan 8, 2011 5:37 PM