cancel
Showing results for 
Search instead for 
Did you mean: 

format number error

Former Member
0 Kudos

Hi SAP-XI experts,

I kept a mapping where field PEPDIO is mapped to field DELIVERYNUMBER using functionality FORMATNUMBER.

DELIVERYNUMBER is of data type String.

The value passed to PEPDIO field is

<Pedido>8002000984</Pedido>

The constant value to format number is 0000000000.

when i execute the interface i am getting a failed msg in sxi_monitor with error ""MAPPING">EXCEPTION_DURING_EXECUTE".

I executed the mapping with taking inbound msg payload then i got following msg.

Runtime exception when processing target-field mapping /ns1:MT_PickingListIn_SCA/row[4]/DeliveryNumber; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Cannot cast '' to decimal number] in class com.sap.aii.mappingtool.flib7.Arithm method formatNumber[, java.text.DecimalFormat@674dc, .,

CAn u please help me on this issue.

Thanks

Vijaya

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

@Avijjisubbu123 : What exactly is your requirement? Do you wanna pad zeros on the left side of your input?

I would suggest you go from a UDF rather than using Format Number as it expects only integer/decimal and not a string. Or if you still wanna keep FormatNumber you will have to typecast the string to a integer before you give it as a input to your FormatNumber function...

former_member208856
Active Contributor
0 Kudos

also use this function as below :

formatNumber

--> 2 parameters

1 Number Format --> 0000000000

2. Decimal Separator --> NIL

Former Member
0 Kudos

Hi,

This is failing because the FormatNumber is not expecting a field of type String as input - you need to change the input to be a numeric type such as Int.

Cheers

Colin.