cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime exception when processing target-field

Former Member
0 Kudos

Hi Exports.....

I have a small issue while running the interface am getting below error..

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!--

Request Message Mapping

-->

- <SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_BillingOfBilledCNotes_</SAP:P1>

<SAP:P2>com.sap.aii.mappingtool.tf7.MessageMappingExceptio</SAP:P2>

<SAP:P3>n: Runtime exception when processing target-field</SAP:P3>

<SAP:P4>mapping /ns0:MT_BillingOfBilledCNotes_IB/BillingO~</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_BillingOfBilledCNotes_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns0:MT_BillingOfBilledCNotes_IB/BillingO~</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

i


i   I know it is mapping error, for checking  i take the payload from the MONI and tested it, while testing one field is not working.It is not a mandatory field the occerence of this field is (0.1).

Based on that field only data is flowing to receiver. while testing with DISPLAY QUEUE method..i got below error ..

  sub string (0..4)

Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 4] in class com.sap.aii.mappingtool.flib7.TextFunctions method substring[, 0, 4, com.sap.aii.mappingtool.tf7.rt.Context@69b485e2]

sub string (5..7) similarly i got  for same sub string (8..10)

Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 7] in class com.sap.aii.mappingtool.flib7.TextFunctions method substring[, 5, 2, com.sap.aii.mappingtool.tf7.rt.Context@1a5e1094]


BElow is the field mapping::::

It is not a mandatory field but why it is not sent to receiver,some of the records flows correctly...

   (:::am expecting because of huge data it is not flows but we are not mention any thing for this.. if huge data will come it is successful in PI system right )

please help out..

Thanks in advance..

Regards,

rajireddy P



Accepted Solutions (0)

Answers (5)

Answers (5)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

Some of the records flow correctly because the parent node was not created e.g

Parent 0..1

--> BSTDK 0..1

When Parent node is not created via mapping logic, it would not matter if the logic in BSTDK would result in an error because it will be ignored by parser. However, when Parent node is created, the logic of BSTDK would now matter because that logic will be executed by the parser.

In your case, just use a UDF substring and add a checking component to prevent any runtime errors.

Regards,

Mark

Former Member
0 Kudos

Hi Dihiansan,

can u explan breafly..

What is  the parent node here, whn it is created...

regards,

raj

azharshaikh
Active Contributor
0 Kudos

Hi,

In addition, 1 of the MM approach would be as follows:

Regards,

Azhar

former_member191435
Contributor
0 Kudos

before substring use concat every field with 4 spaces in constant like below...

here you have to spaces like you mention the length in substring.....

Thanks,

Sreenivas

sandip_hole
Participant
0 Kudos

Hi RajiReddy,

Although the target field is optional, at runtime the java code behind standard function gets executed.

So please make sure you check the lengths of the source fields before applying SubString functions.

If the length is greeter than 4, 7, 10 characters in respective source fields then apply SubString function.

Thanks,

Sandip

Former Member
0 Kudos

Hi,

Though the target field is optional.

You have introduced a substring function which checks for mandatory input length. In your case DSR_INVDATE, the lenghth of characters should be always greater than or equal to 11 characters (i believe the second and third input source element is DSR_INVDATE again ?).

Please do check the entire context for any value whose string length is less than 11 characters which should be causing the failure.

Thanks,

Sudhansu

Former Member
0 Kudos

Hi Sudhansukumar,

the length of all should be same because it is a date formate only...

like [2014-11-01]

Former Member
0 Kudos

Hi,

Could you please confirm if third source field is DSR_INVDATE ?

If yes, as you have said date format is always "2014-11-01" which is equal to 10 characters. So either you have to take a substring(8..10) that means you are trying to select the value from 9th character to 11th character. Which is not matching the date field (= 10 characters). Hence you see an error StringIndexOutOfBoundsException

Please note when you start a count you staart the count from "0" and not from "1".

hope i am able to clarify your question.

Thanks,

Sudhansu

Former Member
0 Kudos

Hi Sudhansukumar Behera,

Thank u for ur information,

I have seen the difference for successful record and failure record it small difference the data means DSR_INVDATE field is empty for one record..

is this a  problem? but the occurrence of sender is (0..1) only receiver field also the occurrence is (0..1)

regards,

raji..

Former Member
0 Kudos

Hi,

Yes, receiving an value empty could also fail the mapping.

Please note even though the sender and receiver is 0..1. The mapping fails during validating the substring function which expects the expected set of characters as i mentioned earlier.

In this case mapping is stopped/fails at the substring function  and does not reach till the target field which is 0..1.

Thanks,

Sudhansu

Former Member
0 Kudos

hi

thank you for your helpful solution...

Than k u..

regards,

Raj

Former Member
0 Kudos

Hi,

Again small doubt : what is the function of SUB STRING. it doen't pass any empty value...

regards,

raj

Former Member
0 Kudos

Yes, you are correct.

But if you want to handle this situation so that your mapping does not fail. Please use some default value which is of 10 characters in consultation with the client before the sunstring function.

Thanks,

Sudhansu

Former Member
0 Kudos

Hi,

Thank you very much for your support.

regards,

raj

Former Member
0 Kudos

Good to know that the issue was resolved. Please close the thread.

Thanks,

Sudhansu