Events in SWO1
Hi Experts,
How to Create the Events in SWO1 and how the code for this is written.
Plz also explain the generation of event as i have seen for many objects that there are no codes then how that event is actually triggered..
Plz reply
Regards
Hi Rahul,
The reason for this is the event invoking code is found in the calling application. This can be in various ways depending on the module you are working in. In HR the invokation is controlled using entries in T779W and T779X. In other areas you can use change document wizards or exits/BADIs.
You can also invoke the event programmatically using a WAPI such as:
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'BUS7026'
OBJECT_KEY = L_OBJKEY
EVENT = 'CompletedAppraisal'
IMPORTING
RETURN_CODE = l_ret
TABLES
INPUT_CONTAINER = GT_CONT.
In this case the event CompletedAppraisal for the Appraisal (BUS7026) object. The contents of the input container are determined by the event parameters.
Regards
Gareth
Message was edited by:
Gareth Ellem
Similar Messages
-
Error in wait for event activity
hi all,
i am gettin gfollowing error when i am using wait for event activity in my WF.
wait step 0000000088: No valid object ID in container element 'EVENT_BOR'
'EVENT_BOR' is my container element of type BOR object which contain event.
please tell me correct way to use wait for event step.
i am using this on one parallel branch of Fork.
thanks.Hi,
check the event in SWO1 if there is an import parameter defined. If there is one you have to define the binding in the task waiting for event. You have to bind the relevant object type from workflow to containerelement &_WI_OBJECT_ID& of the event container.
reagrds,
Steffen -
Object : DRAW Event : Released
Hi All,
In one of my workflows I am trying to put wait for event RELEASED of BO : DRAW . When I check in SWO1 there is no event called RELEASED. Since I there is no event in SWO1 I can`t put the wait event. But when I release a document through CV02N, I can see (through SWEL) an event Released being raised. What am I missing ? Please help.
And also. there is no subtype for DRAW in system, so delegation possibilty is not there.
Thanks,
Anuj Sethi
Edited by: Anuj Sethi on May 21, 2008 1:29 PMIn SWUE its not there. And I have found out one thing. in SWEC one can maintain the event even if its not there( instead of using F4 one can key in the event and the system accepts it with a warning message, We are on ECC 6.0 . ) . thats something strange because it hold no validity or use (to my knowledge). I will try creating a custom event and using change doc for that, Will keep you guys posted. in the mean time please let me know if something strikes to you !!
Thanks
Anuj Sethi -
Hi Experts,
Plz Explain in details about the creation of Event in SWO1 for any Object.
For BUS2012, there are eventsbut the programs corresponding to that is not written. then how it works ?
Plz Explain....for Custom Events Creation also..
Reply
RegardsYou can trigger an even via a function module:
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
OBJTYPE = '<BusinessObject>'
OBJKEY = <TheKey>
EVENT = '<TheEvent>'
TABLES
EVENT_CONTAINER = Z_CONTAINER
EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ELSE.
ENDIF.
You can also trigger the event with change documents. See transaction SWEC. You can also add field restrictions
EXAMPLE:
EINKBELEG BUS2012 RELEASESTEPCREATED
Also have a look at Transaction SWETYPV. -
Standard Workflows DBM 7.0
hi,
Is there standard Workflows available for PR, PO approvals for parts and vehicles and Sales Order, Sales Invoice, Service Order, Service Invoice approvals for parts and vehicles in DBM 7.0?..
Thanks in advance,Hello
you have to create your own Business objects and events in SWO1 and than tigger the corresponding event in the DBM order engine.
This is possible but it requires knowledge in Workflow and DBM Order engine
Stephan -
HI,
I am trying to trigger a workflow whenever a contract is created against the Requisition.
I put the trace on(SWELS) and created a contract and got BOR object FREBUS2012 and Event CREATED.
But when i am using this BOR object and Event in the start event of workflow and creating a contract it is not triggering the workflow. But workflow is getting trigered whenever i am creating PO.
When i am tracing PO creation in SWELS i am getting same BOR object and same event.
Can anyone help me with that how can i create release strategy for Contract or how can i create "CREATE" event for BOR ZBUS2014 which is the copy of BUS2014(Contract) and does not have "CREATE" event.
Can you explain me also what is release strategy. I have no idea what is that for and how it is helpful in Workflow.
Any help would be appreciated.
Thanks in Advance.Hi,
Can anyone help me with that how can i create release strategy for Contract or how can i create "CREATE" event for BOR ZBUS2014 which is the copy of BUS2014(Contract) and does not have "CREATE" event.
You don't see the created event in ZBUS2014 because you have not delegated it. Delegation means whenever created event of BUS2014 gets triggered your BO ZBUS2014 which has been delegated to BUS2014 will be called. After delegating the BO in workflow you can refer to BUS2014 wherever required instead of giving as ZBUS2014.
Steps for delegation
1. Go to SWO1 tcode
2. Enter the BO name as ZBUS2014. Click settings - delegate.
3. Click new entries. You will find three fields there.
Give Object type as BUS2014. Person responsible as your userid. Delegation type as ZBUS2014 and save this entry.
KR,
Bharath -
Events available in Generic Object Services (GOS)?
Hello everybody
Searched around in SDN and also tried to find something useful in our system (SWO1) but can't find useful information on GOS events so I guess it probably doesn't exist?
I'm searching a way to catch GOS events when someone adds, changes or deletes an attachment (URL) in the generic object services of an object, e.g. for a material master (BUS1001006). I'd like to create a change document for this and based on that to trigger some further processing for one of our interfaces.
Anybody out there knowing how to achieve this?
TIA and best regards,
RenaudThere's a couple of BaDIs with GOS names such as GOS_SRV_REQUEST that might help. Otherwise I'd try using SE30 with lots of logging options set on to trace where you may be able to grab this info from. GOS subscriptions may be another thing to look at.
Jonathan -
Hi Guys,
I have to create a event for Health Benefit Plan (HR module). I created a Change Doucment object using transaction SCDO and generated. For this CHange Document Object i have to create the event.
I wnet to transaction SWED and in the Change Docu. Object column,If i search for my Object using F4 help, i dont find the object what i created.
Can anyone please guide, what i missed and how to create????
Thanks
VinodHi Vinod,
Have a look at this link:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e06f2480-02de-2a10-72af-eed9a513a6c6
Or
if u want to create a zevent .
just go to swo1-> create zBO -> create zevent.
Delegate ur standard BO.
Then go to SWEC.
write change Doc name ,BO name, Event name there.
Hope it helps u!
Regards,
Mamta -
Regarding Workflow triggering event.
Hi,
Description: I have created a Object type and a event for the same by transaction SWO1, after that i have created a WorkFlow(WF) for which the triggering event is the event i have created in the Object Type. There is a report in which i have used the FM "SWE_EVENT_CREATE" and passed the Object Type, Event Name, Key field values and the creator.
Problem: When i am executing this report the FM is called and the sy-subrc after call is 0, stating that the call was succesfull, but the WF is not getting triggered when i went to transaction SWI2_FREQ to check this WF is not at all triggered. But when i tested from WF transaction SWDD it is working fine.
Could anyone please explain me on this. or is there any other way to use an event of a Object Type to trigger WF.
Thanks and Regards,
Raghavendra Goutham P.hi gauthum,
try this chks.
Workflow Trace On/Off - SWU8
Display - SWU9
Delete - SWU10.
Work Item Analysis - SWI1
Identifying workflow for the work Item :
Tx : SWI1 - Enter the workiem id which has been identified in workflow log
The details consists of workflow of the workitem.
WorkFlow Errors :
1. Workflow Not Started - Using Event Trace we can Identify
2. Started but No Proceeded - Wrong Object Keys
3. Problem in Work Item Execution
Dialog Work Item - Agent Determinaion Error ( Position,Role,User )
- Role Resolution Error
Reqd Element would no be
Set in Binding
Background Work Item - Make Foreground and Test once Sucessfull make it Back round
rgds
nver
if hlped mark points -
How in ABAP do you develop a class to publish an event externally
Hi all,
I am trying to publish equipment information to multiple systems using ECC 6.0 and PI 7.1
Here are two articles which I have read which were very useful
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/800e2826-718c-2a10-f680-d6b29f0dce18
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0334534-aa28-2b10-a3a2-9ed4135727ed
High level overview of what I've done is as follows.
PI
- I developed a generic Service Interface called Asset_Sync and mapped this to a non SAP backend system to persist the equipment information (this all works fine).
- I also published the Sender Agreement for Asset_Sync to ESR
ECC 6.0
- I generated a client proxy ZEFI_CO_ASSET_SYNC from the ESR entry for Asset_Sync
- I used transaction SWF_BAM and have created an event linkage for object type EQUI event Changed
Here is where I am stuck
I now need to define the Proxy object to publish the equipment information to PI.
I am not sure if I have to extend the object EQUI to ZZEQUI and whether I need to create a method execute-synchronous.
I am really looking for some sample code of how to create the Proxy object and link it to the event.
Regards,
John
P.S.
I have coded a test program which calls the proxy and sends the information to PI and then to the third party system it looks as follows and works fine, it is just a shell right now once I have finished linking it to the event I will enhance the message interface and pass real values (for now my mapping in PI just hardcodes enough data so the publish to the back end system works). Basically althugh this works I need to execute this automatically from the event being triggered and hence need to move this into a proxy with event linkage.
FORM CREATE_ENTITLEMENT .
DATA: lv_assset_sync_req TYPE ZEFI_ASSET_SYNC_REQUEST,
lv_assset_sync_resp TYPE ZEFI_WSRESPONSE1.
CREATE OBJECT lv_asset_sync_proxy
EXPORTING
LOGICAL_PORT_NAME = 'ASSET_SYNC_DX3'.
*TRY.
*TRY.
CALL METHOD LV_ASSET_SYNC_PROXY->ASSET_SYNC
EXPORTING
OUTPUT = lv_assset_sync_req
IMPORTING
INPUT = lv_assset_sync_resp.
Write :/ 'Status : ', lv_assset_sync_resp-WSRESPONSE-STATUS.
WRite :/ 'Code : ', lv_assset_sync_resp-WSRESPONSE-CODE.Hi all,
I thought I'd give an update.
After reading a number of articles and documentation (see below).
It appears it may be easier to create a new class using SE24 rather than extending the Business Object in SWO1.
I've done the following which works via a user-exit.
a. Create Class ZZEQUI
b. Create an Instance Dependent Object to Publish the Entitlement
c. Leverage User Exit MV50AFZ1 - FORM USEREXIT_SAVE_DOCUMENT_PREPARE
d. Created Include ZSDI_DELIVERY_PUBLISH
i. Loops through serial numbers
ii. Create Object LV_ASSET EXPORTING EQUNR = LV_EQUNR
iii. CALL LV_ASSET->Publish.
If I add the Interface IF_WORKFLOW to my class then I may be able to be trigger it from SWF_BAM.
The solution I have is working, if I decide to go with BAM and have additional questions I'll raise this in either the workflow or ABAP Objects forums.
Regards,
John
Addtional articles and documentation
i. Business Object Macros http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4ad23453d11d189430000e829fbbd/frameset.htm
ii. Integrating Abap Objects with Workflow http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0409e6c-d213-2d10-3cb6-c12d417626c1
iii. Why Use ABAP OO with workflow /people/jocelyn.dart/blog/2006/06/19/why-use-abap-oo-with-workflow
iv. ABAPOO for WUG http://wiki.sdn.sap.com/wiki/display/HOME/2.Designand+Development#2.DesignandDevelopment-HowcanIuseABAPOOClassesinWorkflow%3F -
Work flow Event Creation.
Hi All,
I would like to create a custom event in object type BUS2038 to send notification if extra information is required on the Order.
can you please take me through the procedure of creating an event and linking it to an object type and field on the transaction screen.
Please advise.
MMHi,
First create a subtype ZBUS2038 for the business object BUS2038 by copying it from SWO1 Tcode.
then define acustom event for this custom object. save and activate.
If you want a custom method for this create a method also.
release the Method, event and then the Object.
Create a Task in PFTC and add this ZBUS2038 object and the relavent method
then define the triggering event which you have created and define the binding and event linkage and build the workflow builder and use it.
reward if useful
regards,
ANJI -
Workflow not getting triggered from webdynpro event
Hello gurus,
I have a requirement in which if an employee changes his own information on the ESS portal, then an approval should be done by HR. For this i created a custom webdynpro application in which i fetch the employee data and check it with old data in one view and when user clicks save button the approval workflow should be triggered.
For this i created a custom BO using transaction SWO1. I added a 'CHANGE' event and 'send_data_to_wf' method.
In SWDD i created the workflow which is working fine when i test it in SWDD only. But when i trigger it using FM 'SWE_CREATE_EVENT', only the event is getting triggered and not the workflow. I checked the trace in transaction SWEL in which i can see the 'CHANGE' event under Event column but Name of Reciever Type column is emty. It should display my custom workflow ID. Please let me know where i m lacking or going wrong.
Regards,
Yayati EkboteHello Ricardo,
Thanks for immediate reply. Yes, the linkage is active in SWE2. My custom object type is ZHRAD and event is change. I also tried the FM 'SAP_WAPI_CREATE_EVENT'. But in this FM the event also doesn't get triggered. Using FM 'SWE_CREATE_EVENT' atleast triggers the event. I debugged the FM. The container inside the FM is remaining initial. I am posting my code which i am using.
DATA: pernr TYPE pa0001-pernr VALUE '40000001'.
DATA: objtype TYPE swr_struct-object_typ VALUE 'ZHRADCHO',
objkey TYPE sweinstcou-objkey,
event TYPE swr_struct-event VALUE 'CHANGE',
it_wfcont TYPE STANDARD TABLE OF swcont,
wa_wfcont TYPE swcont,
event_id TYPE swedumevid-evtid,
ret_code TYPE swedumevid-evtid.
wa_wfcont-element = 'PERNR'.
wa_wfcont-value = '40000001'.
APPEND wa_wfcont TO it_wfcont.
wa_wfcont-element = 'SUBTY'.
wa_wfcont-value = '1'.
APPEND wa_wfcont TO it_wfcont.
wa_wfcont-element = 'ENDDA'.
wa_wfcont-value = sy-datum.
APPEND wa_wfcont TO it_wfcont.
wa_wfcont-element = 'BEGDA'.
wa_wfcont-value = sy-datum.
APPEND wa_wfcont TO it_wfcont.
objkey = pernr.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = objtype
objkey = objkey
event = event
* CREATOR = ' '
* TAKE_WORKITEM_REQUESTER = ' '
* START_WITH_DELAY = ' '
* START_RECFB_SYNCHRON = ' '
* NO_COMMIT_FOR_QUEUE = ' '
* DEBUG_FLAG = ' '
* NO_LOGGING = ' '
* IDENT =
* IMPORTING
* EVENT_ID =
* RECEIVER_COUNT =
TABLES
EVENT_CONTAINER = it_wfcont
EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK. -
Help on workflow event container creation.
Can any one tell me how to create event containers in workflow? If the steps will be given in details it will be very help.Pls
Hi,
Events are part of business objects, events are linked to workflows, in the linkage you can link the standard container elements, like initiator to workflow containers and you can link the attributes of the (then) instantiated business object to containers in the workflow.
You can create additional attributes on business objects in SWO1 (make sure you don't change the sap standard, rather create a subtype and uses delegation (also doable in SWO1) to "override" the sap standard.
You can create additional containers in pftc, type is WS and task is your workflow number after pressing change you can tick the tab container to create additional containers and in the tab starting events you can change the event-->wf linkage.
Kind regards, Rob Dielemans -
Terminating Event to Event Queue due to Work Item Lock
I have a dialog workflow task based on an asynchronous method defined with a terminating event. When the user executes the work item, the method generates the terminating event (via a V2 change document) but the work item is enqueued (locked) by the same user (locked when they execute the work item from SBWP) and therefore the terminating event goes into error and is placed in the event queue. The background job which processes the event queue does not redeliver the event so it stays in the event queue and the work item fails to complete. Other than dequeing the work item lock myself with a function call how do I get around this catch 22?
Hello Martin,
Actually, the locking happens whether I have the task as asynchronous or synchronous. The problem is the timing. If the user does not release the lock (by backing out of the dialog which is executed) prior to the terminating event attempting to enqueue and complete the work item then the event goes into error and is inserted into the event queue (and lingers there indefinitely, almost). Another issue with the asynchronous approach is that even if the user backs out of the dialog before the event actually attempts to complete the work item they will still see the work item in the inbox unless they click the refresh button when they get back to the inbox.
I have changed the task to synchronous but here is my scenario and another question.
The process being workflowed is the approval of service entrysheets (similar to an invoice if you are not familiar with External Services). In our process, there are a large number of documents being created and requiring approval by particular approvers. It is a normal scenario for an approver to have, lets say 25 documents in his inbox awaiting approval. It was not practical for him to have to navigate back and forth between his inbox and the approval task screen. Therefore, I give the users the option of (when executing a work item) having all the documents in his in-box (for this particular task) be presented in an approval list screen. They can then do a mass approval of the 25 documents with 1 click and 1 navigation. This list screen is also available to be executed outside workflow via a tcode. So, when the user executes the mass approval (either from the inbox or outside workflow) the work items are terminated via the terminating event assigned to the approval task.
A couple of issues remaining:
1) Given my example of 25 work items (user executes 1 work item from in-box
and I displayed all 25) being approved, when the user returns to the in-box, the 24
items remain in his inbox until he clicks the refresh button since these were not actually "executed" from the workflow engines point of view. However, these were terminated successfully because they were not "locked".
<b>Question:</b> Is there a way (user exit?) to trigger the inbox refresh automatically.
2) Now, the issue with the actual work item which the user executes from the inbox. As I mentioned, the work item is locked as soon as the user executes it and is not released until they back out of the dialog or logoff. So, here is what happens: If the terminating event is sent before the lock is released the event is sent to the event queue. If they then back out back to the in-box, its OK since I put some code in the SWO1 object type program (rememeber, its now synchronous) which will determine if they did the approval/rejection and the work item will complete and the event in the event queue will be deleted the next time the Event Queue Background job runs (it deletes any events for work items already in COMPLETED status). However, lets say they simply log off rather than backing up to the in-box or they don't do anything and are eventually logged off by timeout. In this case the code in the object type program to determine if the approval/rejection was done does not get executed (control does not return to the object type program) and the work item remains in "STARTED" status and remains in the users inbox and the event is in the event queue. So, now we have a work item that should be completed still sitting in the users in-box and the terminating event in the event queue. So the next time the user goes to their inbox the work item is still there. The interesting thing is that though this may be confusing to the user, if they then attempt to execute the work item, they will get a message: "Work item currently being completed by event" (Message SWF_RUN 644) and the event sitting in the event queue gets redelivered and completes the work item. To alleviate this problem I was thinking of adding a call to SAP_WAPI_WORKITEM_COMPLETE in the approval list screen after they do the approval but I'm guessing it wont work since it probably will try to enqueue the work item and it will still be locked.
Hopefully you haven't nodded off reading this rambling note...
Thank you,
Bob -
Start workflow with f. module to trigger event and how to pass data to BOR?
Hi,
I have a custom BOR object, with Event "Created". I have also an attribute in this BOR, just simple field Plant.
I have prepared a custom Workflow which is triggered when event Created of that custom BOR business object is raised.
To raise an event and to start a workflow I run f. module SAP_WAPI_CREATE_EVENT.
I have a problem to pass a Plant value to the Workflow container. In the PFTC_CHG for my Workflow I made the container
of BOR object, and the data binding &_EVT_OBJECT& => &MATREQ& (symbol of my BOR).
Below both of EVTOBJECT and MATREQ I can see my field Plant.
Then I run f. module SAP_WAPI_CREATE_EVENT with tables parameter input_container.
I try to fill the data in many ways, but the started workflow does not have Plant filled.
I try to use '_EVT_OBJECT.WERKS' in field name for input_container parameters.
Business Object is passed to the Workflow container, but I do not get the fields
as attributes. Do I have to use the parameters for the event Created ?
Thank you in advance
WojtekHello,
I've never used GUID as a key but I suppose the principles are the same - the object instance is equivalent to "something", say a widget.
This widget has attributes, e.g. the factory where it was created, the day it was created, its weight etc.
If you make a widget BOR object and you specify attributes then you're telling SAP how, given the key, it can deduce the value of the attributes. Widget 1234's weight can be looked up in table XXX by doing this select.
If you pass an object instance to a workflow then all you need to pass is the type of object and the key, the rest can be done by the workflow (or any other program). It can instantiate the object, and the attribute values are immediately available.
If you can instantiate the object in SWO1 and the attributes get values, then it should work in the workflow as well.
If not, please provide the code of the attribute or describe how it finds the attribute value.
regards
Rick Bakker
hanabi technology
Maybe you are looking for
-
I have a UI design where I'd like to be able to provide the capability for the user to expand and collapse a pane on the left side of the window for access to a search pane. On the right side will be a pane with a table on the top containing a list
-
After updating, firefox stopped loading. Have tried nummerous uninstall, reinstallation. But still after double-clicking the firefox icon (or opening in any way), the computer thinks about for a sec and then...nothing happens. I have opened up task m
-
Do High Quality Media Render files keep piling up?
I just noticed that a file I worked on over time, through a number or revisions, had Render: High Quality Media files from all kind of dates. It added up to 15GB. I deleted it and re-rendered and it came to 1 GB. Is it possible that FCPX isn't replac
-
Hello , my Laptop with Winp XP lost every 5 - 20 minutes the Wlan connection to my Airport express v 7.6.1 . The iPhone 4 iOS 6 and the iMac 21 connection work's stable on wlan network , but my iPhone 5 hast everytime a very bad transferrate over AP
-
How to install JComm in VAJ?
Installing JComm means: - Copying comm.dll into jre\bin directory - Copying the jar with the JComm classes into jre\lib - Copying the jcomm properties file into jre\lib I want to develope using VAJ, but I do not know how to handle the dll and propert