Raising a QMSM event with change doc MELDUNG - possible?
Hilsbos, Margaret A
Margaret.Hilsbos at dayzim.com
Wed Nov 30 08:27:37 EST 2005
Mike,
Thanks! I haven't been able to try it yet but your example should be all that I need.
If I figure out how to raise multiple events I'll post that here.
Thanks again,
Margaret
-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]On Behalf
Of Michael Pokraka
Sent: Tuesday, November 29, 2005 11:23 AM
To: SAP Workflow Users' Group
Subject: RE: Raising a QMSM event with change doc MELDUNG - possible?
Hi Margaret,
Always happy to help someone who has clearly spent some time and effort to try
and figure it out:
Hit F1 on the fields in SWEC and it gives you template FM's to copy to your own
:-)
I'm not sure how to do multiples of the same events without messing about with
it myself, so I'll stick to raising one event with a multiline container
element of your own type contianing the change(s) - key, old and new. So add a
custom FM to populate container and inside your copy of
SWE_CD_TEMPLATE_CONTAINER_FB_2, you'd do something like:
Data: l_cdpos like cdpos,
l_changes type zQmsmParnrChgs " Your custom struct
t_changes type standard table of zQmsmParnrChgs.
* Add all changes to table
loop at changedocument_position into l_cdpos
where tabname = 'QMSM'
and fname = 'PARNR'.
...assign l_cdpos-key/old/new to l_changes-parnr/old/new
...and append to t_changes
endloop.
if sy-subrc = 0.
* Add table to event container
call method event_container->set
exporting
name = 'ChangeList' " Your event parameter name
value = t_changes.
endif.
Should work... unchecked, untested, standard disclaimers apply.
Cheers
Mike
--- "Hilsbos, Margaret A" <Margaret.Hilsbos at dayzim.com> wrote:
> Mike,
>
> Thanks...I'll give this a try.
>
> I'm pretty weak at ABAP so if there is an example of what this might look
> like... :-)
> (You could save me some time; I'll struggle through it though if need be)
>
> It seems like the best approach if I can't fill the event container using the
> program-raised event as Anna suggested.
>
> Margaret
>
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]On Behalf
> Of Michael Pokraka
> Sent: Monday, November 28, 2005 5:09 PM
> To: SAP Workflow Users' Group
> Subject: Re: Raising a QMSM event with change doc MELDUNG - possible?
>
>
> Hi Margaret,
> OK you laid down the challenge, so here goes:
>
> You're mostly on the right track, but keep the event at the same level as
> your
> change doc, i.e. stick to the notification. Create an event
> ZRESPONSIBLEPERSONCHANGED with event parameter(s).
>
> In SWEC, specify your event using a FM - the changedocs are provided as
> parameters for your entertainment.
> The other FM in there is one for populating the event container, which is
> where
> you can put the Task number and old/new values.
>
> A design choice that depends on your intended usage is whether to have
> multiple
> events with one per task, or one event with all changed tasks as a multiline
> parameter.
>
> Cheers
> Mike
>
> --- "Hilsbos, Margaret A" <Margaret.Hilsbos at dayzim.com> wrote:
>
> > Hello WUGers,
> >
> > I have a perplexing little problem that I'm betting someone here knows just
> > the answer to.
> >
> > I want to trigger a WF based on a change in the field QMSM-PARNR, which
> means
> > a change to the "person responsible" for a task on a service notification
> (or
> > q-note, etc). But the only change document I found is MELDUNG, which is
> based
> > on the key for the notification, not the task. Since there can be many
> tasks
> > on a notification, it is possible that more than one task will have this
> > field changed in a single transaction. We need to trigger a workflow for
> each
> > task that is changed, or at least loop through a set of work items for each
> > task that was changed. We also need to be able to identify the old and new
> > values in QMSM-PARNR.
> >
> > QMSM-PARNR old and new values are written to CDPOS but I am unclear how to
> > handle the event trigger. SWEC wants an object like BUS2080 and CDHDR only
> > has the notification number as the key. I was wondering if I could use a
> > function module in SWED to translate the object key, using CDPOS -TABKEY
> to
> > get the key for QMSM....but I'm guessing I can't trigger separate events
> for
> > each TABKEY value on a single change document.
> >
> > Alternatively I think I could trigger the event based on BUS2080 and loop
> > through values in the workflow, using a multiline container element...but
> in
> > that case do the old and new values alternate in the container element? It
> > seems like it will be a pain to sort them out to the task numbers in the
> > loop.
> >
> > If I sound lost then I probably am... anyone want to help me out of the
> > wilderness? Can you give me a suggestion as to the best way to handle this
> > situation?
> >
> > Thanks!
> >
> > Margaret Hilsbos
> > Day & Zimmermann
> >
> >
> > _______________________________________________
> > SAP-WUG mailing list
> > SAP-WUG at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> >
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug
More information about the SAP-WUG
mailing list