Hello Praneet,
Put this code in the include ZXWOCU07 of User Exit IWO10009.
DATA: L_COUNT TYPE I, L_LINES TYPE I. FIELD-SYMBOLS: <FS_RESB> TYPE ANY. DATA: BEGIN OF I_RESB OCCURS 100. INCLUDE STRUCTURE RESB. DATA:END OF I_RESB. ASSIGN ('(SAPLCOBC)resb_bt[]') TO <FS_RESB>. I_RESB[] = <FS_RESB>. SELECT COUNT( * ) INTO L_COUNT FROM RESB WHERE AUFNR = CAUFVD_IMP-AUFNR. DESCRIBE TABLE I_RESB LINES L_LINES. IF ( SY-UNAME = 'TEST_USER1' OR SY-UNAME = 'TEST_USER2' ) AND L_LINES <> L_COUNT. MESSAGE ' Sorry! Component additions are not authroized.' TYPE 'E' DISPLAY LIKE 'I'. ENDIF
With this code:
When Users namely TEST_USER1 and TEST_USER2 will add lines in components during Create or Change (IW31 or IW32) and Click Save they get this error.
The same logic can be extended to prevent changes in the existing component lines by these person. (Your ABAPer will easily be able to do these with the above inputs)
Hope this satisfies your requirement.
Best of Luck
Jogeswara Rao K