OSS Note 378487 Question

Gregory Kowalik gkowalik at ashland.com
Sat Mar 3 16:17:47 EST 2001


Scot,
 
I applied that note into our 46b system last week.
IM_TASK import parameter should have the reference type of SWD_AHEAD-TASK.
 
Greg
 
 
 
 
 
 
 
Scot Flak <mrscotflak at yahoo.com> on 03/02/2001 07:09:33 AM
 
Please respond to "SAP Workflow Users' Group" <SAP-WUG at MITVMA.MIT.EDU>
 
To:   SAP-WUG at MITVMA.MIT.EDU
cc:    (bcc: Gregory Kowalik)
Subject:  Re: OSS Note 378487 Question
 
 
 
I am on 46b and I am getting the following error
message
 
Error analysis
 
When calling the function module
"SWD_WFD_REPLICATE_FROM_9999", one of the
parameters
 
needed according to the interface description was not
specified.
 
This parameter was "IM_TASK".
 
I replaced the function module from the note and
changed the importing parameter name to IM_TASK.
 
I've encloded a copy of the changes I made to our
code.  (That Function module )
 
If you see anything please let me know..
 
Thanks, Scot
 
 
 
 
--- "Rickayzen, Alan" <alan.rickayzen at sap.com> wrote:
> Scot,
>
> I assume you've double checked the code corrections
> so this is how I'd
> tackle the problem of the events being disabled.
> *** In 4.6D the event handling has been changed so
> that you can capture the
> erroneous events without disabling the workflow ***
>
>
> Normally you can analyze the workflow log error
> messages. However, in the
> worst case scenario, the workflow fails before it
> starts (no log is
> created).
>
> If this is the case, you might want to try this
> procedure:
>
> Use the function SWE_EVENT_MAIL in the event linkage
> table. The online
> documentation describes how to use it.
>
http://help.sap.com/saphelp_46c/helpdata/en/a5/172437130e0d09e10000009b38f83
> 9/frameset.htm
>
<http://help.sap.com/saphelp_46c/helpdata/en/a5/172437130e0d09e10000009b38f8
> 39/frameset.htm>
>
> This will send you a mail showing what parameters
> are used in the event.
>
> You can now use this information to start the
> workflow directly or via an
> event (with the correct event container elements as
> shown in the mail) and
> seeing if the error is reproduceable. Starting the
> workflow directly might
> even yield a useful message directly on your screen.
>
> If there is a binding problem start the flow with
> the technical trace
> switched on.
> The trace might give you an idea of what is going
> wrong (check the binding
> statements) . If you have ABAP skills you might want
> to resort to switching
> the debugger on.
>
> I hope this helps,
> Alan
>
>
> -----Original Message-----
>> From: Scot Flak [  <mailto:mrscotflak at yahoo.com>
> mailto:mrscotflak at yahoo.com]
> Sent: Thursday, March 01, 2001 3:12 PM
> To: SAP-WUG at MITVMA.MIT.EDU
> Subject: OSS Note 378487 Question
>
>
> Hi all,  * HELP *
>
> I applied OSS note 378487 for the transported
> version
> problem.   But now some of my workflows are getting
> their event linkages deactivated.   I'm not sure if
> this is related or not.   We are on 46b.  I did mess
> up on the function module SWD_CHECK_ACTIVE_VERSION
> where we had to replace the function module.  I did
> pass the exporting parameter as VALUE.  I just
> changed
> that to REFERENCE hopefully that'll work.
>
> How can I tell what's deactiving the event linkage?
>
> Scot
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
>  <http://personal.mail.yahoo.com/>
> http://personal.mail.yahoo.com/
>
>
>
 
 
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
 
