on 12-29-2011 12:52 PM
Hi All,
I am working on a ABAP Proxy to File(FTP with FCC) scenario.
I have a requirement to place the file at FTP with naming schema XSP_SUPPLIER_CC_DD_MM_YYYY.csv.
I have checked many blogs which talks about Dynamic Configuration, but here the naming schema we fetch is from sender file adapter's ASMA(Adapeter Specific Message Attributes).
But in my case sender side is ABAP proxy.
How can I achieve this??
Please suggest.
Regards,
Sachi
Hi,
I have checked many blogs which talks about Dynamic Configuration, but here the naming schema we fetch is from sender file adapter's ASMA(Adapeter Specific Message Attributes).
>>> You dont need ASMA in your case. ASMA is used when you want to fetch additional message attributes which is not part of the standard payload
For your case use only Variable Substition. It will do the trick.
As suggested by fellow SDN Contributors used UDF to create the name of the file in required format and add variable substition on your reciever File communication channel.
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank You all for your replies.
Priyanka,
-- What should be sourceFiledValue(Supplier) in my case?
-- How can I use addtimestamphere(my requirement is DD_MM_YYYY)
Please explain me step wise how should I proceed with applying Dyanamic Configuration and variable substitution.
That would be helpful.
Regards,
Sachi
Hi,
I think, you no need to create the UDF.
1. At target message have a element "Filename"
2. For this Filename field in target map as following
Supplier Number
-
> conCat -
> Filename
DateTrans(Convert current date to DD_MM_YY)
3. Use Filename in your receiver file channel as variable substitution.
For variable substitution you can find various blog on SDN.
Regards
Ramesh
Hi,
Now I am able to place the file at the receiver FTP server with the naming convention XSP_SUPPLIER_CC_DD_MM_YYYY.csv.
But now the issue which I am facing is that in the csv file due to variable substitution current date is coming as the last field of each line item of the file.
I do not want the date to be placed inside the file with line Items. How can I acheive this??
Also, I am not able to understand that I have not Defined FileName parameter in Item.fieldNames as the last filed.
But still adapter is neither failing nor removing the date from line items end???
Why so??
>>I do not want the date to be placed inside the file with line Items. How can I acheive this
this is the problem with variable substitution where u bound to have the file name in ur target payload and u have to do some manipulations to eradicate this from the output csv file(already suggested above).....IMO using DC is always the best approach
refer this:
Hi Ramesh,
This is not working.
I have created FIlename as seperate note,instead of putting it in Item node.
The setting I used is as follows:
Recordset Structure: Header,Item,Filename
Header.fieldSeparator: |
Header.endSeparator: 'nl'
Item.fieldSeparator: |
Item.endSeparator: 'nl'
Item.fieldNames: IField1,IField2
Filename.fieldNames: Filename
Filename.fieldFixedLengths: 0
Filename.fixedLengthTooShortHandling: Cut
Output is coming as:
Name|Company
Sachi|Vodafone
Ravi|VISPL
Shashank|VF
30_12_2011
Please suggest.
Hi,
>> but here the naming schema we fetch is from sender file adapter's ASMA(Adapeter Specific Message Attributes).But in my case sender side is ABAP proxy.
You can use dynamic configuration to not only fetch values from message header you can use it to put values to message heade also.....you can write UDF (code will look like below) and in the UDF you can create string with required filename and concatinate it with the timestamp...
try {
String filename = "";
String timestamp = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = "XSP_SUPPLIER_CC_"sourceFiledValue(Supplier)addtimestamphere+".csv";
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
Supplier>UDF>TargetMessage
In the file receiver communication channel check the ASMA property target filename.
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can go for variable substitution on replacement pf ASMA.
Can you please create a variable in target side and assign currentdate to that field and used that variable in filename scheme.
Thanks,
Enivass
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.