Using SAP_WAPI_RAISE_EVENT in WAS 6.2QUEST
Venkat S Raman
Venkat_S_Raman-NR at raytheon.com
Tue Aug 26 15:25:06 EDT 2003
Hi Jocelyn:
Thanks for your response.
BC610 has one example on SAP_WAPI_GET_OBJECTS but none on
SAP_WAPI_CREATE_EVENT.
The question I have is for the SAP example, I can use the following code
and it works:
DATA TRAVELREQUEST TYPE swc_object.
DATA: REQKEY like SWXTRAREQUEST-FORMNUMBER.
REQKEY = '0000000036'.
SWC_CREATE_OBJECT TRAVELREQUEST 'Travelreq' reqkey.
SWC_SET_ELEMENT EV_CONTAINER '_EV_OBJECT' TRAVELREQUEST.
*
*APPEND EVENT_CONTAINER.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
OBJTYPE = 'TRAVELREQ'
OBJKEY = '0000000036'
EVENT = 'CREATED'
CREATOR = ls_Creator
TABLES
EVENT_CONTAINER = EV_CONTAINER
.
But with SAP_WAPI_CREATE_EVENT how do we populate the Travelrequest Object
Instance.
There are no examples in OSS or in help.sap.com.
I understand the population of simple name and value, but how do we enter
object instances !!!!!
Thanks for your help.
Venkat
"Dart, Jocelyn"
<jocelyn.dart at sap.c To: SAP-WUG at MITVMA.MIT.EDU
om> cc:
Sent by: SAP Subject: Re: Using SAP_WAPI_RAISE_EVENT in WAS 6.2QUEST
Workflow
<Owner-SAP-WUG at MITV
MA.MIT.EDU>
08/25/2003 06:30 PM
Please respond to
"SAP Workflow
Users' Group"
Hi Venkat,
Containers for WAPIs are simple containers. Just name and value.
For lists you just enter the name and value multiple times.
For SWE_EVENT_CREATE you need to create the container using the
workflow macros such as swc_set_element.
See a BC610/BIT610 manual for examples.
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: Venkat S Raman [mailto:Venkat_S_Raman-NR at raytheon.com]
Sent: Tuesday,26 August 2003 12:39 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Using SAP_WAPI_RAISE_EVENT in WAS 6.2QUEST
Hi All:
We are running CRM 4.0 on WAS 6.2 and trying out Webflow.
SAP has delivered sample programs and Workflow objects to demonstrate
this(Package SWX).
The BSP request.html lets the user enters the flight reservation and once
the request is created
through the FM SWX_TRAVELREQ_CREATE, it calls the FM SWE_EVENT_CREATE to
raise the event
through the following code:
l_objtype = 'TRAVELREQ'.
l_objkey = ls_formdata-formnumber.
IF i_wf_xml = 'X'.
l_event = 'CREATED_FOR_WFXML'.
ELSE.
l_event = 'CREATED'.
ENDIF.
ls_creator-otype = 'US'.
ls_creator-objid = i_uname.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = l_objtype
objkey = l_objkey
event = l_event
creator = ls_creator
EXCEPTIONS
OTHERS = 0.
e_formdata = ls_formdata.
COMMIT WORK.
Scenario:
1. Use of the SAP RFC SAP_WAPI_RAISE_EVENT to trigger the event from R/3
into CRM 4.0.
In the above code there is no population of the Container data. When
we try to trigger this through
the WAPI function we get the following error :
Source (expression '&travelrequest.Issuer&') of binding assignment is not
available
Error in the evaluation of expression '&travelrequest<???>.Issuer&' for
item '14' .
But in the request.html (above code) the workflow gets triggered correctly
with just the objtype, objkey, event and creator, but
when we populate the same fields via the RFC WAPI we get the error!!!!
Question:
Here is the binging for the workflow
Binding Event -> Workflow
&_EVT_CREATOR& -----> &_WF_INITIATOR&
&_EVT_OBJECT& ------> &TRAVELREQUEST&
I am looking for examples of how to populate the event container through
ABAP code while using SWE_EVENT_CREATE and SAP_WAPI function modules.
Any help is appreciated
Venkat Raman
More information about the SAP-WUG
mailing list