Debugging in workflow

Talbot, Brent Brent.Talbot at airnz.co.nz
Wed Jul 17 16:04:44 EDT 2002


Hi Kevin,
Debugging workflows can be a bit of a challenge. I am not sure I know all
the best ways but here some methods I have used:
Transaction SWUD is a good start. From here you can:
        Start a task and set breakpoints in the code
        Create an event. This is useful because you can set breakpoints in
the check functions.
        Switch on container monitoring which shows which values are being
passed between the containers.
 
If you really need to get into the way the event container is being set up
then can also look at debugging the code which creates the event. This is
often an update task so you will need to turn on update debugging. Look for
the function which creates the event ( It will start with SWE_EVENT_CREATE*
).
 
I got very frustrated with trying to debug a workflow triggered from a
change document at one point so I created this little program which triggers
the workflow for an existing change document in foreground. It meant I could
set break points in the code to see what was happening.
 
REPORT  ZBPTTST_CHGDOC                .
 
TABLES: CDHDR, CDPOS.
 
DATA: T_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
 
PARAMETERS: CHGNR LIKE CDHDR-CHANGENR OBLIGATORY,
            OBJCL LIKE CDHDR-OBJECTCLAS OBLIGATORY.
SELECT-OPTIONS OBJID FOR CDHDR-OBJECTID NO INTERVALS NO-EXTENSION.
 
 
SELECT SINGLE * FROM  CDHDR
       WHERE  OBJECTCLAS  = OBJCL
       AND    OBJECTID    IN OBJID
       AND    CHANGENR    = CHGNR  .
 
SELECT        * FROM  CDPOS      INTO TABLE T_CDPOS
       WHERE  OBJECTCLAS  = CDHDR-OBJECTCLAS
       AND    OBJECTID    = CDHDR-OBJECTID
       AND    CHANGENR    = CDHDR-CHANGENR           .
 
 
CALL FUNCTION 'SWE_EVENT_CREATE_CHANGEDOCUMNT'
     EXPORTING
          CHANGEDOCUMENT_HEADER   = CDHDR
     TABLES
          CHANGEDOCUMENT_POSITION = T_CDPOS
     EXCEPTIONS
          OTHERS                  = 1.
 
COMMIT WORK.
 
Hope this helps
 
Regards
Brent
Ph x67470 (64 9 256 4470)
Email Brent.Talbot @airnz.co.nz  or  Brent_nz at compuserve.com
Mob 64 21 684 208
 
 
 
-----Original Message-----
From: Kevin Wilson [mailto:kjw1969 at yahoo.com]
Sent: Thursday, 18 July 2002 07:36
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Debugging in workflow
 
 
 Can anyone share some tips on debugging workflows \ workitems and contents
of their containers? Also, what the best way to debug events and their check
function modules?
 
 
 
---------------------------------
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
 


More information about the SAP-WUG mailing list