cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping error?

Former Member
0 Kudos

Hi,

I am running an interface which is erroring in sxmb_moni due to mapping issues.

When I check the mapping issues it states:

Runtime exception during processing target field mapping /ZRMD_A07/IDOC[2]/E1PLOGI/E1PITYP/E1P0015/ZUORD(suppressed field). The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@55f455f4] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ZRMD_A07/IDOC[2]/E1PLOGI/E1PITYP/E1P0015/ZUORD(suppressed field). The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@55f455f4]

The mapping it is refering to is a few lines of Java code (below) which I think picks up the file name. There is then a substring which identifies 8 characters from the filename.

String filename="";

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

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

try{

* filename = attrib.get(fileKey);*

* *

}

catch(Exception e)

{

* *

}

return filename;

This interface worked fine two weeks ago and nothing in the system has changed. Does anybody have any pointers on how to resolve this?

Thanks,

Nick.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Have you checked the dynamic configruration header in SXMB_MONI?

Is the filename available?

Former Member
0 Kudos

If you use a substring the stringindexoutofbounds exception occurs because yo do a substring of a string which is too short. It worked other times because this error depends on the string you made the substring.

Regards

Gonzalo

Answers (2)

Answers (2)

Former Member
0 Kudos

If you post the suspected Java code( from the mapping), we can have a look and help you

Regards

Gaurav

baskar_gopalakrishnan2
Active Contributor
0 Kudos

This is the problem. Your java coding uses substring function something like (0,7) to fetch portion of the string. if the substring does not able to parse 8 characters , it will obvious give stringoutofboundexception. Please check the filename which is more than 8 characters or less.

If you want , provide your coding here . we will fix it.

NOte: Since you declare statically 8 characters to use, if you dont have the substring length more than 8, you will hit always runtime exception stringoutofboundexception. Hope I answered your question. The problem occurs specific to your data and not always.

Former Member
0 Kudos

Hi guys,

thanks for the help.

The file name is G0XX_XXXXXXX_XXXXX_31-01-2011

So the substring should look at the 20th character and get the next 8.

This is where the error occurs. Any ideas why?

Thanks.

Nick.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Here is the code snippet...

String filename = "G0XX_XXXXXXX_XXXXX_31-01-2011".

String result = filename.substring(19,27);

Please let us know, if you need further support.

Note: Since index starts from 0, if you want 20th character as starting point, you have to specify starting point as 19.

since you want 8 characters from it, I specify number 27 as endpoint. If you want complete date like 31-01-2011, then specify as filename.substring(19,29);

Thanks

Baskar

Former Member
0 Kudos

Hi Baskar,

That didnt work, Is there a way to debug the Java code to deee what file anme it is actually picking up?

Any other ideas?

Thanks.

Nick.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

There are couple of ways to debug. I dont know whether you have ideas to debug using eclipse tool.

Please follow the below links

/people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio

/people/christian.drumm/blog/2008/09/30/debugging-java-mappings-using-sap-netweaver-developer-studio

Hope this might be helpful.