ABAP:获取批次特性值

CALL FUNCTION 'VB_BATCH_2_CLASS_OBJECT'
            EXPORTING
              i_matnr = ls_ekpo-matnr
              i_charg = ls_zsdt012-charg
              i_werks = ls_ekpo-werks
            IMPORTING
              e_objek = lv_objek
              e_obtab = lv_obtab
              e_klart = lv_klart
              e_class = lv_class.

          CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
            EXPORTING
              objectkey       = lv_objek
              objecttable     = lv_obtab
              classnum        = lv_class
              classtype       = lv_klart
            TABLES
              allocvaluesnum  = lt_allocvaluesnum
              allocvalueschar = lt_allocvalueschar
              allocvaluescurr = lt_allocvaluescurr
              return          = lt_return.

          CLEAR:lv_sollwert,lv_jz,lv_jz2.
          READ TABLE lt_allocvaluesnum INTO DATA(ls_allocavluesnum)
                                       WITH KEY charact = 'Z_BATCH_Z101'.
          IF sy-subrc EQ 0.
            lv_sollwert = ls_allocavluesnum-value_from.

            CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'
              EXPORTING
                i_number_of_digits = '2'
                i_fltp_value       = lv_sollwert
              IMPORTING
                e_char_field       = lv_jz.

            lv_jz2 = lv_jz.
          ENDIF.

          CLEAR:lv_sollwert.
          READ TABLE lt_allocvaluesnum INTO ls_allocavluesnum
                                       WITH KEY charact = 'Z_BATCH_Z102'.
          IF sy-subrc EQ 0.
            lv_sollwert = ls_allocavluesnum-value_from.

            CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'
              EXPORTING
                i_number_of_digits = '2'
                i_fltp_value       = lv_sollwert
              IMPORTING
                e_char_field       = lv_mz.

            lv_mz2 = lv_mz.
          ENDIF.

 

posted @ 2023-03-16 22:34  阿胖的阿多  阅读(186)  评论(0编辑  收藏  举报