on 03-27-2009 6:18 AM
Hi all,
I am using Adapter Specific Message Attributes(ASMA) to pick a file and place in another folder.
No Mapping is involved.In Communication channel no File content conversion is used.
The sent file is a .dat extension ,and i want the file with filename same at sender and receiver but with a .txt extension.
So,at sender XXXX.dat
at receiver XXXX.txt
How can i achieve this?
Thanks in Advance,
>
> Hi all,
>
> I am using Adapter Specific Message Attributes(ASMA) to pick a file and place in another folder.
> No Mapping is involved.In Communication channel no File content conversion is used.
> The sent file is a .dat extension ,and i want the file with filename same at sender and receiver but with a .txt extension.
>
> So,at sender XXXX.dat
> at receiver XXXX.txt
>
> How can i achieve this?
>
> Thanks in Advance,
you will have to use dynamic conf and change the extension.
the easiest way to achieve this is in a java mapping.
Just get the payload inside and pass the same out something like a dummy mapping and then in the code use the dynamic conf. to set the file name.
base these as ref:
https://wiki.sdn.sap.com/wiki/display/XI/WholePayloadtoaXML+field
/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.
configure the receiver file adapter filename as ..txt
no issues using this..
if need in details of this scenario go to wiki page of process integration and check there the entire is depicted in detail
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if i uncheck FileName in ASMA , and provide a file name with .txt in File Name Scheme, it works.
But if i check FileName in ASMA and provide *.txt in the File Name Scheme ,it doesnt.
I will be the getting the file with time stamp.so XXXX-<timestamp>.dat should be converted to
XXXX-<timestamp>.txt
Thanks
hi all,
i tried using UDF with Dynamic Configuration. But getting an error in Message mapping.
AS this is a dummy mapping , i created the following objects in IR:
Data type: File
Message type: File
Message Interface: mi__o_a & mi_i_a
Message Mapping: File_MM
Created a UDF and assigned the UDF to the target structure i.e.,
UDF->File
Interface Mapping: assigned File_MM
Created ID objects also.
And in Sender CC, selected ASMA,
In receiver CC selected ASMA and given the File Name Scheme as *
But still, getting an error in Message mapping,my code in UDF
DynamicConfiguration conf =
(DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File", "FileName");
String file = conf.get(key); --> i will get the filename as XXXX only ,with no extension such as .dat
String newfile = file+".txt";
conf.put(key, newfile);
return "";
Where am i wrong,
Please suggest
Thanks
If you are using mapping and a UDF, you have to convert the file in to XML. If not i would not work. If you are using ASMA, you need to have name as one of the fields in the payload.
So you have to use FCC to convert the file in to XML. Then use UDF to fill the dynamic configuration variables. Then complete the direcoty objects.
VJ
*If you are using ASMA, you need to have name as one of the fields in the payload.*
My scenario is to just pick the file and place in other folder.I also dont have a structure in IR . Just created a dummy DT,MT,MI etc. SO,how can i get a name of the field in the payload.
So you have to use FCC to convert the file in to XML.
As i do nto have a recordset structure, how can i apply FCC here.
Thanks
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.