on 01-29-2015 7:21 AM
Hi Experts,
We've a requirement in LSO module. In standard scenario there already exists a workflow for when employee nominates himself for a course or cancels a particular course. Whereas in MSS, if a manager nominates or cancels a course for any particular employee, no workflow is triggered and the course is booked/cancelled immediately.
In our case, we want to create workflow for this case, that is when manager tries to cancel a course on behalf of an employee.
We've managed to write a customized logic, to trigger a custom workflow for cancellation. By referring the standard employee cancellation workflow, I found that when the std workflow is triggerd, the BO LSO_PARTIC is directly bind to the workflow from the Event to workflow binding.
That means the workflow already receives the Bo LSO_PARTIC (Participation in container).
Which is further useful in cancelling the course in the background.
Whereas in case of our custom workflow, we are finding it difficult to write cancel the course logic, since the LSO_PARTIC BO has not been instantiated.
Is there any way in which this can be achieved?
The std workflow for cancellation through ESS is WS12000004.
Help needed.
Regards,
Pranita
If I were you I would most probably create a new event CANCELREQUEST_BY_MANAGER or whatever for the business object LSO_PARTIC, and then start the workflow through this event (instead of starting the workflow directly). Then all the LSO workflows will be started in the same way (through events). IF you can trigger the event properly with SAP_WAPI_CREATE_EVENT from your code, then the rest should be relatively easy (object gets instantiated etc.).
Btw, what are you actually doing with your workflow. The course will get cancelled anyway even if you get the workflow started, right? Well, I guess this was obvious...
Kind regards,
Karri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The issue is solved.
I instantiated the LSO_PARTIC object by using the GENERICINSTANTIATE method of the Business Object SYSTEM. I passed the key to it as all the 6 key fields of BO LSO_PARTIC concatenated as string, with proper spaces, keeping in mind the data types of respective fields.
After the LSO_PARTIC was instantiated, referring the cancellation logic used in the workflow WS12000004, I used the same task to cancel the participation and it worked!!!
Thanks all for the inputs!!
Regards,
Pranita
Hello,
What event starts this cancellation workflow?
Have you managed to change the configuration so that the same event is created when the manager cancels a workflow on behalf of an employee?
"since the LSO_PARTIC BO has not been instantiated."
Why is this not passed with the event?
regards
Rick Bakker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rick,
We're triggering this custom workflow directly through FM EWW_WORKFLOW_START and not through event.
The std cancellation workflow is triggered CANCELREQUEST event of BO LSO_PARTIC.
But this triggers when employee raises request of cancellation.
We want to trigger workflow when manager raises request, which is not there in std.
Best Regards,
Pranita D
Hello,
You should use fm SAP_WAPI_START_WORKFLOW instead of anything else. Even better would be to use an event to start the workflow. Check if an event is created when the Manager cancels a course (look in SWEL after turning on the event trace with SWEL).
With SAP_WAPI_STAT_WORKFLOW I'm sure you can provide container elements for the workflow.Include the LSO_PARTIC object.
regards
Rick Bakker
User | Count |
---|---|
81 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.