Skip to Content
author's profile photo Former Member
Former Member

Workflow not being triggered through SAP_WAPI_CREATE_EVENT

Hello experts,

I am triggering a custom workflow for a leave application through a custom module pool program,using the function module

SAP_WAPI_CREATE_EVENT. This function module returns sy-subrc = 0, but when I check SWI2_FREQ cannot see the workflow log.

After switching the trace ON I found in SWEL,the RFC status as 'User Switch Is Not Possible', Please refer the attachment

When I tried to test the same using SWUE the workflow is getting triggered and the results are as expected.

There's a similar thread in SCN which talks about this,(didn't help me but) http://scn.sap.com/thread/1960611

Also when I ran SM58 found one entry which has a status text as User Switch Is Not Possible(Refer the attachment).

Note: The workflow was working perfect in the recent past, noticed this since yesterday when I was trying to test a new scenario.

Awaiting for your replies ,thanks in advance.

Regards

Akmal

SM58.jpg (76.5 kB)
WF_ISSUE.jpg (86.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 04:58 AM

    Hello everybody,

    The issue is resolved. The glitch was due to an extra line of ABAP code.

    I had put a check for test purpose while triggering the workflow and it is..

    IF SY-SYSID = 'NEP'. " Production system

    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

    ENDIF.
    and while debugging I was changing SY-SYSID to NED(development).

    Realized this when I went through SM12.

    Thanks everybody....

    Regards

    Akmal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 30, 2013 at 07:08 AM

    Hi,

    check and share SWU3 with RFC connection test. Also check and share authorization of Wf-batch

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 01:11 PM

    Hi Akki,

    Just putting some blind guess, please re-check once the below points:

    1.) Commit work has been used after the FM call.

    2.) Is there any parameters for your BO event ? If yes then please check whether you have passed those parameter values correctly during your FM call.

    3.) Do you have more than one field as key of BO ? If yes then please share how you are passing the values of key during FM call. I will suggest make a work area of type all the key fields and pass that work area in to a variable of type objectkey used in FM.

    If above 3 points are fine , then check these:

    1.) Whether the user have proper access to trigger WF. You can check the T-Code SU53 after the execution of your module pool report.

    2.) Check the SAP ID WF-BATCH is not locked and its synced with RFC call.

    3.) Last but most important please check RFC settings are fine in T-Code SWU3.

    Thanks,

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 30, 2013 at 07:58 AM

    Hi Akmal

    check if the following note is applicable for your system release:

    1740421 - 'User Switch Is Not Possible' SYSFAIL - SM58 or SMQ1 or SMQ2

    regards,

    Modak

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 01, 2014 at 10:08 AM

    HI Akmal,

    Just check the Linkage setting using the SWETYPV for the Workflow. Go inside your entries and check the Tab Behavior UPON Error Feedback Do it as Don't change.

    Regards.

    Nishant Bansal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 05, 2014 at 11:03 AM

    Hello,

    Please use commit work after function module call.

    Regards,

    Sagar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2014 at 06:54 PM

    Hi ,

    Can you share the code you have created for creating the event?

    Arpan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 12:33 PM

    Only for example:

    DATA: objtype TYPE swetypecou-objtype VALUE 'ZBUS2034',
    objkey TYPE sweinstcou-objkey,
    event TYPE swetypecou-event,
    delay TYPE sweflags-delayflag,
    creator TYPE sweinstcou-recid.


    * Trigger workflow


    objkey = salesdocument.

    IF gv_mode EQ 'CREATE'.
    event = 'START_SO'.
    ELSEIF gv_mode EQ 'CHANGE'.
    event = 'CHANGE_SO'.
    ENDIF.



    CALL FUNCTION 'SWE_EVENT_CREATE'
    EXPORTING
    objtype = objtype
    objkey = objkey
    event = event
    IMPORTING
    event_id = event_id
    * RECEIVER_COUNT =
    *** TABLES
    *** event_container = evt_cont_t
    EXCEPTIONS
    objtype_not_found = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    * Implement suitable error handling here

    ELSE.

    COMMIT WORK.
    ENDIF.



    Cheers,

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 01:15 PM

    Hi Akmal

    Any luck?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.