cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Passing Internal table to event parameter

Former Member
0 Likes
1,947

Hi,

I have created a new event for a business object type. This event have got a multiline parameter( a internal table). I need to pass the entries of table to the event container when I raise the event using function module 'SAP_WAPI_CREATE_EVENT'.

The table parameter 'input_container' allows me to pass the field values but not sure if I can pass the internal table as well.

Any bright ideas???

Cheers,

Surendar

Accepted Solutions (0)

Answers (1)

Answers (1)

mark_rodrigues
Explorer
0 Likes

Hi Surendar,

Try defining a DDIC table definition, instead of just a structure and type your event parameter as the same. When I do this in 6.40, the Multiline flag is already set for me.

There is also a trick to how the container is built and filled. Do a "Where Used" on the FM SAP_WAPI_CREATE_EVENT and see how it is done elsewhere in the code.

Hope this helps.

Regards

Mark

Former Member
0 Likes

Hi Mark,

Creating a multiline parameter to the event is not a issue as I am able to do it by checking the multiline checkbox flag.

I have already done a where used search for that particular function module and it hadn't helped me. I was looking for help in case if someone has already done anything similar.

Sorry forgot to mention that I am on release 4.6C.

Cheers,

Surendar

pokrakam
Active Contributor
0 Likes

Hi Surendar,

SAP_WAPI... function modules use a simple name-value container. Just repeat your table entries:

wa_cont-name = 'EVENTPARAMETERNAME'.
loop at lt_itab into wa_itab.
  wa_cont-value = wa_itab. 
  append wa_cont to lt_cont. 
endloop.

Cheers,

Mike

Former Member
0 Likes

Hi Mike,

Tried doing this but could not see the internal table entries in the container.

But I have found another way of doing it. I am using function module 'SWE_EVENT_CREATE' rather then using 'SAP_WAPI_CREATE_EVENT'. I am able to pass on table data using macros 'SWC_SET_TABLE'.

The only difference here is the container type is changed and I need to perform a commit after the successful call of function module.

Does anyone have faced any problems using function module 'SWE_EVENT_CREATE'.

Cheers,

Surendar

pokrakam
Active Contributor
0 Likes

Interesting, I would have thought it should work, might be something broken in 4.6c.

SWE_EVENT_CREATE is fine in any case, I thought about suggesting that but we're supposed to be using SAP_WAPI's as far as possible because they are supported for customer use.

Regarding commit's there are also SWE_EVENT_CREATE_FOR_UPD_TASK / ...IN_UPD_TASK FM's around if you are doing this in an update task.

Cheers

Mike

pokrakam
Active Contributor
0 Likes

Just thought I'd post a followup as I had a spare minute to try this out. The following definitely works on a 640 system:

REPORT  ZTEST.
Data: lv_cont type swr_cont,
      lt_cont type standard table of swr_cont.

lv_cont-element = 'ZMULTI'.
lv_cont-value = 'A'. append lv_cont to lt_cont.
lv_cont-value = 'B'. append lv_cont to lt_cont.
lv_cont-value = 'C'. append lv_cont to lt_cont.

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
  EXPORTING
    OBJECT_TYPE             = 'ZMPTEST'
    OBJECT_KEY              = 'Z'
    EVENT                   = 'ZTESTEVT'
 TABLES
   INPUT_CONTAINER         = lt_cont.

As expected, the event had a ZMULTI parameter with three items A,B,C.

So might be broken in 4.6c but probably not worth following up with SAP.

Cheers

Mike

Former Member
0 Likes

Hi Folks,

I am facing the same problem in ECC 6.0 now, I have tried to populate multiple values into Event field but when the work flow log is checked it is shown up with blank values.

The same applies with the no values population in ruleresult after the agent is detemined in rule the work flow container is not populating i....s there any SAP NOTE that needs to be applied..

please help me asap.

Thanks and regards,

Krishna Mukthineni