cancel
Showing results for 
Search instead for 
Did you mean: 

How to start the workflow manually

Former Member
0 Kudos

Hi,

1) i need to start a Workflow when The Manager decide to initiate termination for a particular employee. Is there any triggering event to do it or manually i need to create a programme in which i can write a function module to trigger it manually.

('SWE_EVENT_CREATE')

2) Tell me also whether i can do it using screen painter , where a push button can trigger this functionmodule and trigger the workflow.

3) Simply the initiator can start the workflow ?

Richard

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Actually this is not a answer but a question ?

(how to post the question ?). I checked to post question, but not able to find the way.ok.Any how below is actually a question .

A workflow need to be triggered for requesting GL account creation confirmation. Then six people in the hierarchial order will approve the request.(GL is not required to be created, only the approval for request ). what could be the best approach and any could tell me the logic to do this work. Any how this workflow need to be triggered from a web dynpro application.(some body suggested to go with custom defined business objects)

Thanks in advance

Pons.

Former Member
0 Kudos

Please read guidline donot creep into other thread and throw diffrerent question asthe actual question gets demolished. You should have option Post new thread. Do that.

Thanks

Arghadip

Former Member
0 Kudos

Definitely. It will collapse the actual question.

Apologise for that.

Regards,

Pons

0 Kudos

Hi Richard,

After reading all the replies, I want to ask a question, we have termination workbench used to Terminate an Employee. For payroll INDIA, we have to run a report - HINCTER0 or T_Code = PC00_M40_TERM to start the Termination Workbench. This report does all the things like it runs the Termination Action defined in PA40, and also the update of Infotype - 15.

*Please see the Perform - POP_AMOUNT (for further clarification)

Now can you please again state what you require :-

the Workflow before the report is run or

(ii) the workflow after the report is executed, that is to send the general notification of employee termination job finished or

(iii) Workflow to do all the Termination Process instead of using the Standard SAP report.

I am taking only the first scenario : -

Scenario 1) Workflow to run the Report (workflow ---> Report)

It is mix and match of the different technologies, like you can use

(1) <b>the Screen Painter</b>, where on the press of the button, workflow will be triggered, which internally can trigger the task, which can run the report to terminate the Employee. The same thing can you used on portal using the technologies like Webdynpro for ABAP, etc.

(2) <b>ABAP Programming ( Report or Functional Module)</b> - can trigger you Z workflow directly or trigger an event associated with you Z-workflow which can further trigger the Report mentioned above.

*<b>Who so ever run the report/funtional module/screen painter screen (initiator),</b> can start the workflow.

As far as Object - BUS1065 is concerned, it is used to delete the Password of the Employee, it does not run the termination event of PA40.

Regards,

Saurabh

Former Member
0 Kudos

Saurabh ,

I am not clear about the transaction PC00_M40_TERM .(Please give more info)

The scenario is , Once the HR Manager decide to terminate an employee ,

he need to start a workflow, which will go further few steps to get approval and finally has to send a mail to the initiator stating that the Termination is done.

Thanks for your timely reply,

Richard

0 Kudos

Transaction - PC00_m40_TERM is used to run the Termination Workbench module in HR. It is used for the Country-INDIA ( HR Term - MOLGA) = 40, i.e m40 and TERM means TERMINATION.

  • So find you the Molga for your payroll

Now as per the scenario provided by you, there is a need of the Workflow that has to be initiated by the Manager and finally once the termination is done, the mail must reach the Initiator.

So, in that case, it is very simple, just make a Z-Workflow that should be initiated based on the Report or simple startup program written in Module program as well, where on the execution, it should trigger your workflow. The trigger can be done, in two ways, where you can go ahead to directly trigger the workflow(WS900XXXXXX) or you can create an event which must be linked to you workflow via transaction SWETYPV or SWEC as well. Once the workflow gets triggered, you can go ahead to create the Task, which can use your Z-Business object(Business Objects are created via Transaction - SWO1) , which will have the method defined, containing the steps in the T_CODE - PC00_M40_TERM. Majorely, we have to run the TERMINATION Action define in T_CODE - PA40.

So the summary of the steps can be as follows:-

1. Run Z-Program for you manager ( Module Program or any Report)

2. On the execution of the program above, the Event or Directly the workflow can be triggered

3. Inside the Workflow, we have Task

4. Task is using the Class or BOR(Business Object Repository -T_Code - SWO1)

5. Task also contains the Method(defined in the same class or BOR of step 4)

6. Method will have the logic for the Termination.

7. Once the Method is successfully executed and all the relavant infotypes are updated defined in PA40 Termination Action.

8. Another Task is execution of the Type - SEND MAIL ( Expression will have the PERNR having the value - Employee Terminated)

9. Workflow Ends.

Regards,

Saurabh Bhatnagar

Former Member
0 Kudos

hi,

you just make some small changes to the business object so that it triggers the workflow when your manger decides to terminate it at any point of time.. As the method and event in the business object would do the rest for you if it is done as per your specifications..

thank you

former_member186746
Active Contributor
0 Kudos

Hi Richard,

This should all be standard SAP,

If you take a look at SWEHR2, entry person, infotype 0000, operation insert. You'll see that SAP uses function module HR_EVENT_RULES_PA0000 to determine which event to trigger. Now if you take a look at the code, you'll see that based on the employee status, in the case of leaving the company, it either uses event retired, or companyleft.

Kind regards, Rob Dielemans

martin_nooteboom
Active Contributor
0 Kudos

Hi Richard,

What will the action of the manager be when he decides to initiate a termination? Normally a workflow for termination will be linked to an action (PA40), more specifically to infotype 0000. There is an event for termination, COMPANYLEFT for BUS1065. You can trigger this from a program if you want, but then use SAP_WAPI_CREATE_EVENT.

How you will solve this depends on the business scenario, what does the business want? For instance do they want a custom transaction to start the termination? All your options could work, but what is best depends on your business scenario.

Regards,

Martin

Former Member
0 Kudos

Hi,

I think there should be a standard scenario for starting a workflow on Termination.

So instead of doing custom developemnt for triggering WF , first search the standard workflow templates.

Regds,

Akshay