on 05-20-2009 10:24 AM
Hi,
I have a requirement to send flat file from one place to another. The only thing that needs to be done is to change the receiver file name as per data in input flat file. I do not have any structure of flat file so I thought of using JAVA Mapping to accompolish this.
Input file (name = ABC.txt)
A123
B456
C789
D123
Now if the first character of a line is C and the 3rd position of that line is 8 then I have to change the receiver file name as "NY_ABC.txt".
Please suggest the java code that can be used in JAVA mapping for the above.
Ragards,
Madan Agrawal
Hi,
You can simply do this in graphical mapping by writing UDF. Fill a paramerter in target structure using the UDF for the file name. While configuring the file adapter at receiver side, use Adapter-Specific Message Attributes to fill the FileName parameter.
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solved.
Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer))
temp.write(buffer, 0, read);
String payload = temp.toString();
String Sections[];
Sections = payload.split("\\n");
for (i=0;i<Section.length;i++)
{
if((Section<i>.toString.indexOf('c') == 0) && (Section<i>.toString.indexOf('8') == 2)
// SET YOUR LOGIC FOR FILE NAME HERE
}
maybe that is something you are looking for. Might have to do a small tweak on the code yourself
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go through this link-
Configuring the Receiver File/FTP Adapter
http://help.sap.com/saphelp_nw04s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
Regards,
Chandra
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 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.