cancel
Showing results for 
Search instead for 
Did you mean: 

Question about number format in variable

svyatoslav
Explorer
0 Kudos
184

Hello

I have a problem with variables in SAP

I try to take amount in variable with this code

B = session.findById("wnd[0]/usr/txtBSEG-WRBTR").text

C = CDbl(B)

i need number variable

and i have error "Type mismatch. When i try to use Google i found that is some problem in Regional settings.

Is some way to take variable with ither method?

On example something like this

B = session.findById("wnd[0]/usr/txtBSEG-WRBTR").number

Thanks you for help.

Sandra_Rossi
Active Contributor
0 Kudos

I'm afraid that numeric fields are just processed by SAP GUI Scripting API like any other text field, what you see is what you get, there's no API to know the number format of the currently-connected SAP user (NB: Windows Regional Settings are completely ignored for SAP GUI).

Maybe a simple logic could work to determine whether the decimal separator is a comma or a dot

  • You can be sure what the decimal separator is for these values: "1,00" "1.00" "1,0000" "1.0000" "1.000,000" "1,000.000" "1 000" (comma)
  • You can't be sure for these values, it could be the thousands separator: "1,000" "1.000"

Note that the property Numerical is True for numeric fields.

Accepted Solutions (0)

Answers (0)