data:

  gv_task_end.    

 

    call function 'ZPP_ROUTING_FETCH' starting new task 'ZPP_ROUTING_FETCH'

          performing frm_task_end on end of task

          exporting

            uv_stlnr  = lt_alv_c-stlnr

            uv_stltyp = lt_alv_c-stlty

            uv_datuv  = sy-datum

            uv_matnr  = lt_alv_c-matnr

            uv_werks  = lt_alv_c-werks

            uv_stlan  = lt_alv_c-stlan

            uv_stlal  = lt_alv_c-stlal

*          tables

*           t_stpo_init     = lt_stpo_int

          .

 

        wait until gv_task_end = 'X'.

*        append lines of lt_stpo_int to lt_stpo.

        clear gv_task_end.

 

 

form frm_task_end using lv_flag type c.

  data:

        lt_stpo_int like table of stpob with header line.

  receive results from function 'ZPP_ROUTING_FETCH'

    tables              t_stpo_init     = lt_stpo_int.

  gt_stpo_int[] = lt_stpo_int[].

  append lines of gt_stpo_int[] to gt_stpo[].

  gv_task_end = 'X'.

endform.