cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion of "number - " to " - number"

Former Member
0 Kudos

Gurus,

In my XI-mapping logic, the Field (BRGEW) is added to another Field (NTGEW) that procuces a Target Field (TOTAL_QTY). The source system is ECC system.

When I get a Field (BRGEW) value, "1-", that comes from ECC to XI, the mapping fails because of error, "The map is unable to cast "1-" to float." It will pass if the value is "-1".

Which function can I use to convert the value, "1-" to "-1" to pass thru the mapping.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

There is no standard function for this.

You have to write a customer function.

Does the message come from an ABAP proxy? Then you can provide the correct format in sender ABAP code.

Former Member
0 Kudos

No it actually comes from a standard Invoice IDOC.

stefan_grube
Active Contributor
0 Kudos

You can create a UDF like this:

if (var1.endsWith("-")){
  var1 = "-" + var1.substring(0,var1.length()-1);
}
return var1;

I also need this function often.

Former Member
0 Kudos

Great! Thanks!

Answers (0)