Application Development 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: 

Preventive maintenance plan

bartlomiej_lach
Participant
0 Kudos
94

Hello Experts!

I want ot update one user filed in operation from order which is created from transaction IP10 (Schedule maintenance plan). For this purpose I tried to use two different user exits:

1. EXIT_SAPLCOIH_030 - but here a I problem to find proper table with temporary data for operations. There is no such table in interface of user-exit so I have to copy it to field like below:


 unassign <fs_it>.
  l_field = '(SAPLCOBT)AFVG_BT[]'.
  assign (l_field) to <fs_it>.
  if <fs_it> is assigned.
    it[] = <fs_it>.
  endif.

If you know table with data about operation I will be grateful for hint.

2. EXIT_SAPLCOBT_001 - here I modify proper fields in OPERATION_TABLE table but system doesn't change it later. I don't know why? Maybe I should change some indicator?


if sy-tcode = 'IP10'.

  data wa_it like afvgb.
  types: begin of ls_mptt,
          point like imptt-point,
          pttxt like imptt-pttxt,
          usr00 like afvu-usr00,
          tabin like sy-tabix.
  types: end of ls_mptt.

  data: wa_mptt type ls_mptt.
  data: lt_mptt like standard table of wa_mptt with header line.
  data: cur_point type i,
        cur_usr00 type i.


  data: pttxt(20) type c,
        usr01(20) type c,
        tabin type sy-tabix.

  loop at header_table.

    select distinct imptt~point imptt~pttxt into lt_mptt
      from ( imptt
             inner join iflo
             on imptt~mlang = iflo~spras
             and imptt~mpobj = iflo~objnr )
             where iflo~tplnr = header_table-tplnr.
      append lt_mptt.
    endselect.


    loop at operation_table into wa_it.
      if sy-tabix = 1.
        continue.
      endif.
      tabin = sy-tabix.
      if not ( header_table-tplnr is initial
               or wa_it-slwid is initial
               or wa_it-usr01 is initial )
             and wa_it-usr00 is initial.

         loop at lt_mptt.

           pttxt = lt_mptt-pttxt(20).
           usr01 = wa_it-usr01(20).
           translate usr01 to upper case.
           if pttxt eq usr01.
             wa_it-usr00 = lt_mptt-point.
           endif.

           clear pttxt.
           clear usr01.

         endloop.

         modify operation_table from wa_it index tabin.

       endif.

      clear tabin.
      clear wa_it.

    endloop.

    clear lt_mptt.

  endloop.

endif.

So I return operation_table with data which I want but SAP doesn't fill it.

If you have any solution for first or second exit it will be great.

Thank in advance

BL

1 REPLY 1

Former Member
0 Kudos
33

Hi Bartlomiej

      Do you have any solution for this?