Skip to Content
0
Jan 19, 2022 at 03:43 PM

Converting CHAR , Test 1 and Test 2 both require to work !!

72 Views Last edit Jan 19, 2022 at 03:44 PM 3 rev

DATA: lv_dec TYPE p descimal 2.

DATA: lv_string TYPE char10.

REPLACE ALL OCCURRENCES OF SUBSTRING ',' IN lv_string WITH ''.
lv_dec = lv_string.

Test 01 - success

input ---- >lv_string = 1,123

output ---->lv_dec = 1123.00

Test 02 - Fail

input ---- >lv_string = 178,862‬

output ---->lv_dec = Error

Why test 02 fail , how to make Test 01 and Test 02 both work ?