cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger workflow in MIGO Tcode

Former Member
0 Kudos

Dear Experts,

I am using MIGO Tcode. Once i give the inputs there and click HOLD button a pop up comes with remarks and reference input fields. Once i enter reference input and press enter i want to trigger my workflow. How can i trigger my workflow at this point.

KR,

S Bharath

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

BADI u201CMB_DOCUMENT_BADIu201D is need to be implemented and the function module to trigger workflow need to be written inside this BADI.

1. Goto SE18 and give the badi MB_DOCUMENT_DEFINITION in the definition that is needed to be implemented.

2. Then in the menubar click implementation- > Create

3. Give the implementation name

4.Click the interface tab.

5. Double click on method MB_DOCUMENT_BEFORE_UPDATE and write your program code to call function module to trigger workflow.

DATA : BEGIN OF KEY,

MBLNR TYPE MKPF-MBLNR,

MJAHR TYPE MKPF-MJAHR,

END OF KEY.

DATA : EVENT_CONTAINER TYPE TABLE OF SWCONT.

DATA : OBJKEY TYPE SWEINSTCOU-OBJKEY.

DATA : S_XMKPF TYPE MKPF.

READ TABLE XMKPF INTO S_XMKPF INDEX 1.

MOVE : S_XMKPF-MBLNR TO KEY-MBLNR,

S_XMKPF-MJAHR TO KEY-MJAHR,

KEY TO OBJKEY.

CALL FUNCTION 'SWE_EVENT_CREATE_FOR_UPD_TASK'

EXPORTING

objtype = give ur obj type name created in swo1

objkey = OBJKEY

event = give the event name created in swo1

  • CREATOR = ' '

  • START_WITH_DELAY = ' '

  • TAKE_WORKITEM_REQUESTER = ' '

tables

event_container = EVENT_CONTAINER

EXCEPTIONS

OBJTYPE_NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

6. Save and activate.

7. Before this create a bor in Swo1 with supertype MKPF

Regards.

Former Member
0 Kudos

Hi firends,

I Used the same BADI for Triggering MIGO Workflow .

MB_DOCUMENT_BADI Method MB_DOCUMENT_BEFORE_UPDATE

In some cases, i dont know the exact reason

why i am getting the Express Dump and the GR Document is not Posted

while debbuging i can see the MKPF and MSEG DB Tables Updated

I am getting the Success Message as

Goods Reciept Posted with GR Number

Since the GR Document is not Updated in Header Table and my Work flow is going to Fail(Not Triggering at all)

Is there any way to link our MIGO / GR Workflow say in the Output Type.

Thanks in Advance

Ganesh

Answers (1)

Answers (1)

former_member185167
Active Contributor
0 Kudos

Hello,

You can look for a user exit in this program, and insert code to call SAP_WAPI_CREATE_EVENT.

Then link the event to the workflow as a triggering event.

regards

Rick Bakker

Hanabi Technology