SAP定價的合計欄位的程式碼照抄

JackWu發表於2018-04-30


合計欄位預設累計,只有當條件型別為價格型別時,欄位會重置。請大家參考LV61AA55

* fill subtotal work fields
      CASE xkomv-kzwiw.
        WHEN ' '.
        WHEN 'A'.
          IF komp-mgame NE 0.
            komp-cmpre = xkomv-kwert * 10 / komp-mgame.
          ENDIF.
        WHEN 'B'.
          IF komp-kposn NE 0.
            IF xkomv-koaid = 'B'.    “當為價格時
              komp-wavwr = xkomv-kwert.
            ELSE.
              ADD xkomv-kwert TO komp-wavwr.
            ENDIF.
          ELSEIF xkomv-kinak CA ' Y'.
            ADD xkomv-kwert TO komp-wavwr.
          ENDIF.
        WHEN 'C'.
          IF komp-kposn NE 0.
            IF xkomv-koaid = 'B'.
              komp-grwrt = xkomv-kwert.
            ELSE.
              ADD xkomv-kwert TO komp-grwrt.
            ENDIF.
          ELSEIF xkomv-kinak = space.
            ADD xkomv-kwert TO komp-grwrt.
          ENDIF.
        WHEN 'D'.
          ADD xkomv-kwert TO xworkd.
        WHEN 'E'.
          ADD xkomv-kwert TO xworke.
        WHEN 'F'.
          ADD xkomv-kwert TO xworkf.
        WHEN 'G'.
          ADD xkomv-kwert TO xworkg.
        WHEN 'H'.
          ADD xkomv-kwert TO xworkh.
        WHEN 'I'.
          ADD xkomv-kwert TO xworki.
        WHEN 'J'.
          ADD xkomv-kwert TO xworkj.
        WHEN 'K'.
          ADD xkomv-kbetr TO xworkk.
        WHEN 'L'.
          ADD xkomv-kbetr TO xworkl.
        WHEN 'M'.
          ADD xkomv-kbetr TO xworkm.
        WHEN 'N'.
          IF cl_erp_ehp_switch_check=>erp_cf_sfws_1( ) EQ 'X'.
            ADD xkomv-kwert TO komp-nrab_value.
          ENDIF.
        WHEN 'S'.                      "effective value purchasing
          ADD xkomv-kwert TO komp-effwr.
        WHEN '1'.
          ADD xkomv-kwert TO komp-kzwi1.
        WHEN '2'.
          ADD xkomv-kwert TO komp-kzwi2.
        WHEN '3'.
          ADD xkomv-kwert TO komp-kzwi3.
        WHEN '4'.
          ADD xkomv-kwert TO komp-kzwi4.
        WHEN '5'.
          ADD xkomv-kwert TO komp-kzwi5.
          ENHANCEMENT-POINT xkomv_bewerten_11 SPOTS es_saplv61a.
*$*$-Start: XKOMV_BEWERTEN_11-------------------------------------------------------------------$*$*
ENHANCEMENT 1  OIC_SDP_SAPLV61A.    "active version
* Update interest base amount                            SO7K017780 RAMN
          PERFORM OIC_SDP_UPDATE_INTEREST_BASE.         "SO7K017780 RAMN
ENDENHANCEMENT.
*$*$-End:   XKOMV_BEWERTEN_11-------------------------------------------------------------------$*$*

        WHEN '6'.
          ADD xkomv-kwert TO komp-kzwi6.
        WHEN '7'.
          ADD xkomv-kwert TO komp-bonba.
        WHEN '8'.
          ADD xkomv-kwert TO komp-preva.
        WHEN '9'.
          IF komp-kposn NE 0.
            IF xkomv-koaid EQ 'B'.
              komp-brtwr = xkomv-kwert.
            ELSE.
              ADD xkomv-kwert TO komp-brtwr.
            ENDIF.
          ELSEIF xkomv-kinak EQ space.
            ADD xkomv-kwert TO komp-brtwr.
          ENDIF.
        WHEN 'Y'.
          ADD xkomv-kwert TO komp-oiidc.
        WHEN 'Z'.
          ADD xkomv-kwert TO komp-oiebc.
        WHEN OTHERS.                                        "IS2ERP
          ENHANCEMENT-POINT xkomv_bewerten_10 SPOTS es_saplv61a.
*$*$-Start: XKOMV_BEWERTEN_10-------------------------------------------------------------------$*$*
ENHANCEMENT 13  OIC_SAPLV61A.    "active version
          case xkomv-kzwiw.
            WHEN 'Q'.                                        "SO3K002265 DN
              ADD XKOMV-KWERT TO KOMP-OIVATBASE.             "SO3K012009
          endcase.
ENDENHANCEMENT.
*$*$-End:   XKOMV_BEWERTEN_10-------------------------------------------------------------------$*$*
      ENDCASE.

相關文章