cancel
Showing results for 
Search instead for 
Did you mean: 

When submit button clicks the mail shoud trigger in workflow.

Former Member
0 Kudos

hi,

I created a module pool program , in there i have some fields. by giving f4 help in key fields all other values ll come. after that if i click submit button the workflow want to trigger. i created on bo . in that i specify the key field, and i create event called submit. for that event i gave key field as a  parameter. I c

in submit i ll call this fm SAP_WAPI_START_WORKFLOW . in task i give the workflow which i created.but its not triggering.

Regards,

gopi

Accepted Solutions (1)

Accepted Solutions (1)

I042439
Employee
Employee
0 Kudos

Please use SAP_WAPI_CREATE_EVENT Fm to trigger the event

It's always better to trigger the event and then start the workflow instead of starting the WF directly.

Always use SAP_WAPI* APIs

Regards,

Modak

You can also use methods of class cl_swf_evt_event to trigger events

Message was edited by: Modak Gupta

Answers (4)

Answers (4)

Former Member
0 Kudos

hi ,

its working fine. thanks for everyone.

Regards,

gopi

0 Kudos

Hi,

Check your workflow in swdd. Event 'SUBMIT' should be active. Go to Basic Data -> Start Event and provide your object name and event and activate it.

anjan_paul
Active Contributor
0 Kudos

Hi,

  when you use make sure you are in possible agent in workflow->basic data-> agent assignment.

  The best thin is to use  SAP_WAPI_CREATE_EVENT.

Former Member
0 Kudos

hi anjan,

in module pool i write ths code.in The bo zftr which i created . there i specify key field as personnelnumber  i dint create method, i create event submit, for that event i create key field as parameter.k. in my workflow part, in basic data i create object type as zftr and event submit. in workflow container i gave element as personnellnumber created bo . to bind event and workflow i created this. after this just i have one user decision approve r reject.

the code which below  is written in submit. whether it is correct? its not triggering in swel.i check there also

DATA: OBJECT_KEY TYPE SWR_STRUCT-OBJECT_KEY.
     DATA: INPUT_CONTAINER TYPE TABLE OF SWR_CONT,
           WA TYPE SWR_CONT.


WHEN 'SUBMIT'.
     CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
       EXPORTING
         object_type             ='ZFTR'
         object_key              = object_key
         EVENT                   = 'SUBMIT'
        COMMIT_WORK             = 'X'
*       EVENT_LANGUAGE          = SY-LANGU
*       LANGUAGE                = SY-LANGU
*       USER                    = SY-UNAME
*       IFS_XML_CONTAINER       =
*     IMPORTING
*       RETURN_CODE             =
*       EVENT_ID                =
      TABLES
        INPUT_CONTAINER         = INPUT_CONTAINER.
*       MESSAGE_LINES           =
*       MESSAGE_STRUCT          =





Regards,

gopi

anjan_paul
Active Contributor
0 Kudos

Hi,

  check what is the release status of your object. And more important what object key you are provide in object_key. And last check sy-subrc value

deepika_chandrasekar
Active Contributor
0 Kudos

Hi Gopi,

Try SWE_EVENT_CREATE to trigger Workflow.

Regards,

Deepika.