cancel
Showing results for 
Search instead for 
Did you mean: 

Create workflow for LSO- When manager cancels participation on behalf of employee

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

former_member185167
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

former_member185167
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Pranita,

When Manager initiate cancellation, you have to call the function module 'SAP_WAPI_CREATE_EVENT' instead of 'SAP_WAPI_START_WORKFLOW'.

Also you have to pass the Employee details [Learner Id] to the key of business object LSO_PARTIC.

I hope it will work.

Thanks,

Vijay.

Former Member
0 Kudos

Hi Vijay,

Will try this.

In case of employee cancels the course, fis there any way I can find from where the event CANCELREQUEST is being raised in application? Just for reference as how the LSO_PARTIC object is instantiated there..

regards

Pranita

Former Member
0 Kudos

Hi Pranita,

You have to put a external break point at your webdynpro application and need to debug it.

Thanks,

Vijay.