Excel file upload in ABAP sometimes comes with issues in data. When any cell has multiple lines (separated by Alt + enter), the data in the cell is seperated by Carriage Return character.
When the data in the cell is mapped with a numeric field in ABAP, it will lead to runtime error. In the below example, we have quantity coming from a excel file cell and it has a CR character.
Notice "#" after 25. We want to get rid of that #.
Hex code D0 represents Carriage return. (see the Hex value in the screen shot below).
CL_ABAP_CHAR_UTILITIES=>CR_LF is a two character field which has Carriage return and Line Feed.
In our case since we have CR only, we will replace that with SPACE.
Please check the code below:
replace all occurrences of cl_abap_char_utilities=>cr_lf+0(1) in conf_qty with space.
replace all occurrences of cl_abap_char_utilities=>cr_lf+0(1) in
conf_qty with space.
condense conf_qty no-gaps.