Determining if a Purchase Order is complete or not
I'm working on a report that given a certain Purchase Order number, I must determine if it is complete or not. I thought that I might need to find all the material document numbers and check each of those to make sure all the line items have been received via MIGO or not. However, I'm not sure how to do that. Is this the easiest way or is there an easier way? Any information would be greatly appreciated.
I don't think you can actually really "close" a purchase order, however I did code a program recently to make EKPO-EREKZ and EKPO-ELIKZ = 'X' if the user selected to do so based on an ALV I developed.
If there is a G/R, then I made sure beforehand that the G/R and I/R amount were equal, if not they are not allowed to close.
You can run FM ME_READ_HISTORY to view line item history.
IF EKBET-BETWP = 'E' then its a Goods Receipt
IF EKBET_BETWP = 'Q' then its a IR
Just make sure the quantities equal out.
Hope this helps.