Function modules invoked in wrong sequence

Message type: E = Error

Message class: ME - Purchasing: General Messages

Message number: 159

Message text: Function modules invoked in wrong sequence



What causes this issue?

The function modules for fully-automatic PO generation have been
invoked in the wrong sequence. The correct sequence is as follows:
1. ME_REFRESH_PO once
2. ME_CREATE_PO_HEADER once
3. ME_CREATE_PO_ITEM n times
4. ME_POST_PO once
If this sequence is not adhered to, data inconsistencies may arise.


How to fix this error?

Please ensure that the function modules are invoked as shown above.

Error message extract from SAP system. Copyright SAP SE.