Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Module

Former Member
0 Likes
380

Hi Experts,

What is the difference between the

swe_event_create

sap_wapi_create_event

Thanks,

Points will be rewarded.

1 REPLY 1
Read only

Former Member
0 Likes
322

Hi Viji,

First I would recommend that you use SAP_WAPI_CREATE_EVENT instead of the old function module SWE_EVENT_CREATE.

If you do that, filling the event container is pretty straightforward. No need to use the macro SWC_SET_ELEMENT, because the container for SAP_WAPI_CREATE_EVENT is a simple key (element) & value list.

If you don't know which container elements to fill, check the event definition to see if it has any parameters. That should be the place to look, but if the error message comes from the workflow rather than the function module you should also check the workflow to see which container elements are required (and check how they are filled from the triggering event).

<i>You can create events from application or system programs by calling one of the relevant function modules SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT .

For the following special cases, there are other function modules, which actually use the functionality of the above function module internally:

SWE_EVENT_CREATE_IN_UPD_TASK

This function module makes it possible to create events in an update task. In contrast to the function module SWE_EVENT_CREATE , it can be called with the addition of IN UPDATE TASK .

SWE_EVENT_CREATE_FOR_UPD_TASK

The event is created in the update task. (The function module is not called with the addition of IN UPDATE TASK .)

One of the remaining FM has no code in it and the other is not used anywhere even by SAP.

If you are trying to create events, use the SAP_WAPI_CREATE_EVENT function if it is available in your SAP release.</i>


************************************code snippet****************************************
Data: lv_cont type swr_cont,
lt_cont type standard table of swr_cont.
lv_cont-element = 'releasecode'.
lv_cont-value = 'D9'. append lv_cont to lt_cont.

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'bus2012'
object_key = '4500004262'
event = 'releasestepcreated'
* COMMIT_WORK = 'X'
* EVENT_LANGUAGE = SY-LANGU
* LANGUAGE = SY-LANGU
* USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
TABLES
INPUT_CONTAINER = lt_cont
* MESSAGE_LINES =
* MESSAGE_STRUCT =
************************************code snippet****************************************

I think you got what expected

<b>Reward pts for usefull answers :)</b>

Regards

Sathish