cancel
Showing results for 
Search instead for 
Did you mean: 

File to File Bypass -- Dynamic directory and file naming..!!

Former Member
0 Kudos

Hi All,

I am doing File to File Bypass scenario from SAP to NonSAP.

I need to pick the file from application server directory and post the same in receiver server.

The problem is, i have different Directories and the file names with clusters names like below

Dir : /zdata/glb/<b><cluster></b>/GLBSAP001/

File name : <b><Cluster></b>.GLBSAP001.csv

Clusters names will be like 0100,0500,0852,0489,...

Ex :

Dir : /zdata/glb/<b>0100</b>/GLBSAP001/

File Name : <b>0100</b>.GLBSAP001.csv

whenever the file comes into those directories i need to pick the file from there and place then in the below reciver servers dynamically.

Rx Dir : F:Data/ <Cluster>.

Rx File Name : <Cluster>.RCV.csv

Ex:

Dir : F: Data/0100

File name : 0100.RCV.csv.

How can i acheive this ??

whats the configuration i need to in communication channels to pick/place them dynamically??

Please sugget me and do the needful.

Thanks.

Regards

Seema.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Done

Former Member
0 Kudos

>>>File to File <b>Bypass</b>

What do you mean by Bypass here?

If you want to avoid mapping here (recommended for such scenarios) you cant use UDF. You have to do this inside an adapter module as explained by Henrique.

Regards,

Jai Shankar

nisarkhan_n
Active Contributor
0 Kudos

you can select the adapter specific attributes function in Sender CC, once you get the filename and directory from which it is picked, you can write the UDF to read this Dynamic configuration values and depending on this you can decide the which directory should be recievr

Former Member
0 Kudos

Hi Khan,

<i>// you can write the UDF to read this Dynamic configuration values and depending on this you can decide the which directory should be recievr //</i>

Can you please elaborate on this.

Dynamic configuration values has to be maintained anywhere??

After selecting the check boxes for both file and directory names,please elaborate the steps after that.

Thank you.

Regards

Seema.

Former Member
0 Kudos

This may give you hint

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

UDF that you are looking for also mentioned here...

santhosh_kumarv
Active Contributor
0 Kudos

Hi Reddy,

1. If u know the all the possible cluster value then u can configure an single CC to pick up files from different directories using the <b>Advanced Selection for SourceFile</b> in the File adapter proveded your transport protocol is NFS and not FTP.

2. Under the Adapter Specific message attribute check the options Filename and Directory so that these details are there in the Dynamic Configuration of the Payload.

3. This UDF will return the dource file directory.

Ex:/zdata/glb/<cluster>/GLBSAP001/

From this extract the cluster and map it to a field in the target structure so that the target payload has the cluster value.

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

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

String SourceFileDirectory = conf.get(key);

return SourceFileDirectory;

4. In the Receiver use the variable substution to name the file and determine the directory based upon the cluster value present in the target payload.

<a href="/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12 to the problem encountered using Variable Substitution with XI-SP12</a> By Sravya Talanki

Regards

San

<a href=" to set the thread to solved when you have received a solution</a>

Where There is a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/weblogs?blog=/weblogs/topic/16">blog</a> there is a Way.

Former Member
0 Kudos

The UDF :

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

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

<b>conf.put(key,fname);</b> // fname is the parameter that u are passing to this UDF

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

henrique_pinto
Active Contributor
0 Kudos

Since you don't have mapping (and creating one for this wouldn't be a good approach) you need to use a custom module adapter to handle these changes.

It can be placed in the receiver CC, before the CallSapAdapter module, in the module processor.

Check this blog for reference: /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules

Regards,

Henrique.