cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI 7.31 File Receiver Adapter ASMA - directory is ignored

0 Kudos
601

Hello guys,

First of all, thanks to all of you for so many nice answers for any question in our community. Really I've read a lot of posts relevant for ASMA parameters.

My problem is following.

in UDF I'm filling 2 parameters - FileName and Directory, and it is correct, because in trace I can see both of them, and the FileName is changed correctly. There is a lot of post on that UDF, so this is probably correct.

And for my example let make FileName_New.csv is result of the UDF.

BUT ...

in communication channel I have this Target directory:

\\servername\folder1\folder2\folder3

and I have got this:

\\servername\folder1\folder2\folder3\Filename_New.csv

Now what I need to do is that bellow folder3 will be folder4 but the name will be different for different plants - it means bellow folder3 will be structure something like

 ...FOLDER3\PLANT1 
           \PLANT2 
           \PLANT3

For my example my target path with file will be like that

ie. \\servername\folder1\folder2\folder3\PLANT1\Filename_New.csv

Now my question: what is the correct value for Directory in UDF

just PLANT1, or with \ ( \PLANT1 or \PLANT1\) or whole path with server name

I have tried all of them but still no success. What I have in my mind -> is Directory parameter allowed for URL path?

Thanks you guys for any help or info

Petr

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Hi Evgeniy,

I have found workaround - in UDF I put folder name before filename - PLANT1\Filename.csv

It works now, only manual work is that folder MUST exist in the path - user has to create it for each plant.

Just for future reference - you don't need to create DIRECTORY parameter, just FileName with folder name in the front.

Thanks a lot for your help

Petr

0 Kudos

Hi Evgeniy,

yes here you can see. what I will try now is to p[ut folder name in the front of the file name like PLANT1\Filename.csv

Petr

former_member190293
Active Contributor
0 Kudos

Hi Petr!

Just to be sure, did you set using ASMA Directory parameter in channel settings?

Regards, Evgeniy.

former_member190293
Active Contributor
0 Kudos

Hi Petr!

You should provide complete path (without file name) to the target directory for your "Directory" ASMA parameter.

Regards, Evgeniy.

0 Kudos

Hi Evgeniy,

in my real case I use BR as final folder name (PLANT1 from my example)

here is my UDF - but still the same result, Filename is changed, but Directory is still PROD

Any other idea?

thanks a lot for your fast replay

Petr

String DName = new String("");
String FName = new String("");
String NameSpace = "http:/"+"/sap.com/xi/XI/System/File";

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

DynamicConfigurationKey keyDir  = DynamicConfigurationKey.create( NameSpace, "Directory");
DynamicConfigurationKey keyFile = DynamicConfigurationKey.create( NameSpace, "FileName");

DName =  "\\\\servername\\folder1\\PDB\\export\\PROD\\" + varDirectory;
// PRDATA_MASTER_Timestamp.csv
FName =  varFileName + "." + varFileExt;

conf1.put(keyDir,DName);
conf1.put(keyFile,FName);

return varFileName;

0 Kudos

Ups sorry, picture is quite big, I did not expect that it will be so huge.

P.