cancel
Showing results for 
Search instead for 
Did you mean: 

mapping error in targer field mapping

sapjmm
Participant
0 Kudos

mapping error in the targer field mapping due to the mapping field d_387 PLEASE ANY one explain me is any error in the bellow java

code as i am just new for the code

SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_DESADV_ANDA_IDOC_To_ASNEDIFile_New_;

com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping

/LIST/S_ISA/S_GS/S_ST/G_SHL/S_HL/S_TD5/D_~</SAP:Stack>

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

/LIST/S_ISA/S_GS/S_ST/G_SHL/S_HL/S_TD5/D_~

public void populateD387(String[] route, String[] partner, String[] name1,

String[] constantval, String[] filterVal1, ResultList result, Container container) throws StreamTransformationException{

if (route[0].indexOf("ZUPS")>-1){

result.addValue(constantval[0]);

}else{

for(int i=0;i<partner.length;i++){

if(partner[i].equals( filterVal1[0])  && route[0].indexOf("ZLTL")>-1){

       

result.addValue( name1[i]);

    }

}

}

Accepted Solutions (0)

Answers (4)

Answers (4)

Ryan-Crosby
Active Contributor
0 Kudos

Hi Murali,

Looking at the structure of this java code then my guess is that you are hitting this else block:

else{

for(int i=0;i<partner.length;i++){

if(partner[i].equals( filterVal1[0])  && route[0].indexOf("ZLTL")>-1){

       

result.addValue( name1[i]);

    }

}

And in this else block my guess is that within the loop you never add a result because the conditions of the if statement are never met.  If that is the case and you have a required field on the target side then you will get an exception in your mapping while it is executing.

Regards,

Ryan Crosby

sapjmm
Participant
0 Kudos

Thanks for Reply's

ambrish_mishra
Active Contributor
0 Kudos

Hi Murali,

This might be the result of conditions being false and target node (mandatory) not being created.

As Anupam said, we would need source payload and screenshot of mapping to decipher the issue.

Ambrish

former_member190624
Active Contributor
0 Kudos

Hi Murali,

Can you explain what you are trying to do through this UDF. BTW , below condition will be always true

if (route[0].indexOf("ZUPS")>-1)

so check all constantval values were in input .

Thanks

Hari.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Hari,

              Could you please kindly explain why do you think the condition will always be true.

If "ZUPS" is not present in route[0] the condition might be false. That's what I think about it.

Regards

Anupam

former_member190624
Active Contributor
0 Kudos

Hi Anupam,

Many thanks for correcting me , I misinterpreted indexOf() method functionality .

Thanks

Hari.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Murali,

                   Take the inbound payload from sxmb_moni. Using test tab put the payload in mesage mapping. Execute the mapping in test tab. This will provide you detailed reason for error.

The exact reason for error and inbound payload is necessary to answer your query.

If possible also include source and target message structure screen shots.

Regards

Anupam