on 11-17-2014 3:20 PM
Hi All,
aI am generating file names dynamically using variable substitution in PI. So the file name gets created as Shop (G1). But we have requirement to remove the spaces from the file name and name the file as ShopG1. This comes in from the plant name field. So how can this be handled?
Regards,
Lavanya Ravi
I tried using replace string functionality and was successful in replacing the spaces in File name. But the problem is that the File name field is also appearing inside the file. I dont want the file name to be populated inside the file. Please help.
Regards,
Lavanya Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As i mentioned, it can be easily handled with dynamic configuration UDF.
Just pass your input field -> replace string -> UDF ->
String filename = new String("");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = var1;
conf1.put(key1,filename);
return filename;
Do you need to send this plant name information to your target system?
If so i don't see any issue. Just do a direct mapping and leave it.
If you don't need to send any value, then remove the mapping for that field(don't map anything).
if you don't want the tags/empty line(in case of FCC), create new DT,MT,SI without this plant name field.
I need to send the Plant name and i have mapped it one to one.
For File Name, i have mapped Plant Name -> Replace String -> UDF -> File Name.
Now because of this, the file name is also appearing in the file content.
The file should be in the below format:
Header Data Row
Record Data Row
But the file is now appearing as:
Header Data Row
Record Data Row
File Name
Now i dont want this File name to be a part of the file. I just want it to name my file dynamically.
Hi Lavanya,
With variable substitution you would need to delete the spaces in ESR mapping. Another solution is to use OS command, after proccessing, to delete the spaces. Linux: file rename - Remove whitespaces from filenames in Linux - Stack Overflow
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You might have to pass this value to target system as is but you want this change only for file name.
If so Instead of using the variable substitution go for dynamic configuration. Use replace all string function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.