MB_DOCUMENT_BADI and bapis/commit work
I need to book an invoice while executing MIGO. I use the class MB_DOCUMENT_BADI and the method MB_DOCUMENT_UPDATE, where I call BAPI_INCOMINGINVOICE_CREATE. Unfortunately it does not work (it exits debugger), as it seems that the material document has not been created yet ( but inside the badi I have already MBLNR...) . I tried to use BAPI_TRANSACTION_COMMIT before creating invoice, but it also exits. Can use those BAPIs inside MB_DOCUMENT_UPDATE?
when calling the BAPI call it in background task..
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
IN BACKGROUND TASK