cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter-Specific Attributes Retrieval

Former Member
0 Kudos

Hello,

I am trying to retrieve the filename from the sender message type to be used in the mapping. In order to achieve this I ticked the Adapter-Specific message properties on both Sender and receiver CC. I created a user-defined function FilenameY with the following code to retrieve the file name. I am not importing any packages.

//write your code here

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

Unfortunately I am getting the following message when I test mapping TESTMsgMapping. Any ideas why this is happening?????

RuntimeException in Message-Mapping transformation: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._TESTMsgMapping_ method FilenameY$[com.sap.aii.mappingtool.tf3.rt.Context@32a38dfd]

Thank you

Kathir

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Kathir,

If i understood it right, this attribute will be set at <b>runtime</b> by the file adapter. I don't think , this will be available at design time in your Test tab of mapping.

If you are able to activate the mapping program , go ahead, put a test file and you should be able to test it at runtime.

Regards

Saravana

Former Member
0 Kudos

Hello Saravana,

That is right we will only get the attribute values at Runtime (we cant test the mapping fully at designtime) but the problem is that I am getting a similar error message at runtime.

-


During the application mapping

com/sap/xi/tf/_TESTMsgMapping_ a

com.sap.aii.utilxi.misc.api.BaseRuntimeException

was thrown: RuntimeException in Message-Mapping

transformatio~

-


So I thought the above problem at runtime was down to the message during the message mapping. I am not using any parameters to pass values to the function or using any packages either. Any comments will be gratefully accepted.

Thank you

Kathir

Former Member
0 Kudos

Kathir,

If you check the Trace part of the message in MONI, you should see additional information on why this error occurred. Can you let know what this error trace says ?

Are you sure this error occurs because of this piece of code in ur mapping ? If you do not use this UDF , do u still get the error ? pls dbl chk this as well.

Since i am not yet in a higher SP, not in a position to test this out personally.

Regards

Saravana

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for all the help. I think the problem is something to do with 'CONTENT CONVERSION PARAMETERS' in SENDER CC. I have removed the user-function code from the mapping still having problems. Anyway since the problem is in Sender CC I will find a way to solve it.

Thanks again.

Kathir

prasad_ulagappan2
Contributor
0 Kudos

Hi Kathir,

I hope your issue has been solved.

This is regarding the UDF for accessing the adapter specific messages.

While writing the UDF, have u used the input arguments, or you haven't used any input arguments for the function?

If we need to give any arguments, then what it will be?

I believe that it is not necessary to use any input arguments for accessing the adapter specific messages? Am I correct?

Regards,

Prasad U

moorthy
Active Contributor
0 Kudos