cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Work Item ID from Event ID

Former Member
0 Kudos

Hi Guys,

I am triggering an event using FM SWE_EVENT_CREATE. Is it possible to get Workitem ID from Event ID. Does it create Event ID before commit work after calling FM SWE_EVENT_CREATE.

I am triggering this workflow Event from ABAP-WebDynpro Application. When I add a new structure to the Workflow container, even though I fill this data while raising an event still its not updated in the workflow.

So I am trying to work way around; to update the container using workitem id.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

bpawanchand
Active Contributor
0 Kudos

Firstly

Use SAP_WAPI_CREATE_EVENT function module, if you want to know what is the event id then if you look at the exporting parameters of the function module EVENT_ID it will give you the event ID.

And coming to passing values to WF from dynpro application is simple

declare a standard table of type SWR_CONT and this table is a ELEMENT- VAlUE pair combination.

Define the element name same as what have you defined in the workflow. In this way append all the container valules to the table and pass this table to the FM tables parameter INPUT_CONTAINER this will transfer all the values from Dynpro to workflow.

Former Member
0 Kudos

Hi,

Thanks for the reply.

Here is my code.

DATA: v_objkey TYPE sweinstcou-objkey,

t_container TYPE swconttab.

swc_set_element t_container 'NewContData' newcontdata.

swc_set_table t_container 'ApprovalText' approvaltext.

swc_set_element t_container 'Approver' approver.

swc_set_element t_container 'TrimLink' trim_link.

MOVE newcontdata-pernr TO v_objkey.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'BUS1065'

objkey = v_objkey

event = 'WDNEWCONTRACT'

TABLES

event_container = t_container

EXCEPTIONS

objtype_not_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

COMMIT WORK.

But when I check in workflow log I don't find values for container element TRIMLINK.

But other container elements are updated.

Thanks

bpawanchand
Active Contributor
0 Kudos

what is the type of trim_link. it is a table or simple element and what is the type CHAR or any thing elese and what is the size.

if it is a table then you have to use SWC_SET_TABLE

Former Member
0 Kudos

Hi,

Its a structure, I should use SWC_SET_TABLE instead of SWC_SET_ELEMENT.

Thanks for the reply.

Problem solved.

Cheers

Answers (1)

Answers (1)

former_member185167
Active Contributor
0 Kudos

Hello,

Firstly, you should use SAP_WAPI_CREATE_EVENT.

You can pass any value you want to the container via event parameters.

Try it, if it doesn't work show us what you've tried and what the problem is.

Don't update the container directly.

regards

Rick Bakker

Hanabi Technology