Skip to Content

VB12 - Protect a field in the Fast entry screen based on some logic/Condition.

Based on some logic against the particular material being substituted I would like to set a particular field (Reason code) to Read only, so that it can not be changed.

I can see that when using VB13 all fields are set to read only, and it uses the same program and screens as VB12, so I'm guessing there's some setting and logic that dictates this. I would just have to change it slightly so that it allows me to just set one field to Read only when in VB12, if the condition is true.

As yet I have not come across an article/question on this same subject, and I have also not found an easy way to achieve this. I was wondering if anyone has achieved something similar.

Add comment
10|10000 characters needed characters exceeded

  • Probably going to use an enhancement against In clude MV13DO0D - form DUNKEL_VERARBEITEN and insert some code at the top to check the transaction code (T180-TCODE) equals 'VB12' and that the screen number (SY-DYNNR) equals '1501' and that the category is not already set to 'A' (T180-AKTYP). Then I'll read the necessary material (KONDD-SMATN) based on the knumh value (XVAKE-KNUMH) and finally check whether this material is maintained externally or not (using z table). If it is then I'll set T180-AKTYP to 'A' otherwise I'll leave it set to 'V'. That should work, I just need to get an access key to the SAP object and then add the enhancement and code. ;)

    Will let you all know if it works.

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 02, 2018 at 09:37 PM

    If it was a popular requirement it would've already been discussed on SCN.

    It doesn't sound like a great idea, to be honest. I doubt there is a user exit/BADI for this, so essentially you have to modify/enhance SAP standard code.

    Somewhere in PBO event of the screen there should be a routine that manipulates screen fields based on whether transaction is display or change type. This is usually determined by T180-TRTYP field. Shouldn't be difficult to find using debugger.

    I would suggest to reconsider though. If this is just a matter of authorization (not sure how complex the logic is) then you could probably create a variant transaction (SHD0).

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks for posting more information. The goal to disable just the reason field seems a bit odd in this context. I'd understand if there was a need to disallow substitution for certain material type but just the reason... Not sure what this would achieve, really.

      Just make sure to discuss all possible options with an MM/SD person before rushing in with ABAP.