cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic File, Directory names - File2File Scenario

Former Member
0 Kudos

We donot have message mapping in our Scenario ( Ftp file 2 Ftp file scenario ) where we like to change filename, directory before writing file on the target ftp server. Basically Dynamic configuration has to be manipulated based on file name pattern. How can we change Dynamic configuration variables without message mapping step.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

not possible without message mapping,

it can be possible via adapter modules,but thats much more work than mapping

Thanx

Aamir

Answers (2)

Answers (2)

bhavesh_kantilal
Active Contributor
0 Kudos

1.Adapter Module

2,. Variable Substitution if feasible

3 Or a Java Mapping that reads the input and pushes the output as such and just sets the filename is also an option.

Regards

Bhavesh

Former Member
0 Kudos

> 1.Adapter Module

> 2,. Variable Substitution if feasible

> 3 Or a Java Mapping that reads the input and pushes

> the output as such and just sets the filename is also

> an option.

Hi Bavesh,

1. Adapter Module takes time and in short period of time we shouldn't be able to do

2.Variable substitution needs Mapping

3.This approach also will be used Mapping Runtime right?..

Just by using configuration, Receiver det, Interface det we can route based on Filename .

I was actually trying to find out a simpler way to change dynamic configuration.

Thank you all for your replies and appreciated.

Former Member
0 Kudos

>>2.Variable substitution needs Mapping

not really,variable substitution is based upon payload of message not on message mapping.

the closest i can get to your requirement without message mapping is that you can combine variable substitution and dynamic configurations and can dynamically name the receiver file.but you can't manupilate this name,the name will be transferred as it is

Thanx

Aamir

ravi_raman2
Active Contributor
0 Kudos

All the solutions here are basically of no use as they are not applicable in the reciever adaptor..............you can change sender...details with these..

For changing the value of the reciever destination....only possible right way is to write an extension the the adaptor module and then pass in the parameters to it...............where you can specify a value..as a name value pair and trust me it is really easy....

Regards

Ravi Raman

bhavesh_kantilal
Active Contributor
0 Kudos

Ravi,

Maybe you can also explain why these options will not work.

The question is to set the Directory Dynamically and to do this, you can use any of the options i have pointed above taking into account ofcourse the fact that they are feasilble and fit youe entire design.

Regards

Bhavesh

justin_santhanam
Active Contributor
0 Kudos

>>>>>All the solutions here are basically of no use as they are not applicable in the reciever adaptor..............you can change sender...details with these..

Ravi, thanks for the information and thoughts on these solution. I never knew that we can't use Dynamic configuration or Variable Substitution in Receiver adapter.:-)

Aamir/Bhavesh do you guys knew that it's not possible in receiver adapter...

raj.

Message was edited by:

Raj

Former Member
0 Kudos

lolz:))

yeah as a matter of fact i started looking for SAP AG's number in my telephone directory so that i can inform them that their claim of Dynamic config. and Variable substitution being used on the receiver side is wrong and they should change the documentation:))

Aamir

Former Member
0 Kudos

> >>2.Variable substitution needs Mapping

> not really,variable substitution is based upon

> payload of message not on message mapping.

> the closest i can get to your requirement without

> message mapping is that you can combine variable

> substitution and dynamic configurations and can

> dynamically name the receiver file.but you can't

> manupilate this name,the name will be transferred as

> it is

Hi,

We donot want to get into Mapping at all. InFile in CSV format and Out file is same csv format.. No content conversion. So No Mapping. As Bhavesh suggested it can be done with java mapping with no parsing of source.

Former Member
0 Kudos

For such a simple task, you have to do more work.. SAP shoudl really come up with some rules based Scenario. We can add timestamp to file in the adapter but if client just want date then we need to do more as a developer. These adapters should have more options and more user friedly to customize with less time. You are talking about a packaged product and you shouldn't do too much customizing which is defficult to maintain.

ravi_raman2
Active Contributor
0 Kudos

Bhavesh, Aamir,

I am not as learned as you all are...However i have one doubt...

Can you tell me how..you would use variable substitution or any of the other features besides the dynamic Config bean...to make a decision..with this logic.

If(filename.equals(a)){

String dir = /usr/sap;

}

else if(filename.equals(b)){

String dir = /usr/pas;

}

Can someone please enlighten me as this is a problem i have had before and had to do a workaround on...

Regards

Ravi Raman

ravi_raman2
Active Contributor
0 Kudos

Raj,

You can use all of them in the reciever adaptor....However not in the scenario where you have to decide the destination directory based on a filename...

If you disagree...Could you give me a solution and i shall gladly agree and would love to implement your solution..

Also please dont read things literally...i said these solutions are no use here.......that doesent mean they are not possible....Hope you catch my drift.

Regards

Ravi Raman

Former Member
0 Kudos

>>However not in the scenario where you have to decide the destination directory based on a filename...

ofcourse you can define directory dynamically based upon filename,herez how to do

get the filename using dynamic configurations,use conf.get(key1).

after that have a if-else loop where in you create the directory based upon the filename and then put it in directory(dynamic configuration) using conf.put(key2,<dirValue>).then map it to the root node of the receiver field,enable file ASMA on sender side and directory ASMA on receiver side and give any dummy name for directory

you will basically use two instances of dynamic conf. one for getting the filename(key1) and the second one putting the directory name(key2)

Thanx

Aamir

justin_santhanam
Active Contributor
0 Kudos

I'm sorry Ravi, since I read the thread literally it got to these issues, any how apologize for it. Destination directory based on a filename, of course you can do it. You don't need to go for Modules, rather you can use DynamicConfiguration classes in ur UDF.

Cheers,

raj.

ravi_raman2
Active Contributor
0 Kudos

Raj,

I am sorry too, i know since i had this problem recently and what i did was create a couple of scenario`s and in each one exclude one file...as more than one file being excluded i am sure you know as well..doesnt work quite exactly.

Without mapping that is the only available solution, i would love to have a better way of doing it..though...

Regards

Ravi Raman

ravi_raman2
Active Contributor
0 Kudos

Aamir,

That sounds interesting, however ..i dont get the part about being able to do this without any mapping...Could you please clarify...your solution.............without the mapping as there is no mapping involved.

Regards

Ravi Raman

Former Member
0 Kudos

thats what we all have been telling Mr.S.T. that its not possible to do this without mapping(until and unless he develops adapter modules),its possible to name the receiver file dynamically same as the sender file without any mapping,but if he needs to do some manipulations then mapping is the easiest option

Thanx

Aamir

Former Member
0 Kudos

ohh i got one more option,its possible via scripts as well,he can deliver the file to any static directory on the receiver side,then execute a script to move this file to some other dynamic directory based upon the filename.

Thanx

Aamir

VijayKonam
Active Contributor
0 Kudos

Hi,

Why would some one implement XI for a file 2 file scenario? It is costlier in terms of development and maintenance. Instead, writing a separate program in any language like Java or C++ would be the perfect solution, where you have contro over manipulating the FTP file names and directories at runtime.

VJ.

Former Member
0 Kudos

Hi its not just File 2 File Scenario. Its basically content based routing using XI. Since the mapping is not required in our Scenario we donot want to add overhead introducing mapping.

Thanks.

justin_santhanam
Active Contributor
0 Kudos

ST,

Did u tried using Variable substitution? Doesn't it helps ur reqmt?

raj.