Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

业务场景:

有些公司要求信用检查要基于订单的需求数量,以减少用户使用VA02或者V_V2去修改确认数量,且确认数量大于释放时的确认数量,但不小于订单需求数量,系统就又会再次锁定订单,用户就得再次申请释放订单,给业务操作带来麻烦。

问题原因:

在sap的标准系统里,系统使用订单的确认数量去确认信用价值,并在释放时按确认数量去填写释放的价值(VBAK-AMTBL)。当某个订单被释放后,用户使用VA02或者V_V2去修改确认数量,系统就会用新确认数量的价值和释放时的价值比较,如果大于原有价值,系统就会再次锁定订单。

解决方法:

我们可以通过修改RMCS1US1的代码,来达到目的。RMCS1US1代码如下:

***INCLUDE RMCS1US1.
*---------------------------------------------------------------------*
*       FORM GET_QUANTITY_FOR_RELEASE                                 *
*---------------------------------------------------------------------*
*       This routine gives the possibility to set the quantity        *
*       which is used for calculating the relased value during        *
*       credit release.                                               *
*                                                                     *
*       In SAP-Standard the field CH_QUANTITY has been filled with    *
*       the confirmed quantity (VBAP-KBMENG)                          *
*---------------------------------------------------------------------*
*  -->  US_VBAK     order header                                      *
*  -->  US_VBAP     order item line                                   *
*  -->  US_VBUP     order item line status fields                     *
*  <->  CH_QUANTITY quantity which is used for calculation the        *
*                   the released value                                *
*                   Attention: the delivered amount will decreased    *
*                              automatically                          *
*---------------------------------------------------------------------*
form get_quantity_for_release
  using     us_vbak structure vbak
            us_vbap structure vbapvb
            us_vbup structure vbupvb
  changing  ch_quantity like vbap-kbmeng.
* If the following coding shall be activated please deactivate
* the statement EXIT
exit.  “我们可以将该行删除就可以达到用户的需求了。
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  if us_vbap-fkrel ca con_fkrel_lsmeng and
     us_vbap-lfrel ne true.
*   scheduling lines are relevant for delivery
    if us_vbak-vkorg ne tvta-vkorg or
       us_vbak-vtweg ne tvta-vtweg or
       us_vbap-spart ne tvta-spart.
      clear tvta.
      select single * from tvta where vkorg = us_vbak-vkorg
                                and   vtweg = us_vbak-vtweg
                                and   spart = us_vbap-spart.
    endif.
    if tvta-revfp na 'CE'.
*     if one-time or full delivery is required, the planned
*     quantity is copied, because there is only one delivery
      ch_quantity = us_vbap-lsmeng.
    endif.
  endif.
endform.

同时要维护“可用性检查”-》“以ATP逻辑或不按照计划进行的可用性检查”-》“定义缺省设置”如下图:

对应Notes

100861 - Release of blocked sales orders - loop check

149559 - Update of requested delivery quantity, credit

相关联接:

http://blog.csdn.net/sap_jack/article/details/8363842

http://wiki.scn.sap.com/wiki/display/SD/Released+Sales+documents+are+Rechecked

2 Comments