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

Function module to cancel item assignment maintenance plan

sistemes_emaya
Explorer
0 Likes
1,085

Hi,

I want to develop a program to cancel item assignment from maintenance plan but I don't find anything.

I've been trying to use the function modules grouped by MPLAN_API group function, for exemple MPLAN_ITEM_CHANGE and others but no success.

Does anyone know how to do it? At standard transaction IP02 there is a button which does that functionality, I've been debugging the standard program involved with that button but no success.

Thanks for your help.

1 REPLY 1
Read only

Former Member
0 Likes
608

I had the same requirement and using the FM  'MAINTENANCE_PLAN_POST'

example:

      CALL FUNCTION 'MAINTENANCE_PLAN_POST' IN UPDATE TASK
      EXPORTING
        x_xaktyp = 'V'

      TABLES
        impla    = impla     
        impos   = impos
        imhis    = imhis
        immpt   = immpt.

But here need to prepare the internal tables impla,impos,imhis,immpt

for the selected item to be cancelled, we need to do some more steps     

        CLEAR impos_t-warpl.
        CLEAR impos-wppos.
        impos-status = 'F'.
        impos-ind_wpgrp_input = 'X'.
        impos-ind_gewrk_input = 'X'.
        impos-ind_iwerk_input = 'X'.

and for all items         impos-dbknz = 'X'.

and impla-mpla_upd = 'X'