cancel
Showing results for 
Search instead for 
Did you mean: 

Lock Some fields of PR through ABAP Code

masna_7
Participant
0 Kudos
387

Hi,

 

there is a scenario where once the PR is created in SAP, it will be sent to 3rd Party application for Approval via IDOC.

I am looking for a possibility to lock some fields of PR through ABAP Code based on some field in 'Status' tab at Item level until this Approval is complete and this response is received back to SAP via IDOC.

 

I mean Locking here in the sense that the Fields should be greyed out and should not be allowed to EDIT

 

The fields I want to lock are :  1. Fixed vendor at Item Overview Level

2. Quantity at Item Level

3. Gross Price at Item Level.

 

What are the possibilities of these ?

 

many Thanks in advance

  

View Entire Topic
raymond_giuseppi
Active Contributor
0 Kudos

Did you already look at BAdI ME_PROCESS_REQ_CUST, field selection methods such as FIELDSELECTION_HEADER allow to change some display field attributes. You may not be allowed to handle standard fields, but you could rise an error and restore previous value in PROCESS_HEADER.

  • More options/fields are handled in ME_PROCESS_REQ, but only SAP can implement it, so you would be required to use (divert) some standard SAP implementing class 🙃 (enhancement in an implementing class)
  • There were also some customer exits available (look for EXIT_SAPLMEREQ_*  FM in Enhancement MEREQ001)
masna_7
Participant
0 Kudos

Hi Raymond, 

I am new to to Exits in SAP, can you be more specific please or guide me to any document.

 

Many Thanks,

 

masna_7
Participant
0 Kudos

Hi Raymond, Quick Update : 

I have found out that this can be achieved through the BADI : ME_PROCESS_REQ_CUST

So, my requirment is, I have to lock the PR fields which are highlighted in the attached screenshot based on some other status field of PR. Can you confirm if this can be achieved through this BADI. I will check how to implement it and other steps as well.

 

Regards

raymond_giuseppi
Active Contributor
0 Kudos

I reformulate

(ME_PROCESS_REQ_CUST)

Basically the "customer allowed" BAdI only handle "customer fields". But you could use the process_header method to remove user changes of the field (and raise a waning message)

(ME_PROCESS_REQ)

To actually "grey" some standard fields, you must use the "SAP only allowed" BAdI, but as you are not allowed to create a new implementation, select a standard active implementation to divert and enhance (e.g. implicit enhancement points at start and end of methods) /Or/ find/use such enhancement in the main program (e.g. set a break-point at start of the FIELDSELECTION_HEADER method of an active implementing class and debug to find where it's called in standard)