cancel
Showing results for 
Search instead for 
Did you mean: 

queries regarding the workflow

Former Member
0 Kudos

Hi guys

I have created a workflow definition in SWDD and creted a object in SWO1 with an event. this event i linked to the workflow in tepe linkage table also. I tried to trigger the event from the abap report program .I have used standard FM SWE_EVENT_CREATE. I have added the FM SWW_WI_CREATE_VIA_EVENT as the receiver FM in the event.

But still when i run the report i can not see this event in event trace. When i debugged the program i have found that the Event id is generated by the FM SWE_EVENT_CREATE.

Do i have to add anything to the program or anything to be added to the event. PLease let me know

thanks

sankar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI

I am able to see the event trace now. Actually there were some settings problem in event trace tcode. This is solved now. I can see the event in the event trace now, but i am getting different error now

the error says "Feedback After error" . when i go into the details of the error it says "Import container contains errors (are any obligatory elements missing?)". when i checked in SWI6 for this workflow there are no active instances for this workflow, which means that the WF did not trigger.

Anybody please let me know what is the problem?????

thanks

sankar

Former Member
0 Kudos

Hi Sankar,

it looks like you are not passing values to all the event container elements which are required by the event container to workflow container binding. Or that they are of incompatible type.

Please reactivate your event linkage and double check if your event linkage bindings are ok.

Regarding the use of SWE_EVENT_CREATE, I also suggest you switch to using SAP_WAPI_CREATE_EVENT. It's a 'workflow-bapi' and should keep you out of trouble in any future upgrades. It also includes the commit work statement so the amount of code can also be reduced a bit.

Hope this helps,

Mikko

ps. Please post future workflow-related messages to the Netweaver-Business Process Management forum for more replies.

Former Member
0 Kudos

hi

i am giving my code here:

REPORT ZEMPWORKFLOW.

PARAMETERS : empid type ZEMPID obligatory,

empname type ZEMPNAME obligatory,

empDOB type ZEMPDOB obligatory,

empcont type ZEMPCOUNTRY obligatory.

INCLUDE <cntn01>.

DATA: objtype LIKE swetypecou-objtype,

event LIKE swetypecou-event,

objkey LIKE sweinstcou-objkey,

eventid LIKE swedumevid-evtid,

creator LIKE swhactor.

objtype = 'ZEMPLOYEE'.

event = 'UPDATE'.

clear objkey.

objkey(10) = empid.

swc_container z_container.

swc_create_container z_container.

swc_set_element z_container 'empid' empid.

swc_set_element z_container 'empname' empname.

swc_set_element z_container 'empdob' empDOB.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

OBJTYPE = objtype

OBJKEY = objkey

EVENT = event

IMPORTING

EVENT_ID = eventid

TABLES

EVENT_CONTAINER = z_container

EXCEPTIONS

OBJTYPE_NOT_FOUND = 1

OTHERS = 2.

.

IF sy-subrc = 0.

COMMIT WORK.

WRITE:/ 'Your event was created.'.

ELSE.

WRITE:/ 'There was an error creating the event.'.

ENDIF.

please tell me if you need any more info.

thanks

sankar

Former Member
0 Kudos

Your code seems to be OK.

Make sure that the BOR 'ZEMPLOYEE' is active and released.

The event linkage is correctly maitained. Test your workflow and event through the standrad transactions.

Former Member
0 Kudos

Can you provide the code to check?

Anyways, here is an example

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

OBJTYPE = 'FORMABSENC'

OBJKEY = KEY

EVENT = 'CREATED'

  • CREATOR = ' '

  • TAKE_WORKITEM_REQUESTER = ' '

  • START_WITH_DELAY = ' '

  • START_RECFB_SYNCHRON = ' '

  • IMPORTING

  • EVENT_ID =

TABLES

EVENT_CONTAINER = EVENT_CONTAINER

EXCEPTIONS

OBJTYPE_NOT_FOUND = 1

OTHERS = 2.

and use SWELS and SWEL transactions to trace the events.

pvanhoove
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

In addition of Roopesh, the event will be created at the next commit work.

Rgds,

Pierre