SAP_WAPI_CREATE_EVENT and Workflow binding

Dart, Jocelyn jocelyn.dart at sap.com
Thu Jan 8 17:01:13 EST 2009


Hi Kathy - Always assume case sensitivity unless proven otherwise.  You should make sure the container element names match the case of the relevant event parameters as specified in the Object Type definition.  I have had this make a difference when reading container element values. 
Regards,
Jocelyn

________________________________

From: sap-wug-bounces at mit.edu on behalf of Penhall, Kathy
Sent: Fri 9/01/2009 7:33 AM
To: sap-wug at mit.edu
Subject: RE: Re: Re: SAP_WAPI_CREATE_EVENT and Workflow binding



Hello Thomas,

This is precisely how I coded the container the first time.  When I
debug the function module I can see my elements and values in the table
passed to the function module, but in the workflow container, these same
elements show as <Not Set>.  I have checked and re-checked the binding
and cannot see why the values are not populated in the container.
Here's the code:

DATA: l_container type STANDARD TABLE OF SWR_CONT  WITH HEADER LINE,
      l_message type standard table of SWR_MESSAG with header line,
      l_mstruc type standard table of SWR_MSTRUC with header line.


**  build objkey of source-attendance
      wf_objkey-plvar        = source_attendance-plvar.
      wf_objkey-attendeeid   = source_attendance-parid.
      wf_objkey-attendeetype = source_attendance-party.
      wf_objkey-eventid      = source_attendance-eveid.
      e_objkey = wf_objkey.

      event_creator-otype = $user.
      event_creator-objid = sy-uname.

      l_container-element = 'OLDATTENDANCEKEY'.
      l_container-value = wf_objkey.
      append l_container.

     CLEAR wf_objkey.

*   build objkey of target-attendance
      wf_objkey-plvar        = target_attendance-plvar.
      wf_objkey-attendeeid   = target_attendance-parid.
      wf_objkey-attendeetype = target_attendance-party .
      wf_objkey-eventid      = target_attendance-eveid.

      l_container-element = 'NEWATTENDANCEKEY'.
      l_container-value = wf_objkey.
      append l_container.

* Key container values have been entered.  Generate the event.

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
  EXPORTING
    object_type             = 'PDRELA_025'
    object_key              = e_objkey
    event                   = 'MOVED'
    COMMIT_WORK             = 'X'
*   EVENT_LANGUAGE          = SY-LANGU
*   LANGUAGE                = SY-LANGU
*   USER                    = SY-UNAME
*   IFS_XML_CONTAINER       =
 IMPORTING
   RETURN_CODE              =  ma_subrc
*   EVENT_ID                 =  l_event
 TABLES
   INPUT_CONTAINER          = l_container
   MESSAGE_LINES            = l_message
   MESSAGE_STRUCT           = l_mstruc.

--------

And here's the values in l_container at the function call break-point:

OLDATTENDANCEKEY        0100032297                                     P
0000000020001030
NEWATTENDANCEKEY        0100032297                                     P
0000000020001031

Do the workflow container elements need to be defined in all CAPS like
the function module requires?  I think they are OldAttendanceKey and
NewAttendanceKey.


-----Original Message-----
Date: Thu, 8 Jan 2009 13:37:32 -0500
From: "Maue, Thomas" <Thomas.Maue at saralee.com>
Subject: RE: Re: SAP_WAPI_CREATE_EVENT and Workflow binding
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID:
       
<E6C5794A9783B841945AA2CFC9C5C8B87A887F at NATSCIEXEVS20.na.saralee.com>
Content-Type: text/plain;       charset="US-ASCII"

Kathy,

Yes, these are two completely different structures.  SWE_EVENT_CREATE
uses structure SWCONT while the WAPI uses SWR_CONT. 

Just focus on SWR_CONT and populate ELEMENT and VALUE.
Example:
* Populate container
  clear cont_tab.
  cont_tab-ELEMENT = 'ELEMENTNAME'.
  cont_tab-VALUE = 'xxxx'.
  append cont_tab.

cont_tab is passed to table parameter INPUT_CONTAINER within the WAPI.

Regards,
Thomas Maue


-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Penhall, Kathy
Sent: Thursday, January 08, 2009 9:22 AM
To: sap-wug at mit.edu
Subject: RE: Re: SAP_WAPI_CREATE_EVENT and Workflow binding

Jocelyn, Shai:

