cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization check on counter reading replacement

Former Member
0 Kudos

Dear Sir,

I have requirement to check authorization when someone trying to replace counter reading in measurement document transaction (IK11).

I've tried to put the authority check on exit IMRC0001 but it was short dump because IMRC0001 is in the middle of commit work.



So, any idea how I can put some custom authorization check on counter reading replacement?

Any help would be appreciated.

Regards,

Raden Vicky

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Raden,

The user-exit we need for your requirement is IMRC0004. Put the code below in the include ZXMRCU04.

IF sy-tcode = 'IK11' AND impt_data-indct = 'X' AND imrg_ins-idiff IS INITIAL.
   MESSAGE: 'Reading in ''Counter reading'' field is not allowed. Please enter your reading in the ''Difference'' field.' TYPE 'E'.
ENDIF.

This code first checks whether the tcode is IK11, then checks whether the Measuring document is for a Counter and then checks whether the field Counter reading entered as difference (IDIFF) is empty. If this field is empty, then it understands that the Reading is entered in the Counter reading field and throws the following error in the status bar of IK11 screen.

And when you clear the Counter reading field and enter the reading in the Difference field the reading is accepted and ready to be Saved.


  • I have tested this code and found working well. If you need any further support please ask.
  • You can add further IFs as per your requirement such as, if you want to limit this restriction to a particular category of MPt (mptyp) etc.
  • I think this is and fulfills your requirement.

Regards

KJogeswaraRao

Former Member
0 Kudos

Hi Jogeswara,

Thanks for the helpful answer.

It is solved now.

Regards,

Raden Vicky

jogeswararao_kavala
Active Contributor
0 Kudos

Please close the thread.

Here is how you close a discussion.

  • When you click on 'Correct answer' in any one of the received replies, you closed the discussion.
  • In case you felt, there was no Correct answer to your query and yet you want to close the discussion, then you click on 'Mark as assumed answered' below the title of your query. This too closes the discussion.
  • Also you may click on 'Helpful answer' for other replies found useful.

Answers (1)

Answers (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Raden,

I understood the requirement. It does not look possible to grey-out this field throguh spro transaction OIMRC. I know using IMRC0001 would give a short-dump, because it interrupts the COMMIT WORK of the exit. I'll look into other enhancement options and get back to you.

Regards

KJogeswaraRao