滚滚长江东流水,黄河入海不复返

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

User Exit for Release Procedure (PR)

By Willem Hoek  http://www.sap123.com/a/74/


Sometimes either the logic to be used is to complicated to use normal strategies or the field to be used in strategy is not available in Communication Structre (see transaction se12 - table CEBAN). In that case user exit can be used.

Example, lets say we want the following strategy:

For all PR's against a cost centre (account assignment K), base strategy on Cost Centre number and Document Type.

For all PR's not against a cost centre, base stretegy on Plant (in PR) and Document Type.

To set up:

  • Create 2 characteristics:
    one for doc type (linking it to CEBAN-BSART)
    one linking to user define field, say ceban-usrc1
  • Activate enhancement m06b0002 in transaction CMOD
  • Write ABAP code (user exit) in program ZXM06U13 in the case of Purchase Requisitions

When you create / change the PR, the characteristic will get value of ceban-usrc1 from user exit.

This is sample code of user exit

**&---------------------------------------------------------------------

**

**& Include           ZXM06U13

**&---------------------------------------------------------------------

 

case i_ceban-knttp.

 when 'K'.

    e_ceban-usrc1 = i_ceban-kostl.

 when others.

    e_ceban-usrc1 = i_ceban-werks.

endcase.

e_ceban-bsart = i_ceban-bsart.

 

Activate enhancement will activate the user exit.



Notes based on SAP ECC 5.0

posted on 2010-04-27 15:35  Steveson  阅读(454)  评论(0编辑  收藏  举报