FUNCTION SWD_WFD_REPLICATE_FROM_9999.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(IM_TASK) TYPE  SWD_STEP_T
*"  EXPORTING
*"     VALUE(EX_WFDKEY) TYPE  SWD_WFDKEY
*"  EXCEPTIONS
*"      REPLICATION_ERROR
*"----------------------------------------------------------------------
* begin of local data definition
*{   DELETE         D01K909440                                        4
*\  DATA: L_AHEAD   LIKE SWD_AHEAD,
*\        L_UCOMM   TYPE OKCODE VALUE 'COPY',
*\        L_UPDATE_HEADER,
*\        L_TASK    LIKE RHOBJECTS-OBJECT,
*\        L_VERSION LIKE SWD_WFDKEY-VERSION,
*\        L_PD_TASK LIKE SWHACTOR,
*\        L_WFDKEY  LIKE SWD_WFDKEY.
*\* end of local data definition
*\
*\* only for workflow-templates and if the task/version is not initial
*\  L_PD_TASK = ACT_TASK.
*\  CHECK L_PD_TASK-OTYPE = ORG_OBJTYPE_WORKFLOW_TEMPLATE AND
*\        NOT ACT_TASK   IS INITIAL AND
*\        NOT ACT_WFDKEY IS INITIAL.
*\
*\* set current version
*\  CLEAR: L_UPDATE_HEADER.
*\  L_TASK          = ACT_TASK.
*\  L_WFDKEY        = ACT_WFDKEY.
*\  L_WFDKEY-EXETYP = WFD_EXETYP_DEFINITION.
*\* get workflow header to check if we have to replicate something
*\  CALL FUNCTION 'SWD_GET_WORKFLOW_HEADER'
*\       EXPORTING
*\            ACT_TASK           = L_TASK
*\            ACT_WFDKEY         = L_WFDKEY
*\       EXCEPTIONS
*\            INTERNAL_NOT_FOUND = 1
*\            OTHERS             = 2.
*\  IF SY-SUBRC <> 0.
*\*-- no workflow-definition found behind the desired workflow-version
*\*-- try to find one in the transport version
*\*-- --> perfect for the 'protect th                                  \
*\*e workflow'-initiative: the workflow
*\*--     version does not exist, so we can create the version
*\*-- get the transport version
*\    L_WFDKEY-VERSION = WFD_VERSION_TRANSPORT.
*\    CALL FUNCTION 'SWD_GET_WORKFLOW_DEFINITION'
*\         EXPORTING
*\              ACT_OBJECT_EXT     = L_TASK
*\              ACT_WFDKEY         = L_WFDKEY
*\         EXCEPTIONS
*\              INTERNAL_NOT_FOUND = 01.
*\    IF SY-SUBRC <> 0.
*\      RAISE REPLICATION_ERROR.
*\    ELSE.
*\*---- no error -> replicate it to the desired version
*\      MOVE-CORRESPONDING ACT_WFDKEY TO L_WFDKEY.
*\      CALL FUNCTION 'SWD_WFD_BUFFER_STORE'
*\           EXPORTING
*\                ACT_TASK                = L_TASK
*\                ACT_WFDKEY              = L_WFDKEY
*\                ACT_OKCODE              = L_UCOMM
*\                COMMIT_FLAG             = SPACE
*\                DIALOG_FLAG             = SPACE
*\                DELETE_ORG_OBJECTS      = CROSS
*\           EXCEPTIONS
*\                INTERNAL_DATABASE_ERROR = 1
*\                INTERNAL_NO_DEFINITION  = 2
*\                OTHERS                  = 3.
*\      IF SY-SUBRC = 0.
*\        L_UPDATE_HEADER = CROSS.
*\      ELSE.
*\        RAISE REPLICATION_ERROR.
*\      ENDIF.
*\    ENDIF.
*\  ELSE.
*\*-- desired workflow-definition exists - now check if the transport
*\*-- version contains a newer version
*\*-- --> the rough way for the 'protect the workflow'-initiative:
*\*--     the workflow version does exist, so we have to create a new
*\*--     one and to store the original version in the header
*\    L_WFDKEY-VERSION = WFD_VERSION_TRANSPORT.
*\    CALL FUNCTION 'SWD_COMPARE_CHANGE_DATES'
*\         EXPORTING
*\              ACT_TASK                      = ACT_TASK
*\              ACT_WFDKEY                    = ACT_WFDKEY
*\              ACT_WFDKEY_COMPARE            = L_WFDKEY
*\         EXCEPTIONS
*\              WFD_OLDER_THAN_COMPARE_WFD    = 1
*\              WFDS_NOT_WITHIN_THE_SAME_TASK = 2
*\              invalid_object_type           = 3
*\              internal_not_found            = 4
*\              different_wfd_versions        = 5
*\              OTHERS                        = 6.
*\*-- replication if the transport version is younger than the current
*\*-- version -> do replication
*\    IF SY-SUBRC = 1.
*\*---- read the transport workflow-definition
*\      CALL FUNCTION 'SWD_GET_WORKFLOW_DEFINITION'
*\           EXPORTING
*\                ACT_OBJECT_EXT     = L_TASK
*\                ACT_WFDKEY         = L_WFDKEY
*\           EXCEPTIONS
*\                INTERNAL_NOT_FOUND = 01.
*\      IF SY-SUBRC <> 0.
*\        RAISE REPLICATION_ERROR.
*\      ELSE.
*\*------ no error while reading -> replicate it to the latest version
*\*------ check if we have instances of the current version
*\        CALL FUNCTION 'SWD_CHECK_INSTANCE_OF_VERSION'
*\             EXPORTING
*\                  IN_WFDKEY                    = ACT_WFDKEY
*\             EXCEPTIONS
*\                  VERSION_ALREADY_INSTANTIATED = 1
*\                  OTHERS                       = 2.
*\*------ we already have an instance -> create new version
*\        IF SY-SUBRC <> 0.
*\*-------- get latest version
*\          CALL FUNCTION 'SWD_NEW_VERSION_ID_GET'
*\               EXPORTING
*\                    IN_TASK         = L_TASK
*\                    IN_WFD_ID       = L_WFDKEY-WFD_ID
*\               IMPORTING
*\                    OUT_NEW_VERSION = L_VERSION.
*\          MOVE-CORRESPONDING ACT_WFDKEY TO L_WFDKEY.
*\*-------- store it in the new version -> protect the workflow
*\          L_WFDKEY-VERSION = L_VERSION.
*\*------ we have no instances -> so we can import it
*\        ELSE.
*\          MOVE-CORRESPONDING ACT_WFDKEY TO L_WFDKEY.
*\        ENDIF.
*\        CALL FUNCTION 'SWD_WFD_BUFFER_STORE'
*\             EXPORTING
*\                  ACT_TASK                = L_TASK
*\                  ACT_WFDKEY              = L_WFDKEY
*\                  ACT_OKCODE              = L_UCOMM
*\                  COMMIT_FLAG             = SPACE
*\                  DIALOG_FLAG             = SPACE
*\                  DELETE_ORG_OBJECTS      = CROSS
*\             EXCEPTIONS
*\                  INTERNAL_DATABASE_ERROR = 1
*\                  INTERNAL_NO_DEFINITION  = 2
*\                  OTHERS                  = 3.
*\*------ error while replication
*\        IF SY-SUBRC = 0.
*\          L_UPDATE_HEADER = CROSS.
*\        ELSE.
*\          RAISE REPLICATION_ERROR.
*\        ENDIF.
*\      ENDIF.
*\    ENDIF.
*\  ENDIF.
*\
*\* get header information and update it
*\  IF NOT L_UPDATE_HEADER IS INITIAL.
*\    CALL FUNCTION 'SWD_INTERN_GET_HEADER'
*\         IMPORTING
*\              HEAD                = L_AHEAD
*\         EXCEPTIONS
*\              BUFFER_NOT_OCCUPIED = 01.
*\*-- set the original version in the header if the field is initial.
*\    IF L_AHEAD-ORIG_VERS IS INITIAL.
*\      L_AHEAD-ORIG_VERS = L_VERSION.
*\    ENDIF.
*\    MOVE-CORRESPONDING L_WFDKEY TO L_AHEAD.
*\    CALL FUNCTION 'SWD_UPDATE_HEADER'
*\         EXPORTING
*\              HEAD = L_AHEAD.
*\  ENDIF.
*}   DELETE
 
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(IM_TASK) TYPE  SWD_STEP_T
*"  EXPORTING
*"     VALUE(EX_WFDKEY) TYPE  SWD_WFDKEY
*"  EXCEPTIONS
*"      REPLICATION_ERROR
 
