常用小语法(常忘记的)

"加前导零 、去前导零 

ls_itab-aufnr = |{ ls_itab-aufnr ALPHA = IN }| .

物料编码的前导零

PERFORM frm_con_exit_matn1 USING <is_bom_head1>-matnr '+' .
FORM frm_con_exit_matn1  USING  pv_matnr pv_flag.

  CASE pv_flag .
    WHEN '+'.
      CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
        EXPORTING
          input        = pv_matnr
        IMPORTING
          output       = pv_matnr
        EXCEPTIONS
          length_error = 1
          OTHERS       = 2.
      IF sy-subrc <> 0.
* Implement suitable error handling here
      ENDIF.
    WHEN '-'.
      CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
        EXPORTING
          input        = pv_matnr
        IMPORTING
          output       = pv_matnr
        EXCEPTIONS
          length_error = 1
          OTHERS       = 2.
      IF sy-subrc <> 0.
* Implement suitable error handling here
      ENDIF.
  ENDCASE.

ENDFORM.

 

 

 

 

 

 

 

 

 

 

 

 

持续更新中。。。。。

posted @ 2020-09-25 15:36  ABAP-小帅  阅读(233)  评论(0)    收藏  举报