cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable or grey out the Difference field in IK11

0 Kudos

Hi All,

The business requirement is to disable or grey out the Difference field in IK11.

Please let us know your answers / valuable solutions.

If this can't be done by configuration then help me by providing suitable user exits/ Badi / Enhancement available.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello MANI,

Suddenly I recollected right user-exit and the right solution. The user-exit is IMRC0004. Put the following code in the include ZXMRCU04 .


IF sy-tcode = 'IK11' AND impt_data-mptyp = 'Z' AND impt_data-indct = 'X' AND imrg_ins-idiff IS NOT INITIAL.

    MESSAGE: 'Reading in ''Difference'' field is not allowed. Please enter your reading in the ''Counter reading'' field.' TYPE 'E'.

  ENDIF.

This throws an error in the status bar the moment someone enters a reading in the Difference field and hits Enter (for 'Z' category of measuring points)

Besides very simple coding, there are no hassles of Saving, or Dumps as in the case of previous exit IMRC0001. I'm sorry for forgetting this solution at the time of answering previously. I'm sure, this solution would suit to you.

Good luck

KJogeswaraRao

0 Kudos

Hello Rao Sir,

Sorry for the delay in reply.

Thanks you a lot and your continued valuable answers. Your help/service must be appreciated.

I am closing this thread now as your's is the correct answer.

Hope I will meet you again on my next new discussion 🙂

Have a nice day

Regards

Mani.

jogeswararao_kavala
Active Contributor
0 Kudos

Sure MANI,

This discussion helped trigger a knowledge sharing blog from me. May like to go through to know about other cases of this exit usage.

Good luck

KJogeswaraRao

0 Kudos

Thanks for knowledge sharing Sir.

Answers (2)

Answers (2)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello MANI,

Though it is not possible to grey-out this field through customizing, your objective can be achieved through user-exit IMRC0001. Here your logic can stop users from entering values in the Difference field. Consult your ABAPer. It will be a 2-3 line code. A small issue might be there. i.e., This exit being after Commit and our interrupting the Commit might some times throw a short-dump. Share this with your ABAPer. He might have a solution for this too.

As Shailendra suggested in the other thread, Transaction variant can be a good option. Read my posts in this thread and make use of it.

Good luck

KJogeswaraRao

0 Kudos

Thanks Sir,

I will try with your suggestions and update you soon.

0 Kudos

Hello Paul, Sir,

I tried with SHD0 and yes i can make the Difference field to disable / gray out mode. But my business requirement is it should be grayed out only for category 'Z' (sorry for not added/clear in my original post).

Please assist.

Thanks.

jogeswararao_kavala
Active Contributor
0 Kudos

In this case I doubt the suitability of SHD0. Please try IMRC0001 as said before. This is a simple process and your condition (Mpt ctgy) can be very easily met. Test well for suspected short-dump. If you can overcome that, then the job is done. Otherwise we have to explore suitable Implicit enhancement point in IK11 program (ABAPer).

Let's hope more ideas flow from experts.

(I'm unavailable for next several hours)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello MANI,

I am giving the user-exit solution here which I have tested. Put this code in the include ZXMRCU01 of exit IMRC0001.


DATA: BEGIN OF i_imrg OCCURS 0.

             INCLUDE STRUCTURE imrg.

     DATA:END OF i_imrg.

     DATA: v_mptyp TYPE char1,

           v_point TYPE imrg-point.

     i_imrg[] = imrg_ins[].

     LOOP AT i_imrg.

       SELECT SINGLE mptyp FROM imptt INTO v_mptyp WHERE point = i_imrg-point.

       IF v_mptyp = 'Z' AND i_imrg-idiff IS NOT INITIAL.

         MESSAGE: 'Reading entered in incorrect field.' TYPE 'E' DISPLAY LIKE 'I'.

       ENDIF.

     ENDLOOP.

This code throws the following error pop-up when user enters a reading in the Difference field and clicks on Save button. (This is applicable only when the MPt type is 'Z' as per your requirement).

It works perfectly.

Now about the Short-dump I was suspecting

Above error prevents the Document to be created and pop-up appears in the IK11 initial screen. Now, here if you use Enter key for the first time this pop-up goes away. Second pressing on Enter key or Click on Back icon of the screen leads to a short-dump, which is a result of our interruption of Commit process of the user-exit. Instead, if you use /N command with or without any tcode in the command bar this dump is avoided.

So with this limitation, if this is acceptable, your requirement is addressed. You can work with ABAPer to find ways to eliminate this short dump too

Good luck

KJogeswaraRao

0 Kudos

Hello Sir,

Thank you so much for your time here and a detailed suggestion.

I am grateful to you. I will update you soon.

Have a nice day.

Former Member
0 Kudos
0 Kudos

Thanks Paul.