cancel
Showing results for 
Search instead for 
Did you mean: 

how to trigger a workflow from custom button added to standard webUI application.

Former Member
0 Kudos

Hello Experts,

We have custom workflow developed behind the menu exit button of a standard SAP tcode and it is working fine in SAP GUI. Now we want to use the same workflow template to trigger it from a WebUI platform, we have added a custom toolbar button in the Webdynpro application and on the button event we have to execute the same workflow template. Any idea how to do it?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member197425
Active Participant
0 Kudos

Hi,

This is one of the F.M which can used to trigger Workflow,whether its in Webdynpro or ABAP.

CALL FUNCTION 'SWE_EVENT_CREATE'
   EXPORTING
     objtype                       = BUSINESS OBJECT NAME
     objkey                        = Pass B.O KEY value
     EVENT                         = B.O EVENT NAME
*   CREATOR                       = ' '
*   TAKE_WORKITEM_REQUESTER       = ' '
*   START_WITH_DELAY              = ' '
*   START_RECFB_SYNCHRON          = ' '
*   NO_COMMIT_FOR_QUEUE           = ' '
*   DEBUG_FLAG                    = ' '
*   NO_LOGGING                    = ' '
*   IDENT                         =
* IMPORTING
*   EVENT_ID                      =
*   RECEIVER_COUNT                =
* TABLES
*   EVENT_CONTAINER               =
* EXCEPTIONS
*   OBJTYPE_NOT_FOUND             = 1
*   OTHERS                        = 2
           .

Thanks,

Nandi.

Former Member
0 Kudos

use below function module in your application

i also faced same isssue earlier

CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'

go through this link

http://scn.sap.com/community/bpm/business-workflow/blog/2006/07/27/raising-abap-oo-events-for-workfl....

Regards,

Manu

Former Member
0 Kudos

Hi Parin,

You can trigger workflow at the button pressed event by using:

try.

       call method cl_swf_evt_event=>raise

         exporting

           im_objcateg = ls_sibflpord-catid  "Workflow: Object Type 'BO', 'CL' ...

           im_objtype  = ls_sibflpord-typeid "Object Type, Class

           im_event    = iv_event                 "Event Name

           im_objkey   = ls_sibflpord-instid. "Object Key

     catch cx_swf_evt_invalid_objtype into lr_oref.

       lv_msg = lr_oref->get_text( ).

     catch cx_swf_evt_invalid_event into lr_oref.

       lv_msg = lr_oref->get_text( ).

   endtry.

Check out these useful links also

http://scn.sap.com/docs/DOC-25262

http://scn.sap.com/community/bpm/business-workflow/blog/2006/07/27/raising-abap-oo-events-for-workfl...

Hope it helps! Cheers!

Former Member
0 Kudos

try to use FM

   CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'