*"----------------------------------------------------------------------
* begin of local data definition
       DATA: l_header           TYPE swd_ahead,
             l_task             TYPE swhactor,
             l_ucomm            TYPE okcode VALUE 'COPY',
             l_original_header  TYPE swd_header,
             l_original_task    TYPE swd_step_t,
             l_original_wfdkey  TYPE swd_wfdkey,
             l_transport_header TYPE swd_header,
             l_transport_task   TYPE swd_step_t,
             l_transport_wfdkey TYPE swd_wfdkey.
* end of local data definition
 
* only for workflow templates
       CHECK im_task(2) = org_objtype_workflow_template.
 
* get header og the original version
       l_task          = im_task.
       l_original_task = im_task.
       CALL FUNCTION 'SWD_GET_LATEST_WF_VERSION'
            EXPORTING
                 act_task   = l_original_task
            IMPORTING
                 act_wfdkey = l_original_wfdkey
            EXCEPTIONS
                 OTHERS     = 1.
       CALL FUNCTION 'SWD_GET_WF_HEADER_TABLE'
            EXPORTING
                 act_task    = l_original_task
                 act_wfdkey  = l_original_wfdkey
            IMPORTING
                 header_data = l_original_header
            EXCEPTIONS
                 OTHERS      = 1.
       ex_wfdkey = l_original_wfdkey.
 
