cancel
Showing results for 
Search instead for 
Did you mean: 

how to populate field value from filename of infopackage??

Former Member
0 Kudos

Hi friends,

I have an requirement in which i have to populate 0currency field based on the filename type.

if the file name contains 001 then 0currency should populate USD and if filename contains 002 then it should populate with EUR in 0currency.

here is a example:

File name: abc_001.csv --> 0currency should populate with USD

File name: abc_002.csv --> 0currency should populate with EUR.

i tried with RSSELDONE table but it is not working as we have routine in infopackage and rsseldone pick the filename if there is no routine else it will show the routine name of infopackage.

Please suggest better way how to resolve this issue, if you have any sample code please share with me.

thanks

Om Ambulker

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Om,

why cant you build two datasources and two transformations for each file and hardcode currency in the transformations.

Former Member
0 Kudos

Hi Sai, we have 32 such files from which i have to pull the filetype(001,002,003, etc), if we create two datasource one for USD and one for EUR then in  infopackage routine we have to check which filetype belong for which currency. from application server we will get the list of file name in a file and from there i have to identify the filetype and then populate the 0currency field.

example. file.txt contains

abc_001.csv

abc_002.csv

abc_003.csv

abc_004.csv

etc...

Regards,

Om Ambulker

Former Member
0 Kudos

Hi Om, could you share the solution for this scenario, which can be helpful to someone in the future

Former Member
0 Kudos

Hi Sai,

Still i didn't find the best solution of this problem. time being i created two data flow one for USD and one for EUR to populate 0currency field which i made constant in transformation. while reading the file from application server, if the filename contain filetype 001, 002 then i am loading in USD flow. same thing i am doing for EUR.

But this is not good practice to search a folder for twice and escape the files if it doesn't contain that file type.

i m looking for a solution which check the application folder once and based on the file type it populate the 0currency field.

Please help me if you have any solution of this problem.

Thanks,

Om Ambulker

Former Member
0 Kudos

Easy to maintain a column in your excel with your file name.

And don't map this in your target fields and write a start routine just to pick the currency based on this column.

This is the easiest workaround.

Cheers!

Former Member
0 Kudos

Hi suyash,

we don't have any authorization to create extra column in file on application server, i will get the file with all the filname of particular directory and load one by one file in BW based on their file type.

Regards,

Om Ambulker

Former Member
0 Kudos

have you tried this table

RSLDPIOT    InfoPackage Text Description see if it provides you the name of the infopackage that you desire..

Former Member
0 Kudos

Hi Amer,

we don't have filename over here, i have to populate 0currency field based on the filename not by the infopackage name.

Regards,

Om Ambulker