GR Not Allowed Before Confirmation

How to setup the system so that GR are not allowed before a production confirmation is done?

By: Rohit

Pls find below the detailed explanation for "GR not allowed" before "confirmation".  I had it for my requirement. Similiarily you can try out for "Goods Movement" and "Mark for Deletion". The process is given below:

1. Use Tcode BS02 ( Customising User status profile). 

2. Create a User Status Profile using the create button. Then Select the created profile and click on details button. 

a. In the status no field type"1" , status field "Sta1", short text"GR not allowed", lowest no "1", Highest No "2". Mark a tick in the initial stats check box. 

b. Next line, type status no field "2" ,status field "sta2", short text"Gr allowed", lowest no "2" , highest no "2". 

c. Choose "object type" and tick the "CO Production Order" and "PP/PM Order Headers".

4. Select the STA1 line and choose details. select the "create"button. Select the "GR for prod order", mark "forbidden radio button" and "not active ratio button". 

5. Select the STA2 line and choose details. Select the "create" button. select "confirm order", mark "allow radio button" and "set radio button" Next choose "GR for prod order" , mark "allow radio button" and "set radio button". 

6. Save. 

7. Now assign your Status profile" PP000001" in the production order type (OPJH) -----Status profile header:- PP000001. And create a Prod Order to verify.

This will not allow you to do GR without order confirmation.

or 

You can work with ABAPer on this requirement.  I think only way to you can control this by implement a USER EXIT or BADI.

1) User-Exit 
Use below user exit for Production Order when saving exit will work - PPCO0007 (Go to SMOD)

Function exit

EXIT_SAPLCOZV_001 enhancement when saving order
&---------------------------------------------------------------------
*& Include ZXCO1U06
&---------------------------------------------------------------------
 *Write your code here
 2) BADI
Implement the BADI - WORKORDER_CONFIRM in this there is method 
AT_SAVE under that 

write this code

method IF_EX_WORKORDER_CONFIRM~AT_SAVE.

data: lt_resb type standard table of resb,
        wa_resb type resb.

select * from resb into table lt_resb where rsnum eq i_order_header-rsnum and xloek eq space and bdmng gt 0.
check sy-subrc eq 0.

loop at lt_resb into wa_resb.
     if wa_resb-enmng < wa_resb-bdmng.
          message E499(sy) with 'Order is not fully consumed. Processing is STOPed'.
     endif.
endloop.

endmethod. 

Read Also:
Control Regular Entry for Material Consumption

SAP PP Reference Books:
SAP Production Planning , Configuration, Interview Questions and Certification, Books

Goto:
SAP MRP - Materials Requirements Planning Configuration Hints and Tips 

Back to:
SAP PP (Production Planning) Configuration Hints and Tips

Return to :-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.  The site www.gotothings.com is in no way affiliated with SAP AG.
Any unauthorised copying or mirroring is prohibited.