cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in creatin target directory?

Former Member
0 Kudos
52

Hi all,

iam doing idoc to file senario,in receiver side i have to create an xml file for that client have given some naming standards.

the file name at receiver side should like this <fileaname>_<plant>_<timestamp>.xml

filename we can give,but palnt will come from source structure so ihave to use that ,i have 6 different plants so the target directory should be created with diffetent plants. How to do it?How plant will dinamically come in target file name.

regards,

kumar

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

have a look at this blog that talks about generating filename dynamically.

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

try doing similar kind of stuff for directory.. for this write a UDF wherein you can pass Plant as parameter.. access directory name in dynamic configuration and overwrite it with Plant value..

in the same UDF you can also change filename to ur requirement ie <fileaname>_<plant>

option for adding timestamp can be found in receiver file adapter..

nisarkhan_n
Active Contributor
0 Kudos

Q. i have 6 different plants so the target directory should be created with diffetent plants. How to do it?How plant will dinamically come in target file name.?

Map the field from the source to the target strucutre and use this target field in your variable substuition as said in above replies.

Ex: file name in the adapter will be something like this %Plants%.txt

this plants is nothing but the fied in which value target strucutre,.....

check this blog you will get the details

santhosh_kumarv
Active Contributor
0 Kudos

Hi phani,

U should use dynamic configurations....

Have a look at the blogs..

<a href="/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i File Name using XI 3.0 SP12 Part - I</a> By Jayakrishnan Nair

<a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a> By Jayakrishnan Nair

Regards

San

there is a Way.

Former Member
0 Kudos

For creating the filename refer the above blogs as mentoned by Santhosh and for creating different directories for each plant you can use Variable substution in the file path.

santhosh_kumarv
Active Contributor
0 Kudos

Hi Kiran,

Have a look at this blogs for doing variable substution for determining the filename and directory during run time.....

<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

<a href="/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi interesting usage of Variable Substitution in XI</a> By Sameer Shadab

Regards

San

there is a Way.

Former Member
0 Kudos

I think you can use context handling.