Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict payment terms field in ME22N?

Former Member
0 Kudos

Hi all,

We have a group of users who should not have the authorization to change the "Terms of Payment Key" field in ME22N.  What is the best way to achieve this please?    Please note that another group of users should have the authorization to do this.

Thanks in advance, Tony.

5 REPLIES 5

Former Member
0 Kudos

Hi D E,

Best way is to create a new role for that particular user group  and restrict on "Terms of Payment Key" field in ME22N and assign this role to that user group and remove the role in which Payment key is not restricted

Regards,

Kiran

satyabrata_sahoo3
Contributor
0 Kudos

Create a 2nd role restricting Payment term or try to create a screen variant using SHD0 and give to those users or implement BAdi ME_PROCESS_PO_CUST with help of ABAP.

mvoros
Active Contributor
0 Kudos

Hi,

we just implemented this requirement. Unfortunately, BADI ME_PROCESS_PO_CUST does not let you control this field. Hence we used implicit enhancement end of FM MEPOBADI_FS_HEADER. It's right after the standard BADI gets called. The logic is simple. The field is closed unless you have authorization for new custom authorization object. Here is the code.

* Allow modification of field payment terms

* Note: this code does not get executed if there is no BADI implementation

  AUTHORITY-CHECK OBJECT 'ZMM_PO_FIE'

           ID 'FELDNAME' FIELD 'ZTERM'

           ID 'ACTVT' FIELD '02'.

  CHECK sy-subrc NE 0.

  READ TABLE ch_fieldselection ASSIGNING <fs1>

    WITH TABLE KEY metafield = mmmfd_pmnttrms.

  CHECK sy-subrc EQ 0.

  <fs1>-fieldstatus = '*'. " Display


Cheers

0 Kudos

Hi

with a little change ..., it works perfect to us:

AUTHORITY-CHECK OBJECT 'YZTERM'

**           ID 'FELDNAME' FIELD 'ZTERM'

            ID 'ZTERM' DUMMY

            ID 'ACTVT' FIELD '02'.

       CHECK sy-subrc <> 0.

READ TABLE ch_fieldselection ASSIGNING <fs1>

     WITH TABLE KEY metafield = mmmfd_pmnttrms.

   CHECK sy-subrc EQ 0.

   <fs1>-fieldstatus = '*'.     " Display


All the Best,

SK

0 Kudos

and forgot to mention, also SU20, SU21, SU24 for ME21N (& ME22N).

SU24 with check indicator and proposal 'Yes'.

KR,

SK