This page is created in order to give basic understanding about the technical concept of purchase requisition document.
The PR related coding is grouped in two main function groups:
MEREQ - handling of business data. Creating, checking, saving of PR related business data, including the database operations and BAdI calls. The rules, that control the data of the individual fields are also here.
MEGUI - display of PR documents in the ME53n/ME52n/ME51n transactions.
Debugging a PR
Purchase Requisitions can be debugged from the SE80 transaction: open the Function group MEREQ, drill down to the class of the field you’d like to check and set breakpoint into the METHOD IS_VALID of the class you are interested in.
Alternatively, you can make use of the 'MERULEDEBUG' = 'X' User Parameter in transaction SU01, too. Once the parameter activated, the debugger user will be able to see the Requisition's classes executed during the runtime of the online transaction ME51N in a pop-up window. You can combine the two above debugging methods: use the 'MERULEDEBUG' parameter first, check the class executed and then navigate to the SE80 transaction, open the Function group MEREQ, drill down to the class and set your breakpoint.
At last, you could make use of the below important Function modules, too.
EBAN - Purchase Requisition
EBKN - Purchase Requisitions Account Assignment
EBAN_TECH - Purchase Requisitions for external processing
Important Function modules
Create PR from BAPI - BAPI_PR_CREATE
Create PR from other processes (MRP) - ME_REQUISITION_EXT
Source of Supply - ME_SEARCH_SOURCE_OF_SUPPLY
Release - FUNCTION BAPI_REQUISITION_RELEASE_GEN
Processing external requirements - ME_EPROFILE_LOCAL_PROCESS
Reports, Search for PR’s - ME_READ_EBAN_MULTIPLE