on 02-24-2015 6:23 AM
Hi,
I have an existing scenario where a File name is maintained as Below,
Currently we have a new requirement where in the incoming Idoc if the MESFCT value is AA then we should have a new file name as"Billing_xxx_.xml" sent to the target, but for the existing scenario the MESFCT value will as BA or CD, where we use the same file name as above.
Please let me know how can this be achieved, without touching the existing scenario.
Hi All,
In the existing file name configuration i see the file output file name as follows,
INVOICE_0000000011111111_20150219-034114-978.xml
I can identify the Idoc number as "000000011111" and time stamp as "20150219", but i am not able to identify what the other values(034114-978) implies, even I can't find it in the XML file.
please any one tell what might be this value...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Selva
That is the time part of the timestamp - hour, minute, seconds and milliseconds.
Configuring the Receiver FTP Adapter - Advanced Adapter Engine - SAP Library
Add Time Stamp
A new file is created for each document. A time stamp with the formatyyyyMMdd-HHmmss-SSSis 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.
Rgds
Eng Swee
Message was edited by: Eng Swee Yeoh (added details from SAP library)
I am using UDF for getting two file names based on some field value condition. am getting the output but the file is coming with two time stamps, Can anyone tell how to avoid that, Even I tried changing the file construction mode to Create,but no luck.
Its Coming as
BILLING_0000000014588891_20150305-010612-82720150305-010613-077.xml
Actual file name should as:
BILLING_0000000014588891_20150305-010612-827.xml
Hi Selva,
The UDF is right, it is only generating one time stamp, the second time stamp is definitely coming from add time stamp option of file construction mode parameter in the channel.
Regards,
Praveen.
Hi,
I have proposed the new file name as below by just adding the MESFCT field in the Variable Substitution. But I have doubt whether the value of the file name will be fetched from the source payload or from the target payload. Since the MESFCT value 'AA' is coming in the input payload, but we not sending that value to the target system.
So if the value for the file name is fetching from Source payload then the below format will be correct/if not then I need to go for an alternate option.
INVOICE_0000000011111111_20150219-011111-979-AA.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Selva,
If you don't want to change the ESR development and not to introduce dynamic configuration as Praveen suggested, you could do a second configuration with a receiver rule, based in the field mesfct, and therefore you will set a new receiver channel with your new variable substitution and you will when the receiver condition will be false your old receiver configuration.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Selva,
You use below UDF. Excecution type is "Single Values", input fields are MESFCT and DOCNUM.
public String setFileName(String mesfct, String docnum, Container container) throws StreamTransformationException {
Map<String, Object> mapParameters = container.getInputHeader().getAll();
DynamicConfiguration conf = (DynamicConfiguration) mapParameters
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File",
"FileName");
String fileName = conf.get(KEY_FILENAME);
if (mesfct.equals("AA")) {
fileName = "Billing_xxx_.xml";
}else{
fileName = docnum;
}
conf.put(KEY_FILENAME, fileName);
return "";
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried using the below mapping and UDF to get the File names, I amnually sent data from RWB I am getting the required file names but I see in the output XML that MESFCT is coming with some exception value. Actually the field MESFCT should not appear in the output.
UDF:
public String getFileName(String MESFCT, String DOCNUM, Container container) throws StreamTransformationException{
try
{
String filename = new String("");
SimpleDateFormat dateformat =new SimpleDateFormat("yyyyMMdd-hhmmss-SSS");
String timestamp = dateformat.format(new Date());
if (MESFCT.equals("PL")) {
filename ="BILLING_PLANET_Shiire" +"_"+DOCNUM+"_"+timestamp+".xml"; }
else {
filename ="INVOICE" +"_"+DOCNUM+"_"+timestamp+".xml"; }
DynamicConfiguration DynConfg = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
DynConfg.put(key,filename);
return MESFCT;
}
catch(Exception e)
{
String exception =e.toString();
return exception;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.