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

Determine tasks automatically for IW21

Former Member
0 Likes
2,296

Through transaction iw21 i want to automatically populate the tasks for notification type P2 without having the user to navigate from EDIT->TASKS->DETERMINE. I need to automatically determine the tasks during SAVE of iw21 .

I have implemented a method in BADI NOTIF_EVENT_POST. I have the following line of code -

select * from T355E_W into TABLE it_T355E_W where priok = is_new_viqmel-priok.

Now how do I assign the contents of this table for the corresponding Notification number.. Is there any function module to do this?

1 ACCEPTED SOLUTION
Read only

Former Member
1,824

This issue is solved as

You need to to write the code in Badi:  NOTIF_EVENT_SAVE

METHOD : CHANGE_DATA_AT_SAVE

if sy-tcode = 'IW21'.

if flt_val = 'Z2'.

  DATA: wa_wqmsm TYPE wqmsm.

  wa_wqmsm-QSMNUM = '0001'.

  wa_wqmsm-qmnum = cs_viqmel-qmnum.

  wa_wqmsm-mngrp = 'PM1'.

  wa_wqmsm-mncod = '1'.

  wa_wqmsm-aeknz = 'I'.

  wa_wqmsm-TXTCDGR = 'Take Care of Permit'.

  wa_wqmsm-MANUM = '1'.

  wa_wqmsm-MNKAT = '2'.

  wa_wqmsm-STTXT = 'TSOS'.

  APPEND wa_wqmsm TO ct_iwqmsm.

ENDIF.

ENDIF.

Regards,

Bablu

9 REPLIES 9
Read only

kostas_tsioubris
Contributor
0 Likes
1,824

Hi,

you have to implented the user exit EXIT_SAPMIWO0_003 in order to automatically determine the tasks .

Kostas

Read only

0 Likes
1,824

Hi Kostas,

Thank you. I have activated the exit. I get all the related tasks for the notification type in an internal table. Now how do i assign these tasks to the notification. I am not able to find any function module which does this. Any idea on this one?

Read only

0 Likes
1,824

Hi,

Could you please check this function module READ_NOTIFICATION_TASK

Regards,

Keerthi

Read only

0 Likes
1,824

Hi Keerthi,

Thanks for that one.. But I found that the FM is used to read the tasks for the notification which is already existing. In my case i want to assign tasks to the notification I am creating.

Read only

0 Likes
1,824

Hi,

How about IQS1_POST_NOTIFICATION function module.

You can also search for the function modules under the package IWOC.

Regards,

Keerthi

Read only

0 Likes
1,824

Hi,

you have to fill the E_QMSM parameter with the tasks you want to assign and then raise the exception no_sap_std_task_determination, in order to skip the standard task determination...

Kostas

Read only

0 Likes
1,824

Hello Kostas,

This exit is triggered only when the user goes through Edit->taks->Determine.. But I want to add the tasks on save without doing this. I tried using BADI NOTIF_EVENT_POST and have called the BAPIs API_ALM_NOTIF_DATA_ADD' followed by 'BAPI_ALM_NOTIF_SAVE and BAPI_TRANSACTION_COMMIT.

Doesnt seem to work.. The notification gets created without the tasks... Pls help..

Read only

Former Member
0 Likes
1,824

Hi,

I wrote the code in exit EXIT_SAPLIQS0_017 to set the default value in the task tab. If you select the task tab and save then the default values are gating saved, where as if you won’t select the task tab and save the notification the notification gets created without default value in task tab.

Please help.

Regards,

Bablu

Read only

Former Member
1,825

This issue is solved as

You need to to write the code in Badi:  NOTIF_EVENT_SAVE

METHOD : CHANGE_DATA_AT_SAVE

if sy-tcode = 'IW21'.

if flt_val = 'Z2'.

  DATA: wa_wqmsm TYPE wqmsm.

  wa_wqmsm-QSMNUM = '0001'.

  wa_wqmsm-qmnum = cs_viqmel-qmnum.

  wa_wqmsm-mngrp = 'PM1'.

  wa_wqmsm-mncod = '1'.

  wa_wqmsm-aeknz = 'I'.

  wa_wqmsm-TXTCDGR = 'Take Care of Permit'.

  wa_wqmsm-MANUM = '1'.

  wa_wqmsm-MNKAT = '2'.

  wa_wqmsm-STTXT = 'TSOS'.

  APPEND wa_wqmsm TO ct_iwqmsm.

ENDIF.

ENDIF.

Regards,

Bablu