<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1505" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>Hi
Vijay,</FONT></SPAN></DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>The problem with
creation of one material master view completing all other parallel workitems
view can be solved by creating a "view-specific" check function to
the terminating event binding. Hope the example code helps (its
from four years ago, so I'm a bit rusty on the details)</FONT></SPAN></DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff
size=2>Phil</FONT></SPAN></DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>FUNCTION
z_multi_view_maintenance.<BR>*"----------------------------------------------------------------------<BR>*"*"Local
interface:<BR>*" IMPORTING<BR>*" VALUE(EVENT)
LIKE SWETYPECOU-EVENT<BR>*" VALUE(RECTYPE)
LIKE SWETYPECOU-RECTYPE<BR>*" VALUE(OBJTYPE)
LIKE SWETYPECOU-OBJTYPE<BR>*" VALUE(OBJKEY)
LIKE SWEINSTCOU-OBJKEY<BR>*"
VALUE(EXCEPTIONS_ALLOWED) LIKE SWEFLAGS-EXC_OK DEFAULT 'X'<BR>*"
EXPORTING<BR>*" VALUE(REC_ID) LIKE
SWELOG-RECID<BR>*" TABLES<BR>*"
EVENT_CONTAINER STRUCTURE SWCONT<BR>*"
EXCEPTIONS<BR>*"
INVALID_MATCH<BR>*"----------------------------------------------------------------------<BR>
INCLUDE <cntain>.<BR> DATA: old_wi_id LIKE
swwwihead-wi_id.<BR> DATA: local_wi_header LIKE
swwwihead.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>* search work
item from receiver<BR> swc_get_element event_container evt_receiver_id
old_wi_id.<BR> local_wi_header-wi_id = old_wi_id.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>* read workitem
container<BR> CLEAR wi_container. REFRESH wi_container.<BR> CALL
FUNCTION 'SWW_WI_CONTAINER_READ'<BR>
EXPORTING<BR>
wi_id
= local_wi_header-wi_id<BR>
TABLES<BR>
wi_container
= wi_container<BR>
EXCEPTIONS<BR>
container_does_not_exist = 01.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2> READ TABLE
wi_container WITH KEY element = 'VIEW'.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2> CASE
wi_container-value.<BR> WHEN 'V'. "
Sales<BR> READ TABLE wi_container WITH KEY element
= 'PLANT'.<BR> READ TABLE event_container WITH KEY
element = 'PLANT'.<BR> IF wi_container-value(4)
<> event_container-value(4).<BR>
RAISE invalid_match.<BR>
ENDIF.<BR> when 'L'.<BR> READ
TABLE wi_container WITH KEY element =
'STORAGELOCATION'.<BR> READ TABLE event_container
WITH KEY element =
'STORAGELOCATION'.<BR>************************<BR>
tables indx.<BR> export wi_container-value
event_container-value<BR> to database indx(wf) id
'test1'.<BR>************************<BR> IF
wi_container-value+5(4) <>
event_container-value(4).<BR> RAISE
invalid_match.<BR>
ENDIF.<BR> READ TABLE event_container WITH KEY
element = 'PLANT'.<BR> IF wi_container-value+1(4)
<> event_container-value(4).<BR>
RAISE invalid_match.<BR>
ENDIF.<BR> WHEN 'S'. "
Warehouse<BR> READ TABLE wi_container WITH KEY
element = 'WAREHOUSE'.<BR> READ TABLE
event_container WITH KEY element =
'WHSENUMBER'.<BR> IF wi_container-value+9(3)
<> event_container-value(3).<BR>
RAISE invalid_match.<BR>
ENDIF.<BR> WHEN 'D'. " MRP<BR>
READ TABLE wi_container WITH KEY element =
'PLANT'.<BR> READ TABLE event_container WITH KEY
element = 'PLANT'.<BR> IF wi_container-value(4)
<> event_container-value(4).<BR>
RAISE invalid_match.<BR>
ENDIF.<BR> WHEN 'E'. "
Purchasing<BR> READ TABLE wi_container WITH KEY
element = 'PLANT'.<BR> READ TABLE event_container
WITH KEY element = 'PLANT'.<BR> IF
wi_container-value(4) <>
event_container-value(4).<BR> RAISE
invalid_match.<BR> ENDIF.<BR>
WHEN 'B'. " Accounting<BR> READ TABLE wi_container
WITH KEY element = 'PLANT'.<BR> READ TABLE
event_container WITH KEY element =
'VALUATIONAREA'.<BR>************************<BR> export
wi_container-value event_container-value<BR> to database indx(wf) id
'test3'.<BR>************************<BR> IF
wi_container-value(4) <>
event_container-value(4).<BR> RAISE
invalid_match.<BR> ENDIF.<BR>
WHEN OTHERS.<BR> ENDCASE.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff
size=2>ENDFUNCTION. </FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> sap-wug-bounces@mit.edu
[mailto:sap-wug-bounces@mit.edu]<B>On Behalf Of </B>K
Vijayasekar<BR><B>Sent:</B> 21 July 2006 05:04<BR><B>To:</B> SAP WF User
group<BR><B>Subject:</B> Re : Material Master Workflow<BR><BR></FONT></DIV>
<DIV>Hi Friends ,</DIV>
<DIV>
Presently i'm given a task of creating workflow for material master
creation. Following is the scenario...</DIV>
<DIV> </DIV>
<DIV>1. One user ( Initiator ) will create a basic data 1 & 2
and the workflow should be triggered .</DIV>
<DIV> </DIV>
<DIV>2. Other views like Sales , MRP , Scheduling will be created by different
people , hence each user should receive a workitem in their sap inbox
for creating the required view.</DIV>
<DIV> </DIV>
<DIV>I have identified business object BUS1001006 for this workflow and
i'm planning to use the following methods and events.</DIV>
<DIV> </DIV>
<DIV>Events : </DIV>
<DIV> Created
--> to trigger the workflow</DIV>
<DIV>
ViewCreated --> terminating event for the Workitem ( for view creation
)</DIV>
<DIV> </DIV>
<DIV>Methods : </DIV>
<DIV> </DIV>
<DIV> GetMissedViews --> to get all the required views to be
created for this material.</DIV>
<DIV> CreateView
--> to create required for the material.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I'm facing two problems......</DIV>
<DIV> </DIV>
<DIV>1. Using "GetMissedViews" i'm getting all the missing view details in a
multiline container element . I have created parallel task ( by putting
multiline container element in the "Others" tab . Terminating event for this
task is "ViewCreated". </DIV>
<DIV>Depending on the no. of views in the multiline item , that many workitem
gets created.</DIV>
<DIV>The issue is if once view gets created all the other workitems are
removed from my inbox ( status completed ). </DIV>
<DIV> </DIV>
<DIV>2. At the time of creation of basic data1 & 2 , the org. elements are
not required . I want to determine the agent for rest of the views by the
org.elements . How can we acheive it ???</DIV>
<DIV> </DIV>
<DIV>Help me to reslove above 2 issues ......If any done workflow material
master please do share you technical expetise...</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Vijay</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<P>
<HR SIZE=1>
Yahoo! Messenger with Voice. <A
href="http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">Make
PC-to-Phone Calls</A> to the US (and 30+ countries) for 2¢/min or
less.</BLOCKQUOTE></BODY></HTML>