<!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>&nbsp;</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&nbsp;terminating event binding.&nbsp; Hope the example code&nbsp;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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>FUNCTION 
z_multi_view_maintenance.<BR>*"----------------------------------------------------------------------<BR>*"*"Local 
interface:<BR>*"&nbsp; IMPORTING<BR>*"&nbsp;&nbsp;&nbsp;&nbsp; VALUE(EVENT) 
LIKE&nbsp; SWETYPECOU-EVENT<BR>*"&nbsp;&nbsp;&nbsp;&nbsp; VALUE(RECTYPE) 
LIKE&nbsp; SWETYPECOU-RECTYPE<BR>*"&nbsp;&nbsp;&nbsp;&nbsp; VALUE(OBJTYPE) 
LIKE&nbsp; SWETYPECOU-OBJTYPE<BR>*"&nbsp;&nbsp;&nbsp;&nbsp; VALUE(OBJKEY) 
LIKE&nbsp; SWEINSTCOU-OBJKEY<BR>*"&nbsp;&nbsp;&nbsp;&nbsp; 
VALUE(EXCEPTIONS_ALLOWED) LIKE&nbsp; SWEFLAGS-EXC_OK DEFAULT 'X'<BR>*"&nbsp; 
EXPORTING<BR>*"&nbsp;&nbsp;&nbsp;&nbsp; VALUE(REC_ID) LIKE&nbsp; 
SWELOG-RECID<BR>*"&nbsp; TABLES<BR>*"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EVENT_CONTAINER STRUCTURE&nbsp; SWCONT<BR>*"&nbsp; 
EXCEPTIONS<BR>*"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
INVALID_MATCH<BR>*"----------------------------------------------------------------------<BR>&nbsp; 
INCLUDE &lt;cntain&gt;.<BR>&nbsp; DATA: old_wi_id LIKE 
swwwihead-wi_id.<BR>&nbsp; DATA: local_wi_header LIKE 
swwwihead.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>* search work 
item from receiver<BR>&nbsp; swc_get_element event_container evt_receiver_id 
old_wi_id.<BR>&nbsp; local_wi_header-wi_id = old_wi_id.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>* read workitem 
container<BR>&nbsp; CLEAR wi_container. REFRESH wi_container.<BR>&nbsp; CALL 
FUNCTION 'SWW_WI_CONTAINER_READ'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EXPORTING<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
wi_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
= local_wi_header-wi_id<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
TABLES<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
wi_container&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
= wi_container<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EXCEPTIONS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
container_does_not_exist = 01.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>&nbsp; READ TABLE 
wi_container WITH KEY element = 'VIEW'.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff size=2>&nbsp; CASE 
wi_container-value.<BR>&nbsp;&nbsp;&nbsp; WHEN 'V'. " 
Sales<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE wi_container WITH KEY element 
= 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE event_container WITH KEY 
element = 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF wi_container-value(4) 
&lt;&gt; event_container-value(4).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RAISE invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF.<BR>&nbsp;&nbsp;&nbsp; when 'L'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ 
TABLE wi_container WITH KEY element = 
'STORAGELOCATION'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE event_container 
WITH KEY element = 
'STORAGELOCATION'.<BR>************************<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
tables indx.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export wi_container-value 
event_container-value<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to database indx(wf) id 
'test1'.<BR>************************<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF 
wi_container-value+5(4) &lt;&gt; 
event_container-value(4).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAISE 
invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE event_container WITH KEY 
element = 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF wi_container-value+1(4) 
&lt;&gt; event_container-value(4).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RAISE invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF.<BR>&nbsp;&nbsp;&nbsp; WHEN 'S'. " 
Warehouse<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE wi_container WITH KEY 
element = 'WAREHOUSE'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE 
event_container WITH KEY element = 
'WHSENUMBER'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF wi_container-value+9(3) 
&lt;&gt; event_container-value(3).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RAISE invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF.<BR>&nbsp;&nbsp;&nbsp; WHEN 'D'. " MRP<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
READ TABLE wi_container WITH KEY element = 
'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE event_container WITH KEY 
element = 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF wi_container-value(4) 
&lt;&gt; event_container-value(4).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RAISE invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF.<BR>&nbsp;&nbsp;&nbsp; WHEN 'E'. " 
Purchasing<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE wi_container WITH KEY 
element = 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE event_container 
WITH KEY element = 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF 
wi_container-value(4) &lt;&gt; 
event_container-value(4).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAISE 
invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF.<BR>&nbsp;&nbsp;&nbsp; 
WHEN 'B'. " Accounting<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE wi_container 
WITH KEY element = 'PLANT'.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ TABLE 
event_container WITH KEY element = 
'VALUATIONAREA'.<BR>************************<BR>&nbsp;&nbsp; export 
wi_container-value event_container-value<BR>&nbsp;&nbsp; to database indx(wf) id 
'test3'.<BR>************************<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF 
wi_container-value(4) &lt;&gt; 
event_container-value(4).<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAISE 
invalid_match.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF.<BR>&nbsp;&nbsp;&nbsp; 
WHEN OTHERS.<BR>&nbsp; ENDCASE.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=080234210-21072006><FONT color=#0000ff 
size=2>ENDFUNCTION.&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Presently i'm given a task of creating workflow for material master 
  creation.&nbsp; Following is the scenario...</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>1. One user ( Initiator ) will create a basic data 1 &amp; 2&nbsp; 
  and&nbsp; the workflow should be triggered .</DIV>
  <DIV>&nbsp;</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&nbsp; 
  for creating the required view.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I have identified&nbsp; business object BUS1001006 for this workflow and 
  i'm planning to use the following methods and events.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Events :&nbsp;&nbsp; </DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Created 
  --&gt; to trigger the workflow</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  ViewCreated --&gt; terminating event for the Workitem ( for view creation 
  )</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Methods : </DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
  <DIV>&nbsp;&nbsp; GetMissedViews --&gt; to get all the required views to be 
  created for this material.</DIV>
  <DIV>&nbsp;&nbsp; CreateView&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  --&gt; to create required for the material.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I'm facing two problems......</DIV>
  <DIV>&nbsp;</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".&nbsp; </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>&nbsp;</DIV>
  <DIV>2. At the time of creation of basic data1 &amp; 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>&nbsp;</DIV>
  <DIV>Help me to reslove above 2 issues ......If any done workflow material 
  master please do share you technical expetise...</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Regards,</DIV>
  <DIV>Vijay</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</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>