<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Dear Experts,<BR>
<BR>
I need to trigger a Workflow from a report, which generates a prefilled PDF-FORM in the UWL.<BR>
<BR>
<STRONG>Scenario:</STRONG><BR>
<BR>
<STRONG>Z_REPORT</STRONG> --> Trigger event --> <STRONG>Start Workflow</STRONG> (the WF containers have recieved vaules from the Z_REPORT) --> Generates a <STRONG>PDF-Work Item in UWL</STRONG> <BR>
<BR>
--> Display FORM with default values in the fields (inherited from the container) <BR>
<BR>
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.<BR>
<BR>
<STRONG>The Workflow:</STRONG><BR>
The Workflow has the following steps: <BR>
<BR>
1. Start workflow (from triggering events)<BR>
2. Export from Workflow container --> Form container <BR>
3. Display the Form container with defaultet field values from the Workflow container<BR>
<BR>
<STRONG>Challenge 1:</STRONG><BR>
<BR>
I need to trigger the workflow from Z_REPORT .<BR>
<BR>
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.<BR>
<BR>
I have been using FM "<!--StartFragment -->
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
</STYLE>
<SPAN>SAP_WAPI_CREATE_EVENT</SPAN> " , but I don`t seem to manage to start the event <!--StartFragment --> CL_HRASR00_WF_PROCESS_OBJECT.
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
</STYLE>
<BR>
<BR>
<STRONG>Code:</STRONG><BR>
<STRONG></STRONG> <BR>
<!--StartFragment -->
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S31 {
font-style: italic;
color: #808080;
}
.L1S33 {
color: #4DA619;
}
</STYLE>
<SPAN> lv_objkey = <SPAN class=L1S33>''</SPAN>.</SPAN><BR>
<SPAN> lv_objtype = <SPAN class=L1S33>'CL_HRASR00_WF_PROCESS_OBJECT'</SPAN>. <SPAN class=L1S31>" type</SPAN><BR> lv_event = <SPAN class=L1S33>'TRIGGERED'</SPAN>. <SPAN class=L1S31>" event name</SPAN></SPAN> <BR>
<STRONG></STRONG> <BR>
<!--StartFragment -->
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S31 {
font-style: italic;
color: #808080;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
</STYLE>
<SPAN> <SPAN class=L1S52>CALL</SPAN> <SPAN class=L1S52>FUNCTION</SPAN> <SPAN class=L1S33>'SAP_WAPI_CREATE_EVENT'</SPAN><BR> <SPAN class=L1S52>EXPORTING</SPAN><BR> object_type = lv_objtype<BR> object_key = lv_objkey<BR> <SPAN class=L1S52>event</SPAN> = lv_event<BR> commit_work = <SPAN class=L1S33>'X'</SPAN><BR> <SPAN class=L1S52>IMPORTING</SPAN><BR> return_code = return_code<BR> event_id = event_id<BR> <SPAN class=L1S52>TABLES</SPAN><BR> input_container = lt_cont<BR> .</SPAN> <BR>
I don`t get any error messages, but I can`t see any new events started in t-code SWEL.<BR>
<BR>
<STRONG>Question 1: </STRONG><BR>
<STRONG>"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?"</STRONG><BR>
<STRONG></STRONG> <BR>
<STRONG>Question 2:</STRONG><BR>
<STRONG>"How do I start the event CL_HRASR00_WF_PROCESS_OBJECT from the report?</STRONG><BR>
<BR>
<STRONG></STRONG> <BR>
<STRONG>Challenge 2:</STRONG><BR>
<BR>
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 <BR>
the step "Export from Workflow container --> Form container". <BR>
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.<BR>
<BR>
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.<BR>
<BR>
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<BR>
will be set to completed, however, the next step "Export from Workflow container --> Form container" will get the status under processing, and continue in<BR>
an infinite loop.<BR>
<BR>
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.<BR>
<BR>
<STRONG>Question 3:</STRONG><BR>
<STRONG>"How can I manage to start the "Export from Workflow container --> Form container" step, without having to generate the step "DISPLAY FORM_A"?</STRONG><BR>
<BR>
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.<BR>
<BR>
Thanks in advance.<BR>
<BR>
Best regards, <BR>
<BR>
Tor<BR>
<BR>
<BR>
<BR>
<BR><br /><hr />See all the ways you can stay connected <a href='http://www.microsoft.com/windows/windowslive/default.aspx' target='_new'>to friends and family</a></body>
</html>