cancel
Showing results for 
Search instead for 
Did you mean: 

I canu00B4t pass SET Container from Z Program

yonatanedgardo_diaz
Participant
0 Kudos

Hi,

I have a ZObject that is execute through one report Z. (The WF is working OK, but i want to send any values)

CALL METHOD cl_swf_evt_event=>get_event_container

EXPORTING

im_objcateg = cl_swf_evt_event=>mc_objcateg_bor

im_objtype = l_objtype

im_event = l_event

RECEIVING

re_reference = lr_event_parameters.

  • Fecha Desde

CLEAR: l_returncode.

CLEAR: l_param_name, l_param_value.

l_param_name = 'FECHADESDE'.

l_param_value = s_fecha-low.

TRY.

CALL METHOD lr_event_parameters->set

EXPORTING

name = l_param_name

value = l_param_value

IMPORTING

returncode = l_returncode.

ENDTRY.

  • Llamada al Evento

TRY.

CALL METHOD cl_swf_evt_event=>raise

EXPORTING

im_objcateg = cl_swf_evt_event=>mc_objcateg_bor

im_objtype = l_objtype

im_event = l_event

im_objkey = l_objkey

im_event_container = lr_event_parameters.

IF sy-subrc EQ 0.

COMMIT WORK.

ENDIF.

ENDTRY.

But when I execute the workflow, the value that I set, not comming.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Aru
Participant
0 Kudos

Hi

I have tried the below steps , same is working for me

1) created z BO with key PERNR , event : TRIGGER , Event parameters : NACHN type pa0002- NACHN & VORNA type PA0002-VORNA

2) zworkflow template created with the container element 'NACHN' and 'VORNA' (Remember , words are same of event container )

3) created Z program with the below code

DATA : IM_OBJKEY TYPE sweinstcou-objkey,

IM_EVENT_CONTAINER TYPE REF TO IF_SWF_IFS_PARAMETER_CONTAINER.

IM_OBJKEY = '310'.

CALL METHOD cl_swf_evt_event=>get_event_container

EXPORTING

im_objcateg = cl_swf_evt_event=>mc_objcateg_bor

im_objtype = 'ZTESTEMP'

im_event = 'TRIGGER'

RECEIVING

re_reference = IM_EVENT_CONTAINER.

CALL METHOD IM_EVENT_CONTAINER->SET

EXPORTING

NAME = 'NACHN'

VALUE = 'TEST NAME1'

  • UNIT =

  • IMPORTING

  • RETURNCODE =

.

CALL METHOD IM_EVENT_CONTAINER->SET

EXPORTING

NAME = 'VORNA'

VALUE = 'LAST NAME'.

TRY.

CALL METHOD cl_swf_evt_event=>raise

EXPORTING

im_objcateg = cl_swf_evt_event=>mc_objcateg_bor

im_objtype = 'ZTESTEMP'

im_event = 'TRIGGER'

im_objkey = IM_OBJKEY

im_event_container = IM_EVENT_CONTAINER.

IF sy-subrc EQ 0.

COMMIT WORK.

ENDIF.

Regards

Arumugam

Answers (2)

Answers (2)

former_member185167
Active Contributor
0 Kudos

Hello,

If I understand correctly, you're creating an event and the values aren't being passed to the worflow?

Firstly, have you checked in SWEL that the event is actually created?

Secondly, debug this code to make sure the values get passed to the event.

Third;ly check the event - workflow bindings.

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

I hope the binding is done proiperly in the workflow. You should bind the event container element with Workflow container element.

Thanks

Arghadip