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: 

*----------------------------------------------------------------------* 
*   INCLUDE ZXMBCU01                                                   * 
*----------------------------------------------------------------------* 

DATA: BEGIN OF KEY, 
        MBLNR LIKE MKPF-MBLNR, 
        MJAHR LIKE MKPF-MJAHR, 
     END 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, 
      XMKPF-MJAHR TO KEY-MJAHR, 
      KEY TO OBJKEY. 

CALL FUNCTION 'SWE_EVENT_CREATE_FOR_UPD_TASK' IN UPDATE TASK 
     EXPORTING 
          OBJTYPE                 = 'MKPF' 
          OBJKEY                  = OBJKEY 
          EVENT                   = 'CREATED' 
*         CREATOR                 = ' ' 
*         TAKE_WORKITEM_REQUESTER = ' ' 
*         START_WITH_DELAY        = ' ' 
*         START_RECFB_SYNCHRON    = ' ' 
*         DEBUG_FLAG              = ' ' 
*    IMPORTING 
*         EVENT_ID                = 
     TABLES 
          EVENT_CONTAINER         = EVENT_CONTAINER 
     EXCEPTIONS 
          OBJTYPE_NOT_FOUND       = 1 
          OTHERS                  = 2. 

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 
Do you have a SAP WorkFlow Question?

SAP Books
SAP WorkFlow Certification, Interview Questions and Configuration Reference Books

SAP WorkFlow Tips
SAP Business WorkFlow Tips and WF Discussion Forum

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.