Skip to Content
author's profile photo Former Member
Former Member

Passing Internal tables to Workflow

Hello all,

I learning workflow and have a small doubt related to passing internal table as parameter to workflow when it is triggered by a report program explicitely.

I wrote a prog to upload data from flat file into internal table and by passing this ITAB to the workflow for futher processing. <b>Actually i succeeded in this with only one field in my flat file (lfa1-lifnr).</b>

<b>what if my flat file contains more than one field? (i.e., lifnr, name1, city, county) how should i declare the parameters for my EVENT (triggering event) and same with my container declaration?</b>

Any inputs in this regards are welcome.

Thank you in advance,

Lakshmi Narayana

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 26, 2006 at 10:00 AM

    Hi Lakshmi,

    • Create Workflow container

    swc_container lt_container.

    swc_create_container lt_container.

    • Fill internal table with data

    • The container type and the internal table type should be same, U can use a structure to define both.

    • Declare a structure with all the fields.

    • Define a conatiner of same type of structure in worklow and set it in <b>wait for event</b> setp.

    swc_set_table lt_container '<container_name>' lit_int_data.

    CALL FUNCTION 'SWE_EVENT_CREATE'

    EXPORTING

    objtype = lc_objtyp

    objkey = lv_objkey

    event = lc_event

    IMPORTING

    event_id = lv_eventid

    TABLES

    event_container = lt_container

    EXCEPTIONS

    objtype_not_found = 1

    OTHERS = 2.

    Rgds,

    Prakash

    Message was edited by: Prakashsingh Mehra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Lakshmi,

      I have some further comments which might clear the situation more for you..

      Instead of SWE_EVENT_CREATE, please use the more official workflow bapi SAP_WAPI_CREATE_EVENT. It should have the same input/output params as SWE_EVENT_CREATE but SAP guarantees the function won't change in the future so you're safe for upgrades etc.

      The event triggering can be done as Prakash has written. In addition, you need to first define the event parameters for the event you are raising. Go to SWO1 for the appropriate business object and modify the event required. There enter the proper attribute/object type for the event and click on multiline to have multiple lines for the event container.

      After this you can bind the event container elements to the workflow container elements (event linkage). Just make sure to have the workflow container element set up similarly as the event parameter (multiline).

      Hope this helps,

      MIkko

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 12:04 PM

    Hi Lakshmi Narayana,

    if your problem of passing an internal table to workflow has been solved, can u please explain the procedure to do the same as i'm in deperate need of it.

    regards,

    Samson

    Add comment
    10|10000 characters needed characters exceeded