on 04-14-2009 7:44 AM
Hi,
my problem:
Type:RFC to File
I change the file name in message mapping.
when I call the RFC to send the data twice at the same time, both of the output file names are changed while I only want to change the second output file name.
thanks
Sam
Since you have changed the file name in MM so the file name is going to be changed every time you send the data.
But you can put some condition in MM while changing the file name (the condition can be based on some input fields).
Regards,
Madan Agrawal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had added the condition before changing the file name.
according the condition, the first output file name shouldnot be changed but using the file name setted in communication channel. I only want to change the second output file name.
MM's detail:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
if( var1[0].equals(var2[0]) )
{
try
{
conf.put(key, var3[0] );
trace.addWarning("NEW NAME" + var3[0] + " " + var1[0] );
}
catch( Exception e )
{
}
}
Regards,
Sam
Edited by: YONGHE ZHOU on Apr 14, 2009 9:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you elaborate more on your requirement in detail..........
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my option, the problem maybe is:
I call the RFC twice almost at the same time, the two files were output almost at the same time.
the second message mapping change the file name before the first output file was output. So the first output file name was also changed.
output file names:
END_FIFC002920090413-171534-053.dat
END_FIFC002920090413-171533-928.dat
the output file that I hope is
FIFC002920090413-171534-053.dat
END_FIFC002920090413-171533-928.dat
Best regards
Sam
We cannot send two messages at same time which almost impossible. Definitely there will be some time delay.
And regarding these two messages in XI, XI will create a message ID for each message and the messages are independent.
tell us the logic based on what RFC XML tag values you want to change the filename.........
YONGHE says..
The problem wasnot happened when I wasnot call the RFC twice to send data at the same time.
When you call the RFC second time then all values are reset so it treats the message as first message again. So you need to send the both data (1st RFC and 2nd RFC) in one RFC call and handle the mapping accordingly.
Regards,
madan Agrawal
normal data :
- <rfc:Z_IFCFR821_ZIFCTT82100010 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
- <T_ZIFCTS82100010>
- <item>
<ZZCOMBI>G000002G000002</ZZCOMBI>
<ZZKYKBN>*</ZZKYKBN>
<ENAME_VE />
<ENAME_Z5 />
</item>
</T_ZIFCTS82100010>
</rfc:Z_IFCFR821_ZIFCTT82100010>
dummy data:
- <rfc:Z_IFCFR821_ZIFCTT82100010 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
- <T_ZIFCTS82100010>
- <item>
<ZZCOMBI>G499999</ZZCOMBI>
<ZZKYKBN />
<ENAME_VE />
<ENAME_Z5 />
</item>
</T_ZIFCTS82100010>
</rfc:Z_IFCFR821_ZIFCTT82100010>
if ZZCOMBI equals G499999, change the output file name as END_FIFC0029
Best regards
Sam
pass <ZZCOMBI> tag value as input to the below UDF, Change your code accordingly
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
if( a.equals("G499999") )
{
try
{
conf.put(key, "END_FIFC0029" );
trace.addWarning("FileName Prefixed with END_" + );
}
catch( Exception e )
{
}
}
Edited by: Praveen Gujjeti on Apr 14, 2009 4:24 PM
Hi,Praveen
Thks 4 ur reply.
the logic of UDF now in my MM is the same as yours except that I pass by parameter.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
if( var1[0].equals(var2[0]) )
{
try
{
conf.put(key, var3[0] );
trace.addWarning("NEW NAME" + var3[0] + " " + var1[0] );
}
catch( Exception e )
{
trace.addWarning("..." );
throw new RuntimeException("...");
}
}
Best regards
Sam
Edited by: YONGHE ZHOU on Apr 14, 2009 1:31 PM
Hi,Praveen
Here is the source code :
public void HANS01_changeFileName(String[] var1, String[] var2, String[] var3, ResultList result, Container container) throws StreamTransformationException{
for(int i=0; i<var1.length; i++)
{
result.addValue(var1<i>);
}
MappingTrace trace = container.getTrace();
if( ( var2 == null ) || ( var2.length == 0 ) )
{
trace.addWarning( " Getting of dummy code from propety file failed: there is not the field in propety file " );
return;
}
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
if( var1[0].equals(var2[0]) )
{
try
{
conf.put(key, var3[0] );
trace.addWarning("NEW NAME" + var3[0] + " " + var1[0] );
}
catch( Exception e )
{
trace.addWarning("..." );
throw new RuntimeException("...");
}
}
}
Best regards
Sam
In my MM, the input values to these variables (var1, var2 and var3) are (<ZZCOMBI>array,G499999,END_FIFC0029) ,
var1 is an array of input <ZZCOMBI> item list;
var2 is get from a property file by call another UDF;
var3 is constant value.
the test input data :
I send the data for the first time:
- <rfc:Z_IFCFR821_ZIFCTT82100010 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
- <T_ZIFCTS82100010>
- <item>
<ZZCOMBI>G000002G000002</ZZCOMBI>
<ZZKYKBN>*</ZZKYKBN>
<ENAME_VE />
<ENAME_Z5 />
</item>
</T_ZIFCTS82100010>
</rfc:Z_IFCFR821_ZIFCTT82100010>
so the input values to these variables (var1, var2 and var3) are (G000002G000002,G499999,END_FIFC0029)
the output file name(File1) :END_FIFC002920090413-171534-053.dat
output record: G000002G000002
because the data what I send is the last record, the system send the dummy data for the second time by program.
- <rfc:Z_IFCFR821_ZIFCTT82100010 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
- <T_ZIFCTS82100010>
- <item>
<ZZCOMBI>G499999</ZZCOMBI>
<ZZKYKBN />
<ENAME_VE />
<ENAME_Z5 />
</item>
</T_ZIFCTS82100010>
</rfc:Z_IFCFR821_ZIFCTT82100010>
so the input values to these variables (var1, var2 and var3) are (G499999,G499999,END_FIFC0029)
the output file name(File2) :END_FIFC002920090413-171533-928.dat
output record: G499999
I find that File2(20090413-171533-928) was ouput before File1(20090413-171534-053 ) from the time stamp.
I am not sure about that "XI will create a message ID for each message and the messages are independent." as you mentioned above.
Best regards
Sam
Edited by: YONGHE ZHOU on Apr 15, 2009 3:59 AM
Hi Sam,
Are you using any BPM for your scenario?
>I find that File2(20090413-171533-928) was ouput before File1(20090413-171534-053 ) from the time stamp.
It can happen for the below possible reasons.
1. the delay between 2 RFC triggers might be in the order of milli seconds or seconds
2. the payload size of normal case might be greater than dummy data case.
3. the processing time in XI server for these messages at OS level cannot be predicted.
What you can do is provide some delay in between two RFC triggers say for example 10 seconds.
Regds,
- Gujjeti.
Hi,Gujjeti
thanks a lot for your analysis and suggestion:)
I'm not using any BPM for my scenario.
>1. the delay between 2 RFC triggers might be in the order of milli seconds or seconds
-->Yes it is. The second RFC trigger begins after the first RFC data being send.
>2. the payload size of normal case might be greater than dummy data case.
-->Yes. It's hard to make a conclusion only by the time stamp.
But the two output files both have only one record.
>3. the processing time in XI server for these messages at OS level cannot be predicted.
>What you can do is provide some delay in between two RFC triggers say for example 10 seconds.
-->I'll make an attempt.
Best regards.
Sam
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.