Creating Terminating Events for Material Master Views

Zmudzin,Tomasz,VEVEY,GL-DS/DM Tomasz.Zmudzin at nestle.com
Mon Jul 15 10:10:52 EDT 2002


Hey, this is nice!
 
Cheers - Tomasz.
 
-----Original Message-----
From: Kisloff, Philip B [mailto:Philip.Kisloff at astrazeneca.com]
Sent: Monday, July 15, 2002 3:47 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Creating Terminating Events for Material Master Views
 
 
Hi,
 
I just caught this last message, and one can create a check function
module for the terminating event. This would ensure a terminating
event is only created for the particular view/org level of the WI:
 
FUNCTION z_multi_view_maintenance.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(EVENT) LIKE  SWETYPECOU-EVENT
*"     VALUE(RECTYPE) LIKE  SWETYPECOU-RECTYPE
*"     VALUE(OBJTYPE) LIKE  SWETYPECOU-OBJTYPE
*"     VALUE(OBJKEY) LIKE  SWEINSTCOU-OBJKEY
*"     VALUE(EXCEPTIONS_ALLOWED) LIKE  SWEFLAGS-EXC_OK DEFAULT 'X'
*"  EXPORTING
*"     VALUE(REC_ID) LIKE  SWELOG-RECID
*"  TABLES
*"      EVENT_CONTAINER STRUCTURE  SWCONT
*"  EXCEPTIONS
*"      INVALID_MATCH
*"----------------------------------------------------------------------
  INCLUDE <cntain>.
  DATA: old_wi_id LIKE swwwihead-wi_id.
  DATA: local_wi_header LIKE swwwihead.
 
* search work item from receiver
  swc_get_element event_container evt_receiver_id old_wi_id.
  local_wi_header-wi_id = old_wi_id.
 
* read workitem container
  CLEAR wi_container. REFRESH wi_container.
  CALL FUNCTION 'SWW_WI_CONTAINER_READ'
       EXPORTING
            wi_id                    = local_wi_header-wi_id
       TABLES
            wi_container             = wi_container
       EXCEPTIONS
            container_does_not_exist = 01.
 
  READ TABLE wi_container WITH KEY element = 'VIEW'.
 
  CASE wi_container-value.
    WHEN 'V'. " Sales
      READ TABLE wi_container WITH KEY element = 'PLANT'.
      READ TABLE event_container WITH KEY element = 'PLANT'.
      IF wi_container-value(4) <> event_container-value(4).
        RAISE invalid_match.
      ENDIF.
    when 'L'.
      READ TABLE wi_container WITH KEY element = 'STORAGELOCATION'.
      READ TABLE event_container WITH KEY element = 'STORAGELOCATION'.
************************ for testiing ***********************
     tables indx.
      export wi_container-value event_container-value
      to database indx(wf) id 'test1'.
*************************************************************
      IF wi_container-value+5(4) <> event_container-value(4).
        RAISE invalid_match.
      ENDIF.
      READ TABLE event_container WITH KEY element = 'PLANT'.
      IF wi_container-value+1(4) <> event_container-value(4).
        RAISE invalid_match.
      ENDIF.
    WHEN 'S'. " Warehouse
      READ TABLE wi_container WITH KEY element = 'WAREHOUSE'.
      READ TABLE event_container WITH KEY element = 'WHSENUMBER'.
      IF wi_container-value+9(3) <> event_container-value(3).
        RAISE invalid_match.
      ENDIF.
    WHEN 'D'. " MRP
      READ TABLE wi_container WITH KEY element = 'PLANT'.
      READ TABLE event_container WITH KEY element = 'PLANT'.
      IF wi_container-value(4) <> event_container-value(4).
        RAISE invalid_match.
      ENDIF.
    WHEN 'E'. " Purchasing
      READ TABLE wi_container WITH KEY element = 'PLANT'.
      READ TABLE event_container WITH KEY element = 'PLANT'.
      IF wi_container-value(4) <> event_container-value(4).
        RAISE invalid_match.
      ENDIF.
    WHEN 'B'. " Accounting
      READ TABLE wi_container WITH KEY element = 'PLANT'.
      READ TABLE event_container WITH KEY element = 'VALUATIONAREA'.
      IF wi_container-value(4) <> event_container-value(4).
        RAISE invalid_match.
      ENDIF.
    WHEN OTHERS.
  ENDCASE.
