cancel
Showing results for 
Search instead for 
Did you mean: 

Values in a DynamicConfiguration must not be null

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos
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.

Former Member
0 Kudos

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?

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Dzmitry,

I have given FileName in the UDF coding and pointing towards the correct directory, but it shows the same error

Former Member
0 Kudos

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;

}