As the title indicates, this post is to utilize the very useful user-exit IWO10009 for the purpose of preventing changes in Operation tab. In fact utilizing this exit for control over Components tab and Operation tab is not straight forward, because here tables are involved, listing number of Components or number of Operations. For such requirements we need to know the respective program and the run-time memory (internal table). During such requirement in components tab by a member in the past, some research was done and the required program and the internal table were found to access the runtime memory of the program for Components tab.The program wasSAPLCOBC and the internal table was RESB_BT . Using this information the control desired by the member was achieved and later this code was preserved in the post Specify conditions for Components in PM Order (User Exit IWO10009) .
In a similar way, recently one more member was asking for control over Operations tab, such as he should be able to prevent changes in Operations tab once the Order has been released.
So things are similar, only thing is to know the Program and internal table corresponding to Operation tab. After I searched net, including SCN, I could get the information on this. The program is SAPLCOBOand the internal table is AFVG_BT. Once we knew this information a simple code (given below) in the include ZXWOCU07of user-exit IWO10009, would prevent any changes in Operations tab after Order Release.
IF CAUFVD_IMP-IPHAS <> '0' AND SY-TCODE = 'IW32'. FIELD-SYMBOLS: <FS_AFVG> TYPE ANY. DATA: BEGIN OF I_AFVG OCCURS 100. INCLUDE STRUCTURE DFPS_AFVG_BT . DATA:END OF I_AFVG. ASSIGN ('(SAPLCOBO)AFVG_BT[]') TO <FS_AFVG>. I_AFVG[] = <FS_AFVG>. LOOP AT I_AFVG. IF I_AFVG-VBKZ <> ''. MESSAGE: 'Operation changes not permitted after Order release' TYPE 'E' DISPLAY LIKE 'I'. ENDIF. ENDLOOP. ENDIF.
This throws the following pop-up error at the Save event, when user makes some changes in Operations tab.
There can be many deeper requirements for the users, to specify some conditions for changes in Operations tab, in stead of completely preventing changes. All these requirements will be now possible for an ABAPer by developing the above code. The key information is the program SAPLCOBO and the internal table AFVG_BT which has been already known to us.
The objective of this post is again same as in the past, to preserve this recently acquired piece of knowledge, to be able to find easily and refer to the needing member as quickly as possible.
Thank you
KJogeswaraRao