an example of enhancement framework

This scenario would work from ECC6.0 onwards.

In Enhancement Framework, we can add our own Code at particular points.

While debugging the standard SAP program, we have to decide at which place we would need to write our own code. There we need to check whether enhancement can be implemented.  

Requirement: In Sales Order (VA01 & VA02), we have to pick the Material Description from Custom Table.

While debugging it is found that the code needs to be written in the FORM USEREXIT_MOVE_FIELD_TO_VBAP. Now click on Enhance button as shown below.

It shows the screen as below :

Then it shows the Screen as below:

""" indicates we can write our code here. 

Now Right click on """"""""""""" and select Enhancement Implementation -> Create.

 

Select Code.

Now click on Create button in the above screen. Another Screen appears as shown below:

In the above screen, click on Create Composite Implementation and the following Screen appears.

 

Now here we can write our own code as shown below:

Code:

ENHANCEMENT 315  ZSD_EI_BOQDESC.    "active version
*  Modification Done By : Sajid Shaik.
*  Date                 : 08.06.2009
*  Requirement Given by : Avinash Gyale
*  Requirement          : Material Description should be fetched from BOQ based on the Plant and Boq Type 'Erection or Civil'.
*                       : This should work only for Order type ZCO1 - Civil & Order type ZER1 - Erection

  
DATA : VAR_ARKTX    TYPE VBAP-ARKTX,
         VAR_MAKTX    
TYPE ZBOQ_ITEM-MAKTX,
         VAR_TENDERID 
TYPE ZBOQ_ITEM-TENDERID,
         VAR_LENGTH   
TYPE INT4.

IF ( SY-TCODE EQ 'VA01' OR SY-TCODE EQ 'VA02' ) AND ( VBAK-AUART EQ 'ZCO1' OR VBAK-AUART EQ 'ZER1' ) AND VBAP-WERKS IS NOT INITIAL.
  
CLEAR : VAR_ARKTX,VAR_MAKTX,VAR_TENDERID .

  
IF VBAK-AUART EQ 'ZCO1'.
    
SELECT SINGLE TENDERID FROM ZBOQ_HEADER INTO VAR_TENDERID WHERE WERKS EQ VBAP-WERKS AND TYPE EQ '3'.
      
IF SY-SUBRC NE 0.
      
ENDIF.
  
ELSEIF VBAK-AUART EQ 'ZER1'.
    
SELECT SINGLE TENDERID FROM ZBOQ_HEADER INTO VAR_TENDERID WHERE WERKS EQ VBAP-WERKS AND TYPE EQ '2'.
      
IF SY-SUBRC NE 0.
      
ENDIF.
  
ENDIF.

  
SELECT SINGLE MAKTX FROM ZBOQ_ITEM INTO VAR_MAKTX WHERE TENDERID EQ VAR_TENDERID.
     
IF SY-SUBRC NE 0.
     
ENDIF.
  VAR_LENGTH = 
STRLEN( VAR_MAKTX ).

  
IF VAR_LENGTH LE 40.
    VAR_ARKTX = VAR_MAKTX(VAR_LENGTH).
  
ELSE.
    VAR_ARKTX = VAR_MAKTX(
40).
  
ENDIF.
  
IF   VAR_ARKTX IS NOT INITIAL.
    VBAP-ARKTX = VAR_ARKTX.
  
ENDIF.
ENDIF.

ENDENHANCEMENT. 

Then Save and Activate it. 

OUTPUT :

Before Enhancement Implementation

 

After Enhancement Implementation

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ChampaignWolf

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值