Quantcast
Channel: SCN: Message List - Enterprise Asset Management (SAP EAM)
Viewing all articles
Browse latest Browse all 10043

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 field values of ''Main. Work Center'' OR ''WBS Element''. ' TYPE 'E'.
   ENDIF.
ENDIF.

The string 'XXX_XXX' in the code represents 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 fine.

 

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

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

By this,  the above 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 10043

Trending Articles



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