Skip to Content
author's profile photo
Former Member

SWE_EVENT_CREATE / SAP_WAPI_CREATE_EVENT + multiline event parameter

Hi All,

We have a custom business object , with custom events that have multiline parameters. The function modlues SWE_EVENT_CREATE / SAP_WAPI_CREATE_EVENT to trigger the event, however have an event container of type SWCONT or SWR_CONT, where the field VALUE is a 255 character field.

How would we handle events that have a multiline parameters? Essentially we need to pass an internal table while triggering an event.

Please let me know.

Thanks,

Deepa

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 12:15 AM

    Hi Deepa,

    Populating multiline elements is in the same way as you populate the single elements. For example if i have the element "DOCUMENT_DETAILS" to be populated as multiline it can be done as follows,

    loop at DOCUMENT_DETAILS.

    it_SWR_CONT-element = 'DOCUMENT_DETAILS'.

    it_SWR_CONT-value = DOCUMENT_DETAILS.

    append it_SWR_CONT.

    endloop.

    it_swr_cont-element = 'WF_TYPE'.

    it_swr_cont-value = WF_TYPE.

    APPEND it_swr_cont.

    v_obj_key = LOG_ENTRY.

    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

    EXPORTING

    object_type = 'ZBO_EHS'

    object_key = v_obj_key

    event = 'CREATED'

    COMMIT_WORK = 'X'

    IMPORTING

    RETURN_CODE = subrc

    TABLES

    INPUT_CONTAINER = it_swr_cont

    .

    In the above example 'DOCUMENT_DETAILS' will be populated as multiline element and 'WF_TYPE' will be populated as single line element.

    Thanks,

    Prasath N

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 10:26 AM

    Hi Deeepa,

    Ways to populate the values for container table ar ediferent in both the cases:

    In case of SWE_EVENT_CREATE , you can use macro for <b>swc_set_table</b>

    e.g. <i>swc_set_table</i> container 'TEST' it_table.

    ( You can check help on this macro from SAP help , if required.)

    Where as in case of WAPI function module, you can proceed as Prasath has suggested.

    Hope this helps.

    Regards,

    Akshay

    Add comment
    10|10000 characters needed characters exceeded