Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Passing values to workflow

Former Member
0 Likes
626

Hello all,

I've a report program, the output of whch is an internal table with a single field type c. (elementary internal table). I've schedule the program to run at a specific time in background. Now, whenever the program executes, I want a workflow to trigger and pass the entire internal table to the workflow. How do I achieve this? Please help me out.

Regards

Indu.

1 ACCEPTED SOLUTION
Read only

peter_ruiz2
Active Contributor
0 Likes
586

hi,

use FM SWW_WI_START.

regards,

Peter

3 REPLIES 3
Read only

peter_ruiz2
Active Contributor
0 Likes
587

hi,

use FM SWW_WI_START.

regards,

Peter

Read only

0 Likes
586

Peter,

could you please give an example as of how i pass the internal table to that FM.

Indu.

Read only

0 Likes
586

hi,

here is an example


CONSTANTS : gc_task LIKE swwwihead-wi_rh_task VALUE 'WS99900152'.

DATA : BEGIN OF it_swcont OCCURS 0.
        INCLUDE STRUCTURE swcont.
DATA : END OF it_swcont.

MOVE : 'MATERIALRESERVATION'  TO  it_swcont-element,
             090          TO  it_swcont-elemlength,
             'o'        TO  it_swcont-type.

      CONCATENATE sy-sysid 'CLNT' sy-mandt
      'BUS2093' 'XXX'  gd_rsnum INTO
              it_swcont-value.
      REPLACE 'XXX' WITH '   ' INTO it_swcont-value.
      APPEND it_swcont. CLEAR it_swcont.

      MOVE : '_WF_INITIATOR'  TO  it_swcont-element,
             014          TO  it_swcont-elemlength,
             'C'          TO  it_swcont-type,
             gd_creator   TO  it_swcont-value.
      APPEND it_swcont. CLEAR it_swcont.
*---------------------------------------

*-------get work item type
      CALL FUNCTION 'RH_GET_WORKITEM_TYPE'
           EXPORTING
                task_object = gc_task
           IMPORTING
                wi_type     = gd_type.
*----------------------------------------
*----start workflow ---------------------
      CALL FUNCTION 'SWW_WI_START'
           EXPORTING
                creator       = gd_creator
                task          = gc_task
                workitem_type = gd_type
           IMPORTING
                wi_id         = gd_id
           TABLES
                wi_container  = it_swcont.