cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion from String to floating point from PI to SAP

former_member625937
Participant
0 Kudos

Hi Experts,

I have a scenario as below .

1. PI uses proxy scenario and sends one of the field as string

2. SAP consumes the same in some l_recorded_value of type FLTP_INOUT which holds char 22

3. Problem is as same value been passed to standard function module as below which throughs an error stating 'Float point conversion error'

4. Need to know how to achieve the same so that either i can ask PI team to make float point declaration from string....or i convert it internally so that below FM will not go for error

Sandra_Rossi
Active Contributor
0 Kudos

What contains L_RECORDED_VALUE?

former_member625937
Participant
0 Kudos

Hi Sandra,

It will hold value of L_RECORDED_VALUE as eg:'100.50' of type FLTP_INOUT which holds char 22...In turn this is passed to standard FM.

Can you suggest what type can I make for l_recorded_value so that i dont get the floating point error.

In PI - Its string

In program - Its FLTP_INOUT - 22 char

In Standard FM - floating point

Regards,

Karthik S

Accepted Solutions (0)

Answers (1)

Answers (1)

Sandra_Rossi
Active Contributor
0 Kudos

So, there is the caller and the callee:

  • The code you show calls MEASUREM_DOCUM_CREATE_SINGLE and pass to the parameter RECORDED_VALUE the value L_RECORDED_VALUE of type FLTP_INOUT which is CHAR 22 and which contains '100.50'
  • MEASUREM_DOCUM_CREATE_SINGLE has parameter RECORDED_VALUE of type RIMR0-RECDC which is CHAR 22 too
  • MEASUREM_DOCUM_CREATE_SINGLE calls CHAR_FLTP_CONVERSION to validate the value from the parameter RECORDED_VALUE.

CHAR_FLTP_CONVERSION expects a number with decimal point in user's format. If your user is defined for European country or other country whose decimal point is a comma, then the dot triggers the error.