cancel
Showing results for 
Search instead for 
Did you mean: 

Data Flow is not working in Workflow

Former Member
0 Kudos
216

Hello!

I want to start my workflow with 'SAPI_WAPI_CREATE_EVENT'.

But the workflow is not starting because it has error in the data flow of its task. Goal of the workflow is that the event send an email to the employee.

what should i do in the data flow? what have I put in the data flow?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

This message was moderated.

bpawanchand
Active Contributor
0 Kudos

Hi,

Things that you need to take care when you are actually using workflows.

1. Make sure that the workflow is assigned with proper Agent Assignement.(General Task )

2. Make sure all the mandatory parameters are passed to the workflow container while starting the workflow by using events.

3. Make sure that the agent assignment definition is tranported to the other system after the workflow tempalte is moved.

4. Event linkages is linked witht eh workflow tempalte in the basic data of the workflow.

I feel in your case you have to check for the point 2. As mentioned above.

Regards

Pavan

Former Member
0 Kudos

I created an ABAP-Class with the event 'create_wf' and the method 'create_workflow' .

This class includes the interfaces bi_object, bi_persistent and if_workflow.

My method 'create_workflow' call the FM 'SAP_WAPI_CREATE_EVENT'. But what are the exporting parameter 'object_type' and object_key' and 'event'? Is 'event' my own event 'create_wf'? And where I define the event? (My report calling the method 'create_workflow'. Is this the definition?)

In my workflow I have the task and I don't know which objects or parameters to put in in the data flow? In the task (flag 'basic data') I have the object category APAB class with the object type 'zsieb_startwf' (name of my class) and the method i explaind before 'create_wf' (which is my event in the class)'. in the flag event trigger I put the same data again.

Did I forget anything?

Where do I integrate my workflow in my class? Or is this unnecessary?

Hope, you understand now my problem better.

keohanster
Active Contributor
0 Kudos

I created an ABAP-Class with the event 'create_wf' and the method 'create_workflow' .

This class includes the interfaces bi_object, bi_persistent and if_workflow.

My method 'create_workflow' call the FM 'SAP_WAPI_CREATE_EVENT'. But what are the exporting parameter 'object_type' and object_key' and 'event'? Is 'event' my own event 'create_wf'? And where I define the event? (My report calling the method 'create_workflow'. Is this the definition?)

In my workflow I have the task and I don't know which objects or parameters to put in in the data flow? In the task (flag 'basic data') I have the object category APAB class with the object type 'zsieb_startwf' (name of my class) and the method i explaind before 'create_wf' (which is my event in the class)'. in the flag event trigger I put the same data again.

Did I forget anything?

Where do I integrate my workflow in my class? Or is this unnecessary?

Hope, you understand now my problem better.

Hi Anna,

I think you may be confusing 'events' as they relate to Workflow and 'events' as they exist in classes.

There is a table which contains business object related events, SWETYPV. This provides the linkage between your business object (such as Invoice, BUS2081, or Purchase Order, BUS2012) and Event (Created, Changed, etc) and your workflow.

You need to know what object type and what event (in the workflow context) are required before you can proceed.

So if you are trying to start a workflow from SAP_WAPI_CREATE_EVENT, your import parameters might be:

call function 'SAP_WAPI_CREATE_EVENT'

exporting

object_type = 'BUS2081'

object_key = yourdocumentkey

event = 'CREATED'

commit_work = 'X'

event_language = sy-langu

importing

return_code = lv_retcode

event_id = lv_eventid.

Then, in transaction SWETYPV, you would have an entry linking the Object/Event pair to the 'receiver' - the Workflow Template, and use a Receiver Function Module such as SWW_WI_CREATE_VIA_EVENT_IBF to actually raise the event.

Regards,

Sue

Former Member
0 Kudos

Hi Susan,

thanks for your answer, but it didn't help me.

I don't think that BUS2081 will help me, because I just want to send an email. I create my own workflow, well, I try to create my own workflow with my own class and my own event. But I cannot relate them all together. The debugger didn't show me any problem. And the check-button also say that there are no inconsistency.

My code:


method CREATE_WORKFLOW.

  DATA:
      i_obj_key                       TYPE swr_struct-object_key,
      i_evt_name                      TYPE swr_struct-event,
      i_obj_type                      TYPE swr_struct-object_typ.

  CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
    EXPORTING
       object_type     = i_obj_type
      object_key      = i_obj_key
      event           = i_evt_name
     COMMIT_WORK             = 'X'
     EVENT_LANGUAGE          = SY-LANGU
     LANGUAGE                = SY-LANGU
     USER                    = SY-UNAME
*     IFS_XML_CONTAINER       =
*   IMPORTING
*     RETURN_CODE             = lv_retcode
*     EVENT_ID                = lv_eventid
*  TABLES
*    INPUT_CONTAINER         =
*    MESSAGE_LINES           =
*    MESSAGE_STRUCT          =
            .

*  COMMIT WORK.

endmethod.

Former Member
0 Kudos

Hi Anna

your object type has ro be some particular object type. In the example given by susan, she has used BUS2081. This will not be in your case. Object typ ecan be a BOR object or it can be abap class.

The object key will be the unique key to start the workflow.

You can check the following links

http://wiki.sdn.sap.com/wiki/display/ABAP/GettingstartedwithABAPOOforWorkflow...usingtheIF_WORKFLOW+interface

http://wiki.sdn.sap.com/wiki/display/ABAP/UsingABAPOOmethodsinWorkflowTasks

Regards

Preeti

Former Member
0 Kudos

Hello again!

Found my problem:

I used the FM 'SAPI_WAPI_CREATE_EVENT' in my class. This module is for BOR-Objects.

Now I use the FM 'SAP_WAPI_CREATE_EVENT_EXTENDED' and the method starts my workflow without problems.

keohanster
Active Contributor
0 Kudos

Hi Anna,

Please tell us where and how you are using SAP_WAPI_CREATE_EVENT? Have you made the corresponding entry in the event linkage table (SWETYPV)? What business object and event are you trying to trigger a workflow for? Does the event already exist?

Regards,

Sue