cancel
Showing results for 
Search instead for 
Did you mean: 

File to file scenrio

swatantra_vijay3
Participant
0 Kudos

Hi

I am doing file to file scenario , i want to find the directory path at receiver dynamically on the basis of sender business service name

for eg if the file is coming from business service X101 then the file should go in folder X101

Any ideas

Regards

Swatantra

Accepted Solutions (0)

Answers (4)

Answers (4)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

This would be possible using Adapter Specific Identifiers and access to the runtime variables.

In your mapping , use the following code to read the Sender Business Service and then set the directory.

Just ensure that in your receievr file adapter Adapters Sepecific Identifiers --> Directory is selected.

java.util.Map map;
// get runtime constant map
map = container.getTransformationParameters();
//get Sender Business Service
String SenderService=(String) map.get("SenderService");
//Set file Directory to Sender Service.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key,SenderService);

Regards,

Bhavesh

Former Member
0 Kudos

Bhavesh,

Can you pls explain this. I have not used runtime variables much.

If I have the following code in my mapping, how will I configure the Receiver determination for this?

Regards,

Jai Shankar

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

This code can be used inside the Message Mapping in any UDF or in the Intilization Section of Java Section to get the Sender Business Service and then set it against the filename using the Adapter Specific Identifiers.

All the explanation for this code willbe on these 2 links,

http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

The advantage of using this code is that the configuration remains the same.

But, Vijay would need only one receiver File Communication channel and the Directory name would be used dynamically from the mapping in the run time.

Regards,

Bhavesh

moorthy
Active Contributor
0 Kudos

Hi,

Is your scemario contains different sender services ? If so , it is like different scenarios.

But if you want to dynamically put the file into folders, based on the some field in the payload, then using variable substitution option, you can handle it.

Regards,

moorthy

Former Member
0 Kudos

>>if the file is coming from business service X101 then the file should go in folder X101

I am not getting this. If the sender service differs, then obvoiusly you need to have different scenarios one for each sender service.

In run time, a receiver will be found out, only with the sender information. Sender Info means

1. Sender Service

2. Sender Interface

3. Sender Interface name space.

So even, if any one of the above varies, oyu will need a completely new scenario or else you will get an error in SXMB_MONI "NO RECIVER FOUND"

Regards,

Jai Shankar

Former Member
0 Kudos

In your outbound communication channel, can you define parameters in the variable substitution field?

swatantra_vijay3
Participant
0 Kudos

Hi Harrison

How i can use the sender business service name in varaible substituon option ???????????

Could you pls explain

Regards

Swatantra

Former Member
0 Kudos

What Jai said is a good point, with regards to a business service you should have different scenarios setup.

former_member192798
Active Contributor
0 Kudos

Hi Swatantra,

Refer to Variable Substitution sub heading from the below link:-

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Regards.

Praveen

Former Member
0 Kudos

Hi,

If the sender service is different, then Variable substitution will not help. There is no other way than configuring separate scenarios.

Regards,

Jai Shankar