on 05-21-2015 11:58 AM
Hello,
I am sending IDOC to file, the file also contains same structure of IDOC, so no mapping is required, I want to use dynamic file name with the field in IDOC.
file name should be FIELD1_DDMMYYHHMMSS.xml
Here I don't have mapping, so with variable substitution can I get the "date and time stamp" after field?
any idea? how to get this? or else I need to use mapping mandatory?
Hi Khaja,
AFAIK variable substitution only permits to use variables with values in the payload or in the message header. Therefore you can use a OS command to append your filename the timestamp.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For tiemstamp you don't need script it's a parameter:
7. Select the Processing tab page.
8. Select the File Construction Mode.
○ Create
The file is created. The document received last is saved in each case.
If you want the created file to be overwritten, set the Overwrite Existing File indicator. If you do not set the indicator, processing is stopped until the created file is processed.
○ Append
The file is written when the inbound documents are appended.
○ Add Time Stamp
A new file is created for each document. A time stamp with the format yyyyMMdd-HHmmss-SSS is added to the file name. The time stamp is added as the last part of the name before the extension.
This mode guarantees that no file is overwritten. In this way, files that originate from the same adapter configuration can be sorted
Cheers,
Roberto.
Hi Robert,
i have not asking about the timestamp . in the above requirement he needs to get the field name that should be attached in the file name . so how will you get the field name with out mapping so as per the inaki's suggestion we need write the script to get the field value from the payload.
Thanks
Giridhar
Hi Giridhar,
May be i explain bad, you can get values from payload with variable substitution. With Roberto Cantero suggestion you will get a timestamp but not in the format that you need.
If you are under linux plattaform you can get some examples in internet like this linux - Adding timestamp to a filename with mv in BASH - Stack Overflow
Pay attention that you don't need a script with a line command will be enough, you can pass the filename as variable with %F, check the last example of how runnings an OS command provided in the first link of Roberto.
Regards.
Hi inaki,
Here the sender interface is IDOC. So how can i get the field name with out mapping that why i have asked the script to get the field name as file name. if it is a file to file scenario we can use the command you specified. but here it is an idoc and i need to get the field name . correct me if i am wrong.
Thanks
Giridhar
Hi Khaja,
Please check variable substitution under below link:
regards,
Roberto.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.