删除前置零 与 补充前置零

  • 删除前置零

功能模块 CONVERSION_EXIT_ALPHA_OUTPUT 可以将数字编号前面的0数字删除

例如:

DATA: I_BOOKID TYPE SBOOK-BOOKID,
O_BOOKID TYPE SBOOK-BOOKID.

I_BOOKID = ‘0001′. “初始值

CALL FUNCTION ‘CONVERSION_EXIT_ALPHA_OUTPUT’
EXPORTING
INPUT           = I_BOOKID
IMPORTING
OUTPUT        = O_BOOKID
.

WRITE : O_BOOKID.

输出结果为: 1

  • 补充前置零

功能模块 CONVERSION_EXIT_ALPHA_INPUT 可以将数字编号前面的0数字不足位数进行补充

例如:

DATA: I_BOOKID TYPE SBOOK-BOOKID,
O_BOOKID TYPE SBOOK-BOOKID.

I_BOOKID = ‘01′. “初始值

CALL FUNCTION ‘CONVERSION_EXIT_ALPHA_INPUT’
EXPORTING
INPUT           = I_BOOKID
IMPORTING
OUTPUT        = O_BOOKID
.

WRITE : O_BOOKID.

输出结果为: 00000001

你可能感兴趣的:(删除)