on 07-03-2008 3:19 AM
Hi
I have to add sequence number in the file name. How can i do that? everytime file generates it should pick up the latest file number.
Example File1 File2 File3. 1,2 and 3 are the sequnce number.
Regards
Hey
If you want counters in FTP then you need to store all the filenames in some ABAP table and then do a RFC look up in message mapping and assign the highest+1 number to the top node of receiver file structure,then in receiver file adapter use variable substitution/dynamic configuration and name the file with this number.
On a second note,why not use "Add message ID" option,it will not generate a counter but will uniquely identify the file(if thats what you want).
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use option add counter in the receiver file adapter's write mode.
Use help.sap or sdn search for such questions.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhavesh,
I couldn't find the answer in help thats why i posted in here.
This is option is only applicable for NFS not for FTP (From Help A new file is created for each document. The file name is extended with a counter, which is inserted before the file name extension (for example, default002.file). This selection is only available for the File System (NFS) transport protocol.)
Regards
ha, you are right and you got me there.With FTP adapter this is not possible.
Unless you want to write a custom class that stores and increments this counter and then sets the filename dynamically using the dynamic configuration you would need to use some other option on the ftp adapter.
Regards,
Bhavesh
Hi ria,
You can do this by dynamic file creation. Use this following code and cretate an UDF. The map the required file format to the target header structure as below;
UDF
sequence number:
IDENTIFIER is the parameter
Import com.bp.xi.util.*;
Code:
return ServiceUtil.getSequenceValue( IDENTIFIER, container, false );
Dynamic file:
Key & Value is the parameter
Code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get( StreamTransformationConstants.DYNAMIC_CONFIGURATION );
DynamicConfigurationKey confkey = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", Key );
conf.put( confkey, Value );
return "";
Input parameter "Key" is given a constant value"FileName"
Second parameter "Value" is the file pattern
Mapping
Constant(File)concat function sequence numberUDF ==> Dynami File udf ==>target header record.
In the receiver communication channel check the adapter specific function, filename
points if useful
regards,
Murugavel
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.