Thanks for your quick responses.  Please bear with me if I'm still a bit
confused.  The function module parameters don't include the SWCONT
structure, rather SWR_CONT which is looks very simplified (ELEMENT and
VALUE).  I had populated the ELEMENT with my simple container name, and
the value with the key value I wanted to pass.

FUNCTION sap_wapi_create_event.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(OBJECT_TYPE) LIKE  SWR_STRUCT-OBJECT_TYP
*"     VALUE(OBJECT_KEY) LIKE  SWR_STRUCT-OBJECT_KEY
*"     VALUE(EVENT) LIKE  SWR_STRUCT-EVENT
*"     VALUE(COMMIT_WORK) LIKE  SWR_STRUCT-COMMITFLAG DEFAULT 'X'
*"     VALUE(EVENT_LANGUAGE) LIKE  SY-LANGU DEFAULT SY-LANGU
*"     VALUE(LANGUAGE) TYPE  SYLANGU DEFAULT SY-LANGU
*"     VALUE(USER) TYPE  SYUNAME DEFAULT SY-UNAME
*"     VALUE(IFS_XML_CONTAINER) TYPE  XSTRING OPTIONAL
*"  EXPORTING
*"     VALUE(RETURN_CODE) LIKE  SY-SUBRC
*"     VALUE(EVENT_ID) LIKE  SWR_STRUCT-EVENT_ID
*"  TABLES
*"      INPUT_CONTAINER STRUCTURE  SWR_CONT OPTIONAL
*"      MESSAGE_LINES STRUCTURE  SWR_MESSAG OPTIONAL
*"      MESSAGE_STRUCT STRUCTURE  SWR_MSTRUC OPTIONAL
*"----------------------------------------------------------------------

Should I be using the two fields in SWR_CONT and populate with all of
the field names in Shai's email below?

Thanks again for your help.

Kathy

------------------------------

Date: Thu, 8 Jan 2009 13:14:55 +0800
From: "Dart, Jocelyn" <jocelyn.dart at sap.com>
Subject: RE: [LIKELY JUNK]Re: SAP_WAPI_CREATE_EVENT and Workflow
        binding
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>, <sap-wug at mit.edu>
Message-ID:
        <2EAD340DEF223745B1AC9A10B49FBB4701C1C32C at sgsine13.sin.sap.corp>
Content-Type: text/plain;       charset="iso-8859-1"

Dear Kathy,
To clarify - I wanted you to use SAP_WAPI_READ_CONTAINER on an existing
workflow instance to *** UNDERSTAND *** what you had to put in the event
container for SAP_WAPI_CREATE_EVENT.  You still actually have to fill
the parameters for SAP_WAPI_CREATE_EVENT.

Regards,
Jocelyn

________________________________

From: sap-wug-bounces at mit.edu on behalf of Shai Eyal
Sent: Thu 8/01/2009 6:13 AM
To: sap-wug at mit.edu
Subject: [LIKELY JUNK]Re: SAP_WAPI_CREATE_EVENT and Workflow binding


Dear Kathy,

Please make sure to fill all SWCONT structure fields as follows:

*       ELEMENT - your element name, use uppercase!
*       TAB_INDEX - 00001, 00002, ... if you're transfer a table element
then you should have same index several times.
*       ELEMLENGTH - according to the data dictionary.
*       TYPE - according to the data dictionary.
*       VALUE - your element value.

I assume you did but make sure to append the data to the internal table
you use.

If it's still does not work please copy the source code to txt file and
attach it.



I can assure you that is suppose to work - I've done that several times
and it went well.

Good luck.




Regards,
Shai Eyal

SAP Logistics senior consultant
SAP Workflow specialist

http://www.linkedin.com/in/shaieyal
Mobile: 972-52-5816633

------------------------------

Message: 2
Date: Wed, 7 Jan 2009 10:47:51 -0600
From: "Penhall, Kathy" <kpenhall at hydro.mb.ca>
Subject: SAP_WAPI_CREATE_EVENT and Workflow binding
To: <sap-wug at mit.edu>
Message-ID:
    <CAD3E86E65D76C47BD61434EDFD7D10F01A12889 at MHMAIL02.hydro.mb.ca>
Content-Type: text/plain; charset="us-ascii"

Hello Workflow folks,

We are having a similar problem as Srinivas Oota recently posted here.
We are attempting to code an event to kick off a workflow and the
container doesn't seem to be passed to the workflow from the function
call.  Originally we just attempted to copy the SAP logic in
LHRTEM00NETF53 to generate the event PDRELA_025.MOVED where approriate,
by copying the code used when PDRELA_025.MOVEREQUESTED is generated,
which uses function SWE_EVENT_CREATE.  However when we did this, our
moved event was not being generated, despite the fact that this same
code still works for the moverequested event.

