cancel
Showing results for 
Search instead for 
Did you mean: 

Get source FileName - RuntimeException during test of Message Mapping

Former Member
0 Kudos

Hi,

Inside a graphical mapping, I want to get the source file name, and then use it.

For that I use Michal's post inside a UdF:

And that works perfectly during the treatment (File -> Mapping -> IDoc)...

But my problem is when I try to test my Message Mapping inside the I.R (see tab "Test"), I have a RuntimeException due to the fact that DynamicConfiguration does not exist (obviously!) in the SOAP.

So I tryed to encapsulate the line "String ourSourceFileName = conf.get(key);" by a try/catch or by using the method "containsKey", but I have always the same RuntimeException...

is there someone who know how to catch this exception ?

Regards

Mickael

Note: JavaDoc is: http://help.sap.com/javadocs/NW04S/current/pi/com/sap/aii/mapping/api/DynamicConfigurationKey.html

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

In fact, I found the good syntax:

try {

ourSourceFileName = (String)conf.get(key);

}

catch (Exception e) {

}

varun_k
Contributor
0 Kudos

Hi Mickael Huchet,

you will get the error when you test in graphical mapping. You should test the while scenario. then only you would get the desired result. If you want you can test it in Interface Mapping also. But it will show null value.

Regards,

Varun

Former Member
0 Kudos

Hi Progirl

yes... but it will be not really pratical for the maintenance to think everytimes that this "error" is not an error and to think to delete the link in order to realize a test and then to not forget to add (again) this link.

the risk is too important.

Hi Varun,

yes... but with the Test of Interface Mapping, I don't have the possibilty to see the Queue and all options than we have inside the Message Mapping... So it's will be not really practical for the maintenance.

The solution is really to catch this exception directly inside the UdF which generates this Exception.

I'm sure there is a Java solution for that, but not yet found the good syntax... I continue.

Regards.

Mickael

former_member190389
Active Contributor
0 Kudos

As the name suggest its a Runtime exception.

The conf object is null when we are testing it in Test but during runtime it is filled before execution of the Mapping by the Adapter Engine as soon as the file is picked..

If you want to see the o/p of the mapping (and not the exception) then temporarily detach the UDF from the target node. and then execute the test.

however If you want to test the UDF itself you can use NWDS or any editor to test it.