on 04-16-2007 2:14 PM
Hi All,
Could any one out there please tell me if there is a way to start/trigger the WF programmatically. My WF is triggering well through the triggering events but i want to trigger the WF in the user exit. I am not sure how to do this. Please advice.
Thanks,
Karuna\.
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.
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.
Reward points if it helps
regards
Biju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to raise an event from inside the user exit.
To do this use FM SWE_EVENT_CREATE
You can also generate a change document and attach the event from there.
pls. reward if helpful
Roberto
here a code sample:
INCLUDE <CNTAIN>. " Definizione MACRO
DATA: KEY LIKE SWEINSTCOU-OBJKEY.
Key(18) = rmmg1-matnr.
key+18(4) = marc-werks.
key+22(2) = stato.
SWC_CONTAINER T_SWCONT.
SWC_SET_ELEMENT T_SWCONT 'Codice' rmmg1-matnr.
SWC_SET_ELEMENT T_SWCONT 'Plant' marc-werks.
SWC_SET_ELEMENT T_SWCONT 'Stato' stato.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
OBJTYPE = 'businessobject'
OBJKEY = KEY
EVENT = 'eventname'
TABLES
EVENT_CONTAINER = T_SWCONT
EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
OTHERS = 2.
endif.
commit work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.