So as Jocelyn suggested, we changed our code to use function
SAP_WAPI_CREATE_EVENT and have populated the container with the data
required by the workflow.  The event is now generated, but the values in
the container don't appear to have been passed to the workflow even
though the return code from the function is 0 and the only message
generated by the function call is "Event created - at least one receiver
found".    I confirmed the fields were not populated by running
SAP_WAPI_READ_CONTAINER as suggested and found the two container
elements I defined and populated for the event function call are in the
container, but not populated as I would have expected them to be.

Any suggestions on what we might be missing?


Kathy Penhall
HR Applications
SAP Support Services
693 Taylor Avenue
(tel)204-477-7197


-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.mit.edu/pipermail/sap-wug/attachments/20090107/40f0c1c1/a
ttachment-0001.htm

------------------------------

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


End of SAP-WUG Digest, Vol 50, Issue 4
**************************************


________________________________

Get your new Email address!
<http://sg.rd.yahoo.com/aa/mail/domainchoice/mail/signature/*http://mail
.promotions.yahoo.com/newdomains/aa/>
Grab the Email name you've always wanted before someone else does!



------------------------------

Message: 4
Date: Thu, 8 Jan 2009 13:17:20 +0800
From: "Dart, Jocelyn" <jocelyn.dart at sap.com>
Subject: RE: [LIKELY JUNK]RE: Logically Delete Workitem
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>,      "SAP Workflow
        Users' Group" <sap-wug at mit.edu>
Message-ID:
        <2EAD340DEF223745B1AC9A10B49FBB4701C1C32D at sgsine13.sin.sap.corp>
Content-Type: text/plain;       charset="iso-8859-1"

Adam,
Please *** DO NOT USE *** internal function modules such as
SWW_WI_ADMIN_CANCEL.

The equivalent Workflow API which is designed for customer use is
SAP_WAPI_ADM_WORKFLOW_CANCEL.

If you don't have the options showing to logically delete the work item
it is probably because you do not have sufficient access to perform this
activity.  Put the hard word on your security team to get it.   Check
the authorizations assigned to security role SAP_BC_BMT_WFM_ADMIN to see
what you are missing.

Regards,
Jocelyn

________________________________

From: sap-wug-bounces at mit.edu on behalf of Cathy
Sent: Thu 8/01/2009 5:48 AM
To: SAP Workflow Users' Group
Subject: [LIKELY JUNK]RE: Logically Delete Workitem


Not really sure what the logically delete is, I use report RSWWWIDE to
delete workitems.

--- On Wed, 1/7/09, Adam Kheil <adam_kheil at live.com> wrote:


        From: Adam Kheil <adam_kheil at live.com>
        Subject: RE: Logically Delete Workitem
        To: brynn.rutherford at thecreek.com, "Workflow group"
<sap-wug at mit.edu>
        Date: Wednesday, January 7, 2009, 12:18 PM
       
       
        I have tried this it does not give me options under services
available to Administrator. I have tried some other Work item ids not in
this workflow and I do get option of deleting logically in the services
available to administrator. I do not have authorization for SWO1 and
SE37 in the production. I am thinking of writing a small program to use
function SWW_WI_ADMIN_CANCEL in it!  Any other sugestions will be
appreciated.
        
        Thanks every one for quick replies
        
        Adam
       
       
       
________________________________


        Subject: Logically Delete Workitem
        Date: Wed, 7 Jan 2009 08:59:50 -0800
        From: Brynn.Rutherford at thecreek.com
        To: adam_kheil at live.com
       
       
       
         <mailto:adam_kheil at live.com>
        
        In SWIA:
        
        1. Double click the workitem
       
        
        2. In the first screen go to Menu - GOTO - TECHNICAL WORKITEM
DISPLAY
        3. In the technical workitem display screen go to EDIT - CHANGE
        4. You should now see your options to the left to include
logically delete.
       
        Brynn Rutherford
        Level 3 Support
        SAP Fusion
        Work: (208)265-7395 Cell:(208)610-6705
        

        The contents of this message, together with any attachments, are
intended only for the use of the individual or entity to which they are
addressed and may contain information that is legally privileged,
confidential or otherwise exempt from disclosure. If you are not the
intended recipient, you are prohibited from disseminating, distributing,
or copying this message or any attachment. If you have received this
message by mistake, please let the sender know by email reply and
immediately delete this message, along with any attachments, from your
system. Thank you.

        

        

