CALL FUNCTION 'MOVE_CHAR_TO_NUM'
EXPORTING
chr = i_lagp-lgpla+5(2)
IMPORTING
num = int_tmp
EXCEPTIONS
convt_no_number = 1
convt_overflow = 2
OTHERS = 3.
IF sy-subrc <> 0.
int_tmp = 0.
endif.
Get the absolute value
int_tmp = abs( int_tmp - int_tmp2 ).
Append internal table.
result-r_lgtyp = i_lagp-lgtyp.
result-r_lgnum = i_lagp-lgnum.
result-r_lgpla = i_lagp-lgpla.
result-r_lptyp = i_lagp-lptyp.
result-r_index = int_index.
append result to i_result.
Sort internal table SORT i_result DESCENDING BY r_index ASCENDING.
Read table by index
int_index = 1.
DO 9 TIMES.
READ TABLE i_result index int_index.
IF sy-subrc = 0.
result-r_lgtyp = i_result-r_lgtyp.
result-r_lgnum = i_result-r_lgnum.
result-r_lgpla = i_result-r_lgpla.
result-r_lptyp = i_result-r_lptyp.
result-r_index = i_result-r_index.
append result to i_bin.
ENDIF.
int_index = int_index + 1.
ENDDO.
本文展示了一个使用 ABAP 语言进行数据处理的过程,包括字符转换为数字、获取绝对值及内部表的操作等。通过调用 MOVE_CHAR_TO_NUM 函数进行字符到数字的转换,并处理了转换过程中可能出现的异常。
3273

被折叠的 条评论
为什么被折叠?



