Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: Restriction fields in IW32

$
0
0

Hi Preeti,

I've just worked on your requirement.

The code you need to give in the include (ZXWOCU07) of Enhancement IWO10009 is as under.

DATA: LV_VAPLZ TYPE AUFK-VAPLZ,
            LV_PSPEL TYPE AUFK-PSPEL.


IF SY-TCODE = 'IW32' AND SY-UNAME <> 'XXX_XXX'.    
   SELECT SINGLE VAPLZ FROM AUFK INTO LV_VAPLZ WHERE AUFNR = CAUFVD_IMP-AUFNR.
   SELECT SINGLE PSPEL FROM AUFK INTO LV_PSPEL WHERE AUFNR = CAUFVD_IMP-AUFNR.
   IF CAUFVD_IMP-VAPLZ <> LV_VAPLZ OR CAUFVD_IMP-PSPEL <> LV_PSPEL.
     MESSAGE: 'You are not authorized to change the fields values of ''Main. Work Center'' OR ''WBS Element''. ' TYPE 'E'.
   ENDIF.
ENDIF.

'XXX_XXX' in the code is your Authorized UserId.

When some other UserId changes either of these fields (Main Work Center or WBS element) and tries to Save the Order, then the following error is thrown by the system.

 

I have checked it, it is working.

Now of you want to confine this restriction to a particular order type, then Insert the above code between these two lines.

IF CAUFVD_IMP-AUART = 'ZM03'.
"Above  code here
ENDIF.

As per this this restriction will be applicable to only 'ZM03' type orders.

Hope you'd take benefit out of this post.

 

 

Jogeswara Rao K


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>