Encounter a more perverted needs, to use the enhanced Add audit status, is to use code to generate Vbak-objnr or VBAP-OBJNR.
In the Userexit_save_document_prepare exit, create a temporary object number with Status_object_create,
For example ' TM0000000001VB ', the system will automatically generate the appropriate approval object and replace it with the formal objnr number.
The replacement function is Status_object_switch_number
Pager FUNCTION 'status_object_create' ExportingChgkz='X'*CLIENT = Sy-mandtObjnr ='TM0000000001VB' "Temporary Object numberObtyp ='VBK' "Object CategoryStsma = Stsma"Status Parameters*Ionra_imp =*I_objectkey =*only_e_status = ' ' ImportingObjnr= vbak-Objnr*Stonr = EXCEPTIONSObtyp_invalid=1status_object_already_exists=2Stsma_invalid=3Stsma_obtyp_invalid=4OTHERS=5.
Add an Approval Status object to a sales order header or line item in MV45AFZZ