前导零

Posted on 2023-05-26 21:55  Chris的博客  阅读(11)  评论(0编辑  收藏  举报

方法一:

"保留前导零 
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = lv_lsh
          IMPORTING
            output = lv_lsh. 

"去掉前导零 
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input  = lv_lsh
          IMPORTING

方法二:

  LOOP AT s_lifnr.
    s_lifnr-low =  |{ s_lifnr-low ALPHA = OUT }|.
    s_lifnr-high =  |{ s_lifnr-high ALPHA = OUT }|.
    MODIFY s_lifnr .
  ENDLOOP.

方法三:

 AND ltrim( b~lifnr,'0' ) IN @s_lifnr