SD-SO 更改 item category

根据业务需要我们在SO的增强中修改 item category,item category 有许多相关的业务数据,所以在修改之后我们需要调用一些标准subroutine修改与之相关的业务数据。

在VBAP ITEM 增强和SO保存检查的增强中添加如下代码进行修改:

      LOOP AT xvbap.
        gv_tabix = sy-tabix.
        CLEAR: ls_vbap_copy.
        READ TABLE lt_vbap_copy INTO ls_vbap_copy
          WITH KEY vbeln = xvbap-vbeln  posnr = xvbap-posnr BINARY SEARCH.
        IF sy-subrc = 0.
          IF ls_vbap_copy-pstyv NE xvbap-pstyv.
            svbap-tabix = gv_tabix.
            PERFORM vbap_bearbeiten_vorbereiten(sapfv45p).
            PERFORM vbap_fuellen(sapfv45p).
            vbap-pstyv = ls_vbap_copy-pstyv.

            PERFORM vbkd_fuellen_tvap(sapfv45k).
            PERFORM vbap_bearbeiten(sapfv45p).
            PERFORM vbap_bearbeiten_ende(sapfv45p).
          ENDIF.
        ENDIF.
      ENDLOOP.
标准 item category determine 逻辑如下:

            IF i_vbap-uepos = 0.
              CLEAR hvbap.
            ELSE.
              PERFORM hvbap_lesen(sapfv45p) USING i_vbap-uepos.
              ASSIGN ('(SAPFV45P)HVBAP') TO .
              IF  IS ASSIGNED AND  IS NOT INITIAL.
                CLEAR: hvbap.
                hvbap = .
              ENDIF.
            ENDIF.

            CALL FUNCTION 'RV_VBAP_PSTYV_DETERMINE'
              EXPORTING
                t184_auart          = i_vbak-auart
                t184_mtpos          = lv_mtpos
                t184_uepst          = hvbap-pstyv
                t184_vwpos          = space
                vbap_pstyv_i        = space
              IMPORTING
                vbap_pstyv          = i_vbap-pstyv
              EXCEPTIONS
                eintrag_nicht_da    = 1
                pstyv_nicht_erlaubt = 2
                OTHERS              = 3.
            IF sy-subrc <> 0.
* Implement suitable error handling here
            ENDIF.



你可能感兴趣的:(SAP-ABAP)