on 10-27-2010 3:26 PM
Hi,
My scenario is Idoc to multiple file scenario..
I need to drop 2 files at the target with the file names to be configured dynamically, at present i have used dynamic UDF to drop the files with the dynamic name. but i am getting the output files with the same name i mean the name which i used in the second structure.
eg: Input -- IDOC
ouput: i need to have abc.idocnumber.sysdate.xml & xyz.idocnumber.sysdate.xml
But now we are getting as xyz.idocnumber.sysdate.msgid.xml & xyz.idocnumber.sysdate.xml
so correct me if i am wrong .. i should not use 2 dynamic UDF in a single scenario..
else can i use variable substitution for one structure and Dynamic UDF for another structure..
please suggest some solution
Thanks,
--Kishore
when say "Idoc to multiple file scenario", could you clarify:
IDOC to multiple files of same type or
IDOC to multiple files of different types ?
Regards
Liang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Liang,
Let me expain the complete scenario..
Source is Idoc.. of DESADV type and at the target side we have 2 differient structures, so for the 2 different structure we need to configure dynamic file naming configuration. i mean the out put file naming convention should be dynamically configured.
I have used the dynamic UDF for both the structures as a result i am getting the 2 output files at the target directory with the same name. ( for the first file the messageid is getting appended and for the next 2nd file drops as we required) with same extension type.
But as i am dropping 2 different structure of files how could i configure.
will variable substitution resolves my issue. But when i use variable substitution can i append system date for the output file, reason being system date is not coming in the input file. how to capture the system date using variable substitution.
Request you to throw some light to solve this issue..
Thanks,
--Kishore
Hi Kishore,
you can append the system date to the filename of the receiver.
Try the below code:
SimpleDateFormat simpledatFormat = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
String datewithYear = simpledatFormat.format(date);
SimpleDateFormat simpledatFormat1 = new SimpleDateFormat("HHmmss");
Date date1 = new Date();
String datewithMs = simpledatFormat1.format(date1);
DynamicConfiguration conf = ((DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION));
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/""/""sap.com""/""xi""/""XI""/""System""/""File" , "FileName");
String oldFileName=conf.get(key);
String valueNew;
if( oldFileName == null){
valueNew = "HRXML"datewithYeardatewithMs+".xml";
}
else{
valueNew =oldFileNamedatewithYeardatewithMs+".xml";
}
//set the new filename
conf.put(key, valueNew);
Are you using multi-mapping? If so Dynamic configuration does not work.
Hi, Kishore:
Sorry to get back to you late.
Just wonder if the issue solved or not.
I did very similar scenario recently, here I share with you.
When I design targe strucuture, I created a additional node, let us called "Tail"
Under Node Tail, I create a sub-node called "Filename", this value will be used as variable substitution in receiver adapter.
Now you can map any value to node "Filename" now based on your requirements, include your system date.
In Receiver FCC, you do not want "Tail" structure it create a line, or even blank line, you use following in FCC:
Tail.fieldFixedLengths 0
Tail.fixedLengthTooShortHandling Cut
Tail.endSeparator '0'
It worked for me.
Regards
Liang
for multimapping scenario, dynamic configuration will not work.
you will have to go for variable substitution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shabarish,
Can i use Dynamic configuration for one structure and Variable substitution for another structure.
and the another clarification was In variable substitution is it possible to capture sysdate, sysdate is not in payload. the required output file should be as below..
abc.IDOCNUM.SYSDATE.XML
As the sysdate is not in payload how to capture this field when we add timestamp whichis available in communication channel the requirement doesnot require the time, the requirement is only i need to drop the file with the sysdate. could you please throw some inputs to drive towards solution..
Thanks,
--Kishore
Hi Shabarish,
Having an issue when i use variable substituion .. can u clarify this..
When i use variable substitution the value i can populate from the target structure but the idoc number i am not getting anywhere in the target structure.. in this case how to get this idoc number..
Thanks,
--Kishore
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
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.