________________________________

        Windows LiveTM: Keep your life in sync. Check it out.
<http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_01200
9> 
        _______________________________________________
        SAP-WUG mailing list
        SAP-WUG at mit.edu
        http://mailman.mit.edu/mailman/listinfo/sap-wug





------------------------------

Message: 5
Date: Thu, 8 Jan 2009 13:22:06 +0800
From: "Dart, Jocelyn" <jocelyn.dart at sap.com>
Subject: RE: [LIKELY JUNK]Re: Logically delete
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>,      "SAP Workflow
        Users' Group" <sap-wug at mit.edu>
Message-ID:
        <2EAD340DEF223745B1AC9A10B49FBB4701C1C32E at sgsine13.sin.sap.corp>
Content-Type: text/plain;       charset="iso-8859-1"

Hi Adam,
Please use transaction SWWL_TOPLEVEL rather than SWWL - the toplevel
version is safer as it helps to prevent orphaned work items.

Also check your authorizations for authorization object S_WF_WI which
controls the activities you can perform against a work item.
Regards,
Jocelyn

________________________________

From: sap-wug-bounces at mit.edu on behalf of Himanshu Verma
Sent: Thu 8/01/2009 4:20 AM
To: SAP Workflow Users' Group
Subject: [LIKELY JUNK]Re: Logically delete


Hi adam,

You can logically delete the workflow by using transaction SWWL.... you
have to enter the work item id (not the workflow instance number).
Delete the workitem and then you can logically delete the workflow using
workflow instance number. But remember the sequence, First, Workitem and
then WOrkflow Instace.

Hope it will solve your query.

Regards,
Himanshu Verma.




2009/1/7 Bill Craig <billtcraig at gmail.com>


        Adam,
        It sounds like authorization, but if you can get to SWO1 and
instantiate the business object WORKITEM using the work item id of the
main workflow, the method status_change will give you the option to set
the status to CANCELLED which is the same as logically deleted.
       
        Thanks,
        Bill
        
        On Wed, Jan 7, 2009 at 11:19 AM, <sap-wug-request at mit.edu>
wrote:
       

                Send SAP-WUG mailing list submissions to
                       sap-wug at mit.edu
               
                To subscribe or unsubscribe via the World Wide Web,
visit
                       http://mailman.mit.edu/mailman/listinfo/sap-wug
                or, via email, send a message with subject or body
'help' to
                       sap-wug-request at mit.edu
               
                You can reach the person managing the list at
                       sap-wug-owner at mit.edu
               
                When replying, please edit your Subject line so it is
more specific
                than "Re: Contents of SAP-WUG digest..."
               
               
                Today's Topics:
               
                  1. Delete logically (Adam Kheil)
               
               
       
----------------------------------------------------------------------
               
                Message: 1
                Date: Wed, 7 Jan 2009 11:18:44 -0500
                From: Adam Kheil <adam_kheil at live.com>
                Subject: Delete logically
                To: Workflow group <sap-wug at mit.edu>
                Message-ID:
<COL112-W69842BA950E267C0CBB51E96DF0 at phx.gbl>
                Content-Type: text/plain; charset="iso-8859-1"
               
               
                Hi,
                I want to delete logically a workflow in error status.
When I go to the log, click on Work item Id, and go through menu ->
Edit-> Change. I don't see an option available under services for
administrator to delete logically. Attached is a print out and we are on
ECC 6.0
               
                Any idea on how to delete logically will be highly
appreciated.
               
               
               
                Thanks
                Adam
       
_________________________________________________________________
                Windows LiveTM: Keep your life in sync.
       
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009
                -------------- next part --------------
                An HTML attachment was scrubbed...
                URL:
http://mailman.mit.edu/pipermail/sap-wug/attachments/20090107/3d872240/a
ttachment.htm
                -------------- next part --------------
                A non-text attachment was scrubbed...
                Name: Screen print.doc
                Type: application/msword
                Size: 78336 bytes
                Desc: not available
                Url :
http://mailman.mit.edu/pipermail/sap-wug/attachments/20090107/3d872240/S
creenprint.doc
               
                ------------------------------
               
                _______________________________________________
                SAP-WUG mailing list
                SAP-WUG at mit.edu
                http://mailman.mit.edu/mailman/listinfo/sap-wug
               
               
                End of SAP-WUG Digest, Vol 50, Issue 3
                **************************************
               






        _______________________________________________
        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