* get header of the transport version
       l_transport_task           = l_original_task.
       l_transport_wfdkey         = l_original_wfdkey.
       l_transport_wfdkey-version = wfd_version_transport.
       CALL FUNCTION 'SWD_GET_WF_HEADER_TABLE'
            EXPORTING
                 act_task    = l_transport_task
                 act_wfdkey  = l_transport_wfdkey
            IMPORTING
                 header_data = l_transport_header
            EXCEPTIONS
                 OTHERS      = 1.
 
* compare change dates of the transport and latest version
       IF l_original_header-changed_at <> l_transport_header-changed_at
          OR
          l_original_header-changed_on <> l_transport_header-changed_on.
*-- if they are not equal, we have import the transport version
         CALL FUNCTION 'SWD_GET_WORKFLOW_DEFINITION'
              EXPORTING
                   act_object_ext     = l_transport_task
                   act_wfdkey         = l_transport_wfdkey
              EXCEPTIONS
                   internal_not_found = 01.
         IF sy-subrc <> 0.
           RAISE replication_error.
         ELSE.
*---- get the next free version
           CALL FUNCTION 'SWD_NEW_VERSION_ID_GET'
                EXPORTING
                     in_task         = l_original_task
                     in_wfd_id       = ex_wfdkey-wfd_id
                IMPORTING
                     out_new_version = ex_wfdkey-version.
*---- get header information and update it
           CALL FUNCTION 'SWD_INTERN_GET_HEADER'
                IMPORTING
                     head                = l_header
                EXCEPTIONS
                     buffer_not_occupied = 01.
           MOVE-CORRESPONDING ex_wfdkey TO l_header.
           CALL FUNCTION 'SWD_UPDATE_HEADER'
                EXPORTING
                     head = l_header.
*---- replicate it to the next free version
           CALL FUNCTION 'SWD_WFD_BUFFER_STORE'
                EXPORTING
                     act_task                = l_original_task
                     act_wfdkey              = ex_wfdkey
                     act_okcode              = l_ucomm
                     commit_flag             = space
                     dialog_flag             = space
                     delete_org_objects      = cross
                EXCEPTIONS
                     internal_database_error = 1
                     internal_no_definition  = 2
                     OTHERS                  = 3.
           IF sy-subrc <> 0.
             RAISE replication_error.
           ENDIF.
         ENDIF.
       ENDIF.
ENDFUNCTION.
 


More information about the SAP-WUG mailing list