Skip to Content
0
Apr 12, 2018 at 09:23 PM

QM01 - Auto populate Tasks in Task Tab based on QN Type

448 Views Last edit Jun 01, 2018 at 03:18 PM 2 rev

All,

I have a requirement in which tasks needs to be auto-populated when user creates a notification in QM01.

I implemented the user exit QQMA0007 and put the following code.

This works fine for the first time but when user clicks on another tab and comes back to Task tab, the same entry keeps on repeating. Also, it appears that i have missed to populate some of the fields.

Appreciate if anyone has a solution to this.

DATA : lw_viqmsm TYPE wqmsm.
CLEAR : lw_viqmsm.

READ TABLE t_viqmsm INTO lw_viqmsm WITH KEY mncod = '102'.

IF sy-subrc NE 0.
  lw_viqmsm-QSMNUM = '0001'.
  lw_viqmsm-MANUM  = '0001'.
  lw_viqmsm-mncod = '102'.
  lw_viqmsm-parvw = 'VU'.
  lw_viqmsm-parnr = sy-uname.

  APPEND lw_viqmsm TO t_viqmsm.
ENDIF.