Trigger Workflow from Report and generate PDF-work item in UWL

Tor Magne R fallenblake at hotmail.com
Fri Jul 10 06:40:15 EDT 2009


Dear Experts,

 

I need to trigger a Workflow from a report, which generates a prefilled PDF-FORM in the UWL.

 

Scenario:

 

Z_REPORT --> Trigger event --> Start Workflow (the WF containers have recieved vaules from the Z_REPORT) --> Generates a PDF-Work Item in UWL 

 

--> Display FORM with default values in the fields (inherited from the container) 

 

The Process A contains the forms Form_A and Form_B.  I am not able to use Backend services and field passing in HRASR_DT, due to the customer`s requirements.

 

The Workflow:

The Workflow has the following steps: 

 

1. Start workflow (from triggering events)

2. Export from Workflow container --> Form container 

3. Display the Form container with defaultet field values from the Workflow container

 

Challenge 1:

 

I need to trigger the workflow from Z_REPORT .

 

I have managed to start a workflow from Z_REPORT by using the FM "SAP_WAPI_START_WORKFLOW". In this case, the WF works fine with normal WF steps, however, it fails when processing STEPS that has anything to do with PROCESS A and FORMS.

 

I have been using FM " 

SAP_WAPI_CREATE_EVENT " , but I don`t seem to manage to start the event  CL_HRASR00_WF_PROCESS_OBJECT.

 

 

Code:

 

 

 lv_objkey = ''.

  lv_objtype = 'CL_HRASR00_WF_PROCESS_OBJECT'. "  type
  lv_event   = 'TRIGGERED'. " event name 

 

 

  CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
    EXPORTING
      object_type             = lv_objtype
      object_key              = lv_objkey
      event                   = lv_event
      commit_work             = 'X'
    IMPORTING
      return_code             = return_code
      event_id                = event_id
    TABLES
      input_container         = lt_cont
            . 

I don`t get any error messages, but I can`t see any new events started in t-code SWEL.

 

Question 1: 

"Do I need to use the event CL_HRASR00_WF_PROCESS_OBJECT in order to start my WF and being able to generate PDF-FORM Work item in UWL?"

 

Question 2:

"How do I start the event CL_HRASR00_WF_PROCESS_OBJECT from the report?

 

 

Challenge 2:

 

If I start my WF from the Portal MSS(in order to test the WF) I get an error message when I start the workflow with 

the step "Export from Workflow container --> Form container". 

The problem seems to be that the workflow needs to display a FORM in the users UWL, before being able to use the import / export task.

 

It works perfectly well, when I am using a STEP "display FORM_A" before using the STEP "Export from Workflow container --> Form container". I don`t want to display an empty form, and then in the next step display the same form with defaulted values.

 

In the "DISPLAY form"-step, I have tried to use the Condition "Complete work item". When I start the workflow and set I predefine the condition, the step

will be set to completed, however, the next step "Export from Workflow container --> Form container" will get the status under processing, and continue in

an infinite loop.

 

The conclusion is: I need to open and process the "DISPLAY FORM" work item from the UWL manually, in order to make the export step work.

 

Question 3:

"How can I manage to start the "Export from Workflow container --> Form container" step, without having to generate the step "DISPLAY FORM_A"?

 

I am so sorry for this long e-mail, and perhaps I should have split this mail into two different requests. However, it is important to see the whole picture of the process.

 

Thanks in advance.

 

Best regards, 

 

Tor

 

 

 

 

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090710/5f65f245/attachment.htm


More information about the SAP-WUG mailing list