If you need to execute MRP in SAP AFS for a single material for a plant you can use the BAPI “J_3AM_DISPOSITION”. This is the BAPI which is called by the standard SAP MRP transaction /AFS/MD02.
You need to set the importing parameters as below.
Parameter “I_BANER” (Creation Indicator for Purchase Requisitions) can accept below values. Set the value as per the requirement.
Parameter “I_J3ADZDI” should be set as below.
How the parameters correspond to the transaction /n/AFS/MD02 is shown below.