Hello Lalit,
The previous thread was very old query asked by me itself. In fact that was a query out of curiosity. System does not behave as per the spro settings as experienced by me and yourself. Also there were no known solutions to this. Later on I left this matter, because I did not require this.
I have just tested the solution through user-exit IMRC0001 which is preventing the duplication of Measurement Position. I am giving below the code to be put in the include ZXMRCU01.
DATA: i_impt TYPE TABLE OF imptt,
w_impt TYPE imptt,
v_psort TYPE char20.
CLEAR v_psort.
i_impt[] = impt_ins[].
LOOP AT i_impt INTO w_impt.
IF w_impt-mptyp = 'M'.
SELECT SINGLE psort FROM imptt INTO v_psort WHERE psort = w_impt-psort.
IF v_psort IS NOT INITIAL.
MESSAGE 'Measuring Point could not be created. Reason: Measurment position has already been used.' TYPE 'E'.
ENDIF.
ENDIF.
ENDLOOP.
With this code in place, whenever user tries to create and Save a MeasPt with a Msmt Position same as already existing, then he will be taken to the INITIAL SCREEN of the IK01 with the following error in the status bar .
(Notice in the code that this code has been confined to MPt Ctgy 'M'. You can change it as per your requirement)
Everything looks to be fine. But...
There is an issue here. When you are redirected to the IK01 Initial Screen, you are supposed to come-out of this screen by using '/N' in the command bar (Also you can use like '/NIK01'). Instead, if you do anything in that error screen (like press 'Enter' or click on 'Back' icon etc.) system creates a short dump. This is because this exit triggers After COMMIT WORK and we are interrupting the same. Short-dump is because of this. May be your ABAPer finds a solution to this too.
Alternatively, look into the BAdi BADI_EAM_MSAM_MEAS_POINT which I do not have in my system.
Regards
KJogeswaraRao