ENDFUNCTION.
 
Hope this helps (and works for you!)
 
Regards
 
Phil
 
-----Original Message-----
From: Zmudzin,Tomasz,VEVEY,GL-DS/DM [mailto:Tomasz.Zmudzin at nestle.com]
Sent: 15 July 2002 14:26
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Creating Terminating Events for Material Master Views
 
 
Quick and dirty: Before the loop calculate the deadline and put it into a
container element (calculation starting from the START OF THE WORKFLOW).
Then make the deadline of the task depend on this container element, with
the same reference point.
 
As this grows big and ugly, you can consider moving this "container
activation -- loop -- fork -- completion task ! wait for event -- end fork
-- endloop" into a separate workflow, to which you pass the view to be
completed along with the org units (check business object type MOFF for this
as well).
 
Kind regards,
Tomasz
 
-----Original Message-----
From: Marques Rodrigo (RBBR/ASE61) *
[mailto:Rodrigo.Marques at br.bosch.com]
Sent: Monday, July 15, 2002 3:18 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: RES: Creating Terminating Events for Material Master Views
 
 
Hello Tomasz,
 
Thanks a lot for your answer.
I thought that with specific terminating events I would be able to get rid
of the loops. Your answer alerted me that I will still need then.
 
My problem is that with the loops I4m not able to use Deadline notification
(I want to send a notification to the agent superior after 2 days if he
hasn4t completed the task). Everytime a view is created all active work
itens are terminated and the loop occurs. If the view created was not the
expected one a new work item for the same task is created again. Therefore
deadline can never be reached since the work item is finished and ceated
again.
 
I can4t find a way out of this situation...
 
Rodrigo
 
 
-----Mensagem original-----
De: Zmudzin,Tomasz,VEVEY,GL-DS/DM [mailto:Tomasz.Zmudzin at nestle.com]
Enviada em: segunda-feira, 15 de julho de 2002 04:12
Para: SAP-WUG at MITVMA.MIT.EDU
Assunto: Re: Creating Terminating Events for Material Master Views
 
 
Rodrigo,
 
The ViewCreated event passes to you the parameters which tell you, which
view (~maintenance status) was created, and for which organizational units
this was done.
 
Although it would be technically possible to have different terminating
events raised for each view, you will still need the loops to check whether
the creation processed in the system was done for the same organizational
unit that you're currently completing (e.g. you request creation of
accounting view for plant X001, and the ViewCreated event was raised for the
accounting view for plant X002 -- you probably don't want it to terminate
your work item).
 
Kind regards,
Tomasz
 
-----Original Message-----
From: Marques Rodrigo (RBBR/ASE61) *
[mailto:Rodrigo.Marques at br.bosch.com]
Sent: Friday, July 12, 2002 7:57 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Creating Terminating Events for Material Master Views
 
 
Hello Folks,
 
Here is the situation...
 
I4m working on a workflow solution for creating Material Master using object
BUS1001006.
The tasks for creating the Material Views (one for each diferent view) need
a Terminating Event.
At the moment I4m using event ViewCreated (already exists at R/3 4.6C but I
don4t know where it's coded).
The problem is that with this event I don4t know exactly wich view was
created and this is causing a lot of troubles (in parallel processing,
deadline monitoring..).
 
Finally the question is...
 
Does anybody have an idea on how can I create a diferent terminating event
for each material view that is created?
This would really be a great improvement. Today I am using loops around each
task to see if the created view was the expected one.
 
Thanks in advance for your attention and patience.
 
Kind Regards
 
Rodrigo Marques
Robert Bosch Brazil
 


More information about the SAP-WUG mailing list