End of SAP-WUG Digest, Vol 50, Issue 8
**************************************

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


-----------------------------------------
This transmission is intended only for use by the intended recipient(s).
If you are not an intended recipient you should not read, disclose,
copy, circulate or in any other way use the information contained in
this transmission. The information contained in this transmission may be
confidential and/or privileged. If you have received this transmission
in error, please notify the sender immediately and delete this
transmission including any attachments.



------------------------------

Message: 3
Date: Thu, 8 Jan 2009 19:41:12 +0000
From: "Andy Curtis" <abcurtis at gmail.com>
Subject: Re: Company Logo in Emails from Workflow
To: sap-wug at mit.edu
Message-ID:
        <14f090f00901081141x7057a828t75c4425caf336e77 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Shalini

The sendmail text is basically SAPScript.  I don't know, but it might be
worth a try adding the SAPScript code to add a logo to the sendmail
text.
You might need to goto the Change Editor to add the SAPScript commands.

As I say, I don't know if this will work, but it might work.

A


On 1/8/09, sap-wug-request at mit.edu <sap-wug-request at mit.edu> wrote:
>
> Send SAP-WUG mailing list submissions to
>        sap-wug at mit.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://mailman.mit.edu/mailman/listinfo/sap-wug
> or, via email, send a message with subject or body 'help' to
>        sap-wug-request at mit.edu
>
> You can reach the person managing the list at
>        sap-wug-owner at mit.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of SAP-WUG digest..."
>
>
> Today's Topics:
>
>   1. Company Logo in Emails from Workflow (Shalini Sabnani)
>
>
> ---------- Forwarded message ----------
> From: "Shalini Sabnani" <workflow.mail at gmail.com>
> To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
> Date: Thu, 8 Jan 2009 11:31:52 -0500
> Subject: Company Logo in Emails from Workflow Hello All Have any of
> you been able to put a company logo in the emails sent out from
> Workflow ? I am wondering if this is possible and how can it be done.
>
> Your response is appreciated...
> Thanks
> Shalini
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>


--
Andy Curtis
http://making-my-mark.blogspot.com/
(m) 07798 603099
(t) 01737 843948
(e) abcurtis at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.mit.edu/pipermail/sap-wug/attachments/20090108/bb3a2264/a
ttachment-0001.htm

------------------------------

Message: 4
Date: Thu, 8 Jan 2009 11:46:22 -0800 (PST)
From: Sharath K <ksharath77 at yahoo.com>
Subject: Re: [LIKELY JUNK]Workflow instance not in 'Services for
        Object' of      the SAPDocument(Parked Invoice)
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID: <112573.95519.qm at web39706.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Jocelyn, thanks for your time..I created the workflow container element
FIPP object as an import element...still I cant see the link in the
generic services..
Compared the logs of one of previous workflow instance with the
link..the diffence is ,?the task container has the 'OBJECTS' element
filled with the invoice key..but?in the?current workflow instance log
value?is missing..I assume this is the issue... but not sure how to get
the invoice key? into 'OBJECTS' element...





________________________________
From: "Dart, Jocelyn" <jocelyn.dart at sap.com>
To: SAP Workflow Users' Group <sap-wug at mit.edu>
Sent: Wednesday, January 7, 2009 9:12:32 PM
Subject: RE: [LIKELY JUNK]Workflow instance not in 'Services for Object'
of the SAPDocument(Parked Invoice)

Hi Sharath,
You need a container element at the top level of the workflow that holds
the instance of the FIPP object.?
The generic services link will become effective once this container
element is there.
Regards,
Jocelyn

________________________________

From: sap-wug-bounces at mit.edu on behalf of Sharath K
Sent: Thu 8/01/2009 7:46 AM
To: SAP Workflow Users' Group
Subject: [LIKELY JUNK]Workflow instance not in 'Services for Object' of
the SAPDocument(Parked Invoice)


Hi All,
I have two workflows for Invoice Document Image processing..
1) Document Creation and Image attachment
2) Document Parking

I can see the 2nd workflow instance in 'Services for Object' tab of the
parked invoice..but not the first workflow instance..

I used to have both the workflows earlier, but I made some changes in
the task binding of the first workflow..not sure what changes made this
disppear...

any help is appreciated...


     
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.mit.edu/pipermail/sap-wug/attachments/20090108/1d8c51dd/a
ttachment.htm

------------------------------

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


End of SAP-WUG Digest, Vol 50, Issue 12
***************************************

_______________________________________________
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