ABAP添加0或者去除0的函数

*&---------------------------------------------------------------------*

*& FORM  add_zero
*&---------------------------------------------------------------------*
*  添加前导0
*----------------------------------------------------------------------*
FORM add_zero CHANGING p_in.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = p_in
    IMPORTING
      output = p_in.
ENDFORM.                    "add_zero  

 

 

    CALL METHOD z_itf_utils=>add_zero
      CHANGING
        c_input = i_pernr.


*去除p_out的前导零

*&---------------------------------------------------------------------*
*& FORM  DEL_ZERO
*&---------------------------------------------------------------------*
*  去除前导0
*----------------------------------------------------------------------*
FORM DEL_ZERO CHANGING p_out.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
      input  = p_out
    IMPORTING
     output = p_out.
ENDFORM.                    "DEL_ZERO  

 

 

    CALL METHOD z_itf_utils=>del_zero
      CHANGING
        c_output = wa_out-bzid.

posted @ 2019-10-23 15:55  纱缚之印  阅读(1078)  评论(0编辑  收藏  举报