Binding from Task to Custom Method

Dart, Jocelyn jocelyn.dart at sap.com
Mon Mar 31 03:54:26 EST 2003


Hi Mark,
Are you sure you have declared the parameters correctly against the method? i.e. in
SWO1, put cursor on the method, and press the Parameters button.
Regards,
        Jocelyn Dart
Consultant (SRM, EBP, Workflow)
and co-author of the book
"Practical Workflow for SAP"
SAP Australia
email: jocelyn.dart at sap.com
phone: +61 412 390 267
fax:   +61 2 9935 4880
 
 
 
 
-----Original Message-----
From: Kjetil Kilhavn [mailto:kjetilk at statoil.com]
Sent: Monday, 31 March 2003 5:31 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Binding from Task to Custom Method
 
 
One solution (unless you need to be able to call your method for
non-existing objects, which doesn't really make sense for an approval
method):
Don't define parameters to your method. Make sure you have *not* defined it
as instance-independent.
Use the object key when calling the standard transaction.
 
If your method now works stand-alone and you have the correct object type
instantiated in the task things should work fine. Note the use of _should_
as opposed to _will_.
--
Kjetil Kilhavn
 
 
 
 
 
                    Mark Johnston
                    <mark_johnston at ie.ib        To:     SAP-WUG at MITVMA.MIT.EDU
                    m.com>                      cc:     (bcc: Kjetil Kilhavn)
                    Sent by: SAP                Subject:     Binding from Task to Custom Method
                    Workflow
                    <Owner-SAP-WUG at MITVM
                    A.MIT.EDU>
 
 
                    28.03.2003 19:24
                    Please respond to
                    "SAP Workflow Users'
                    Group"
 
 
 
 
 
 
Hi,
 
This is my first (maybe of many) posts to this list I hope someone has the
time to advise.
 
I'm having major difficulty with a workflow and was hoping that someone
could offer me some advice.
 
My workflow is largely based on template WS2000040 - Approve Trip.
 
The standard is a two step approval process with 2 decision tasks sent out
1) Check Trip Facts
2) Approve Trip.
 
I've copied and changed the flow to have a slightly different approval
process
again 2 decision tasks are sent out.
1) Approve Trip
2) Settle Trip (Custom code)
 
The workflow is based on business object BUS2089.
I've created a subtype of BUS2089 and named it ZBUS2089, and created a
method ZEmployeeTrip.ZTripSettle which calls a function module (FM) to
carry
out the settle process (submit's a SAP standard program RPTTEC00 (TCODE
PREC)).
 
The FM has the following parameters
EMPLOYEENUMBER LIKE BAPIEMPL-PERNR Optional Passes Value Personnel Number
TRIPNUMBER LIKE BAPITRVXXX-TRIP Optional Passes Value Trip number
 
The code works correctly stand alone. I've tried to implement it in a
similar manner to BUS2089-APPROVE.
 
 
My problem is that when called from the workflow the parameters for my
method are always blank and the container of the method is also blank.
 
This is a view of the flow (bottom up).
 
14:23:11 B STARTED TS90100002 Settle Trip
14:22:59 W COMPLETED TS00008267 Settle Trip of Test Test rr 04.01.2003
1000004552
14:22:58 B COMPLETED TS20000130 Set trip 1000004552 status to approved
14:22:46 W COMPLETED TS20000131 Approve trip of Test
Test/rr/04.01.2003/1000004552
14:22:45 F STARTED WS90100002 Custom Employee Expenses
 
The informations I need is stored in element TRIP. The fields that are key
and the ones that I need passed through into my method are
 
employeenumber like pskey-pernr,
tripnumber like bapitrip-tripno,
 
These fields are sucessfully passed from the workflow container into my
role
to determine the agent of task TS20000131 and subsequently task TS00008267.
 
I'm pretty sure my problems relate to the binding between the task
container
and the method container. TS00008267 <-> ZBUS2089-ZTRIPSETTLE. And possibly
my binding throughout the workflow template.
 
I'm getting several binding errors that raise the following questions:
 
1)
When I attempt to activate the workflow template I'm told some values are
not used or some values are for read purposes only. I can see these values
in my workflow container and when attempting to delete them from the
workflow container I get the message:
 
'Inherited elements may not be deleted'.
 
2) As I mentioned I'm trying to implement this like BUS2089-APPROVE is
implemented by SAP. When I click on my object binding within task
TS90100002
I always see the key parameters to my function module called by my method
ZBUS2089-ZTRIPSETTLE and I am unable to change
this.
 
However when I look at BUS2089-APPROVE it does not work like that and in
the
method code it takes it's values from object-key-employeenumber and
object-key-tripnumber.
 
I've tried using this method in my code and also using
swc_get_element ac_container 'EmployeeTrip' z_tripno.
swc_get_element ac_container 'EmployeeNumber' z_person
 
but in both cases I have no values populated.
 
I know there is a lot in this but it may help you help me.
 
As you've probably guessed I'm new to workflow what a start, custom
workflow,custom role resolution, I assure you options were assessed, and
now
this!
 
Thank's for taking the time to reply.
I effectively have reached a standstill and don't know how to else to
tackle
this.
 
Kind regards,
Mark Johnston
 
IBM Business Consulting Services
Oldbrook House, 24/32 Pembroke Road, Dublin 4.
Phone:   +353-(0)1-815 4907
Mobile:  +353-(0)86-814 4258
fax:          +353-(0)1-667 1848
e-mail:  mark_johnston at ie.ibm.com
 
 
 
 
 
-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.
 


More information about the SAP-WUG mailing list