First basic gata is created workitems should trigger to sales agent.Once a sale view is created and workitem should go to Purchase agent
On MM01 - basic data view - save - mail will go to all sales org (Marketing Agent) on sap workplace with status ready
double click on item & status will become 'reserved; with 3 options:
sale view reqd - open MM01 with sale view
sale view not reqd - will terminate work flow
Cancel & keep work item in inbox - Hold
on cretation of sales view - status will be 'completed' And this is my requirment
1) I had used the user Decision(TS00008267) with the two Decision Text
a)sale view reqd
b)sale view not reqd
And also i created a Agent by using Rule in this User Decision.So that workitems will trigger.
Based on the above two Decision Text two lines will be generated i.e One line is for sale view reqd and another line is for sale view not reqd
1)In the sales view Req - I created a Activity i.e (custom ) where it opens the MM01 tcode(To open MM01 and i created a Custom Method in Business Object) and also added the Event in the 'Terminating Events'
2)sale view not reqd - I created a process Control by putting the funciton Cancel Workitem
Until the sales View is created by sales agents and workitem should not go out from his inbox.Could you please tell me what exactly i need to add in Terminating Events tab of this Activity.
I added the code i.e SAP_WAPI_CREATE_EVENT in MM01 user exit and created a Custom Event
Could you please tell me what exactly i need to add in Terminating Events tab of this Activity becuase i created a Custom Event and that added this Event in the Activity of Terminating Event and also in this activity i Added the Method(I.e Custom Method where it open the MM01).but still with out creating Sales view and workitem is going out from inbox.
My Requirement is until the sales Agent is created the salesview and his workitem should not go out from his inbox.
Hi,
In the element write _WI_OBJECT_ID, Object catagory BO, Object type BUS2032 and in the event CREATED. Here assumed you take BUS2032 as container element for sales object(its depend on your sales business object).
I had writted the code in userexit of MM01
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'ZBS1001006'
OBJECT_KEY = objkey
EVENT = 'SALESVIEWCREATED'
* COMMIT_WORK = 'X'
* EVENT_LANGUAGE = SY-LANGU
* LANGUAGE = SY-LANGU
* USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
* TABLES
* INPUT_CONTAINER =
* MESSAGE_LINES = lt_msglines
* MESSAGE_STRUCT =
.
if sy-subrc eq 0.
commit work.
endif.
I created the Event 'SALESVIEWCREATED ' in SWO1 in the business object 'ZBS1001006'
and in the Activity and as you had i added the
_WI_OBJECT_ID as Element
BO in Object Category
ZBS1001006 as Object Type
'SALESVIEWCREATED' as Event
but still it is not working
Hi,
I think salesvew step is not asychronous thats why it is going out of inbox.
The best way you can use asynchronous method in the salesview step there you mention terminating method. Then call the task TS00008267.
I didn't understand exacltly your requirements but the "terminating event" is usually related to an asyncronous method of your BO. So, please check your task and method.
Regards,
Gianluca
Could you please let me know how to create the asyncronous method of my BO.becuase when creating Method in BO there will be checkbox i.e
1.Dailog
2.syncronous
i should uncheck the syncronous check box that is enough?
Could you please help me how to create the asyncronous method
Uncheck syncronous... and good luck!
I am using user exit EXIT_SAPLMGMU_001 in that there is include '
ZXMG0U02'.
where user hit save button in MM01 and it triggers this include ZXMG0U02'. in this user exit.
1)As per my requirment there are 17 views for MM01 and for every view i need to write Terminating Event in the Activity of my workflow
2)I had writted the code in the userexit
First for SalesView creation it is working fine and first it goes to the below code of the first time function module 'SAP_WAPI_CREATE_EVENT' and it is getting saved and Sales Data is getting and workitem is going out from inbox
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'ZBS1001006'
OBJECT_KEY = objkey
EVENT = 'SALESVIEWCREATED'
* COMMIT_WORK = 'X'
* EVENT_LANGUAGE = SY-LANGU
* LANGUAGE = SY-LANGU
* USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
* TABLES
* INPUT_CONTAINER =
* MESSAGE_LINES = lt_msglines
* MESSAGE_STRUCT =
.
if sy-subrc eq 0.
commit work.
endif.
*Check storage view is created or not
select single * from mard into gds_mard
where matnr eq WMARD-matnr
and werks eq WMARD-WERKS
and lgort eq WMARD-LGORT.
objkey = WMARD-matnr.
if sy-subrc ne 0.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'ZBS1001006'
OBJECT_KEY = objkey
EVENT = 'STORAGEVIEWCREATED'
* COMMIT_WORK = 'X'
* EVENT_LANGUAGE = SY-LANGU
* LANGUAGE = SY-LANGU
* USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
* TABLES
* INPUT_CONTAINER =
* MESSAGE_LINES = lt_msglines
* MESSAGE_STRUCT =
.
if sy-subrc eq 0.
commit work.
endif.
endif.
Now the workitem comes to create Storage view and it should navigate to second fucntion module with the Event 'STORAGEVIEWCREATED'.but the issue it goes to the first function module i.e with the Event ''SALESVIEWCREATED' and it is coming out from that Exit.
I want to go to function module for the Event 'STORAGEVIEWCREATED' by skipping when i create the 'STORAGEVIEW
When i hit save button in MM01 and it navigates to this user Exit for the first function module with the Eventname 'SALESVIEWCREATED' and it coming out from Exit and not going to another function module which has Event 'STORAGEVIEWCREATED'
I think it depends on the way you develop the user exit. You should be able to understand when you are creating the sales view or if it already exists. Remember that, when you're in the user-exit you don't have data available from the WF if you don't look for them using the SAP_WAPI_* functions for example.
Regards,
Gianluca
Could you please let me know how to get the data from the WF.So that it will be useful for me.
Is there any other way other Terminating Event.
For Example when ever a view is created and it will stored in MARC table.
Until its view is created and the workitem should not go out from inbox. can i keep any loop until Salesview created by checking in MARC table
when ever the workitem comes to inbox and he executed the workitem and navigates to the MM01 transaction and this is how i had designed the workflow.
After the Activity can i keep loop until Salesview created by checking MARC table the workitem should not go
but the problem is User Executes the workitem in SBWP but still it should be inbox until record exist in the MARC table
Could you please help me in this
thanks for the help i used raise an exception using macro: exit_cancelled and it worked
Try FM SAP_WAPI_WORKITEMS_TO_OBJECT to get the active wf and SAP_WAPI_READ_CONTAINER to read container data
Regards,
Gianluca
Hi,
yes Unchecking Synchronus is enough. And after creating the method when you use it in task there also it is automatically uncheck in task level.
I am using user exit EXIT_SAPLMGMU_001 in that there is include '
ZXMG0U02'.
where user hit save button in MM01 and it triggers this include ZXMG0U02'. in this user exit.
1)As per my requirment there are 17 views for MM01 and for every view i need to write Terminating Event in the Activity of my workflow
2)I had writted the code in the userexit
First for SalesView creation it is working fine and first it goes to the below code of the first time function module 'SAP_WAPI_CREATE_EVENT' and it is getting saved and Sales Data is getting and workitem is going out from inbox
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'ZBS1001006'
OBJECT_KEY = objkey
EVENT = 'SALESVIEWCREATED'
* COMMIT_WORK = 'X'
* EVENT_LANGUAGE = SY-LANGU
* LANGUAGE = SY-LANGU
* USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
* TABLES
* INPUT_CONTAINER =
* MESSAGE_LINES = lt_msglines
* MESSAGE_STRUCT =
.
if sy-subrc eq 0.
commit work.
endif.
*Check storage view is created or not
select single * from mard into gds_mard
where matnr eq WMARD-matnr
and werks eq WMARD-WERKS
and lgort eq WMARD-LGORT.
objkey = WMARD-matnr.
if sy-subrc ne 0.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'ZBS1001006'
OBJECT_KEY = objkey
EVENT = 'STORAGEVIEWCREATED'
* COMMIT_WORK = 'X'
* EVENT_LANGUAGE = SY-LANGU
* LANGUAGE = SY-LANGU
* USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
* TABLES
* INPUT_CONTAINER =
* MESSAGE_LINES = lt_msglines
* MESSAGE_STRUCT =
.
if sy-subrc eq 0.
commit work.
endif.
endif.
Now the workitem comes to create Storage view and it should navigate to second fucntion module with the Event 'STORAGEVIEWCREATED'.but the issue it goes to the first function module i.e with the Event ''SALESVIEWCREATED' and it is coming out from that Exit.
I want to go to function module for the Event 'STORAGEVIEWCREATED' by skipping when i create the 'STORAGEVIEW
When i hit save button in MM01 and it navigates to this user Exit for the first function module with the Eventname 'SALESVIEWCREATED' and it coming out from Exit and not going to another function module which has Event 'STORAGEVIEWCREATED'