Defining a new method for business object

Zmudzin,Tomasz,VEVEY,GL-DS/DM Tomasz.Zmudzin at nestle.com
Thu Feb 7 10:12:19 EST 2002


Ronen,
 
in your current setup for the workflow setup there's no way to tell what
actions ("Save", "Exit", "Cancel", "Process", "Do it!", "Poooooh!") the user
has chosen.
 
To fix this you need to:
 
1. Change your function module so as to raise an exception (e.g. CANCELLED)
if the user cancels processing
2. When calling this function module retrieve the processing result, e.g.
 
CALL FUNCTION 'Z_WF_BBC_STRATEGY'
 IMPORTING
   BBC_SCORE                  = BBC_SCORE
EXCEPTIONS
  CANCELLED = 9000.
 
3. Should the exception be raised, call the macro EXIT_CANCELLED, e.g.
 
IF SY-SUBRC = 9000.
  EXIT_CANCELLED.
ENDIF.
 
This should do the job.
 
If you don't like using the exceptions, you can also pass the return value
from your function module as an export parameter. You could then read it as
a normal variable within the method.
 
Kind regards,
Tomasz Zmudzin.
 
-----Original Message-----
From: Ronen at mccann-kb.co.il [mailto:Ronen at mccann-kb.co.il]
Sent: Thursday, February 07, 2002 3:33 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Defining a new method for business object
 
 
Dear workflow people,
 
I am in the stages of building my first 'serious' method for a business
object.
 
A function module has been written, and this function module is called from
the method.
 
The function module is a simple dialog screen in which the user inputs data
in one field
 
The source code in the method looks like this:
 
BEGIN_METHOD BBC_SCORE_STRATEGY CHANGING CONTAINER.
data:
BBC_SCORE TYPE NUM03,
 
CALL FUNCTION 'Z_WF_BBC_STRATEGY'
 IMPORTING
   BBC_SCORE                  = BBC_SCORE
 
SWC_SET_element CONTAINER 'bbc_score' bbc_score.
 
END_METHOD.
 
A task is defined based on this method.
 
My problem: in the workflow, the task is always completed, without
difference if the user chooses 'save' or 'exit' or 'cancel' in the dialog
screen (the function module)
 
Am I missing something in the source code of the method ?
 
The desired situation is that if the user chooses 'exit' or 'cancel' without
saving, the task will not be completed.
 
Thanks in advance for your help.
 
Best regards
 
Ronen
 


More information about the SAP-WUG mailing list