on 07-15-2011 9:18 AM
Hi Gurus,
Now I have a requirement, need to pull a file from one folder with name such as "ABCDEF.dat" and push the file to destination folder with name such as "GHIJKLMN.txt".
That's a directly pass through scenario without message mapping,although i know we can do the dynamically rename task with mapping program, but here how to implement the requirement???
anyone help to guide me would be much appreciated.
Thanks in advance.
anyone can show me some script snippet about the rename function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
please find the Script.
You need to call this script from File Adapter.
sh /usr/sap/XX/ima/PI/Test/TestScript.sh %F
#!/bin/sh
HOST='12.11.11.11'
USER='usnername'
PASSWD='Password'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
rename $1 Afterrename.txt
quit
END_SCRIPT
exit 0
i am not sure whether u are willing to go for adapter modules or not...but its one of the ways of defining dynamic name in a file to file pass through scenarions...
Chk this...
http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicfilenameinaFiletoFilepassthroughscenario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create 1 SA,1 RA, 1 Sender CC and 1 Receiver CC
Create 2 component 1 for sender and another for receiver.
Create 2 CC, one Sender CC which will pick the from one folder with name "ABCDEF.dat" and another Receiver channel which will place the file in destination folder with name "GHIJKLMN.txt"
while creating SA and RA Key parameters are comm component, interface name and namespace,
While creating the SA, mention the sender Comm Component and any dummy name in both interface name and namespace and
Check the checkbox "Sender as Virtual Receiver" in SA and mention the receiver Comm component.
while creating RA, interface name and namespace same as mentioned in the SA.
This will create the scenario without mapping and will FTP the file to destination server with different filename.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
refer - /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
you can give the file name in Receiver FTP communication channel if it is fixed. For dynamic filename other then timestamp you need to dynamically configure the file name.
Regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On the PI side, you can only do this using dynamic configuration. If you dont want to use mapping, you can try running an operational system command after the file has been sent. For example, you can save the files on a temporary FTP folder, and then send a command like "mv file file2". This takes the "file" and move to "file2" location, also changing the file name if required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
Please provide the logic of naming convention,
If its fixed for all the files (means same name) then you can only specify it in Receiver file adapter file name text box
as GHIJKLMN.txt
otherwise you can use varibale substitution
Or
SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
Processing Sequence
1 AF_Modules/DynamicConfigurationBean Local Enterprise Bean 1
2 CallSapAdapter Local Enterprise Bean 0
Module Configuration
1 key.0 insert http://sap.com/xi/XI/System/File FileName
1 value.0 Hello.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.