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

Re: Authorization groups and Functional locations

$
0
0

Hello Vivek,

In case you do not find any solution through I_BEGRP etc., then you can go through the user-exit way, the way explained below.

 

  • As a first step, you put a value in AuthorizGroup field of all such Functional Locations, say '0001' .

 

  • Then put the following code in the include ZXLOMU01 of the user-exit ILOM0001 .
DATA:l_begru TYPE iflot-begru,
      l_begru1 TYPE iflot-begru.

SELECT SINGLE begru FROM iflot INTO l_begru WHERE tplnr = data_iflo-tplnr.
SELECT SINGLE begru FROM iflot INTO l_begru1 WHERE tplnr = data_iflo-tplma.
  
IF l_begru = '0001' and sy-uname <> 'XYZ_ABCD'.
MESSAGE: 'Changes to this Functional Location are forbidden.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.

IF l_begru1 = '0001'.
MESSAGE: 'Superior Functional Location is forbidden for use.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.

 

Here first IF prevents user (other than 'XYZ_ABCD' ) to make any changes to the Functional Locations with value '0001' in their AuthorizGroup field.

The second IF prevents user to specify such Functional Locations (AuthGrp '0001') as Superior Functional Locations for  other F/Locns.

 

  • Now to prevent an Equipment to be installed under such Functional Locations (AuthGrp '0001'), put the following code in the include ZXEQMU03 of the user-exit IEQM0001.

 

DATA:l_begru TYPE iflot-begru.
SELECT SINGLE begru FROM iflot INTO l_begru WHERE tplnr = func_location-tplnr.

IF l_begru = '0001'.
   MESSAGE: 'Functional Location is forbidden for use.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.

 

 

For the first IF of exit ILOM0001 you get the error pop-up at the time of Saving the F/Location.

1.JPG

 

For the second IF of exit ILOM0001 you get this error at the the time of Saving the F/Location.

2.JPG

 

For the code in exit IEQM0001 you get the following error pop-up at the attempt of entering this F/Locn in the structure tab.

2.JPG

 

Note

1. Implement under the supervision of an ABAPer and test in DEV servers to your satisfaction. (It is a very simple one for ABAPers).

2. It is to remind that codes in the user-exits work only when they are assigned to a project created through CMOD.

 

 

 

Good luck

KJogeswaraRao


Viewing all articles
Browse latest Browse all 9091

Trending Articles



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