Trigger WF from MIGO
Is there any way to trigger a WF from transaction MIGO? Trying to create a WF when MIGO is saved. ********** There's a user exit which is called after the material document is posted, but just before the 'commit work' takes place. I think it's 'EXIT_SAPLMBMB_001' off the top of my head. Raise your workflow event programmatically there using 'SWE_EVENT_CREATE_FOR_UPD_TASK' in update task. You'll have the material document number/year in the MKPF structure by then, so you should be well equipped for any subsequent workflow. ********** I first tested the function you suggested, but it seems doesn't work. Maybe I misunderstood and am doing something wrong. Here it is: SWE_EVENT_CREATE_FOR_UPD_TASK : I pass the MKPF as object type, a 50000000012003 object key, and the event assigned. ********** The two obvious things that spring to mind are either that you've coded your function module exit incorrectly, or you haven't activated the enchancement in CMOD. Here's some code I've used in past, which definitely works: Code: *----------------------------------------------------------------------*
DATA: BEGIN OF KEY,
DATA: EVENT_CONTAINER LIKE SWCONT OCCURS 0. DATA: OBJKEY LIKE SWEINSTCOU-OBJKEY. READ TABLE XMKPF INDEX 1. "Check with MM Consultant that table will only have 1 line MOVE: XMKPF-MBLNR TO KEY-MBLNR,
CALL FUNCTION 'SWE_EVENT_CREATE_FOR_UPD_TASK' IN UPDATE
TASK
As you can see, I created a custom event 'created' for a delegated subtype of MKPF, and am using that instead.
Get help for your SAP WF problems
SAP Books
SAP WorkFlow Tips
Best regards,
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|