on 12-17-2009 6:15 AM
In File to RFC to File synchronous method without BPM , i need to populate the file name for the receiver file dynamically.
So i have used UDF in RFC to File message mapping.
Z_RFC MT_RCV_FILE
FILENAME FILENAME
ITAB_OUT----
ITAB_OUT
item -
item
STR1 -
STR
Created a UDF for FILENAME as below:
FILENAME -
> UDF -
> FILENAME
and coded as below:
try{
String FILENAME = " ";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FILENAME");
FILENAME = conf.get(key);
conf.put(key, FILENAME);
return FILENAME;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
when i test the mapping it shows an error :java.lang.NullPointerException
and while doing a full test it shows :
java.lang.IllegalArgumentException: Values in a DynamicConfiguration must not be null in SXMB_MONI
can anybody guide me to solve this error.
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FILENAME");
Use FileName instead of FILENAME in above statement
And the testing should be done end-to-end.....do not test the mapping in IR.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhisek,
I have changed it to FileName and when i do a end-to-end testing it shows
Error: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '20000000Test2222222220 Pass1')', probably configuration error in file adapter (XML parser error)'
The strucute of receiver File:
MT_RCV_FILE
FILENAME 0 .....1
ITAB_OUT 0......1
item 0.....unbounded
STR1 0......1
In the receiver CC i have given the following parameters:
Target directory : /home/ftpusr/test/out
File name scheme : *
Content Conversion
ITAB_OUT.fieldFixedLengths 30,255
ITAB_OUT.endSeparator : 'nl'
item.addHeaderLine : 0
item.fieldFixedLengths : 255
item.endSeparator : 'nl'
where could be the problem?
Hello,
No problem in you scenario.
You have error during test your mapping because you use RUNTIME function. When you put file in proper directory all should work properly like in real life.
And also use 'FileName' in Dynamic Cconfiguration.
BR,
Dzmitry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the message mapping, a field FILENAME is present which was mapped to a UDF with the below coding, and this was made to point to the Receiver structure's topnode to make it working.
try{
String FILENAME = " ";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key, var1);
return " ";
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.