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: 

BAPI_ALM_ORDER_MAINTAIN function module discrepancy

Former Member
0 Kudos

Hi All,

I want to delete the object list from IW32. Can you tell me how to use BAPI_ALM_ORDER_MAINTAIN function module to get this done? If this does not work, is there any other FM?

4 REPLIES 4

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Based on the documentation of that BAPI, it should be possible... but that FM is a finicky one. I remember using it to change certain operation field values and it took some fiddling to find the right combination of parameters until I persuaded it to do what was needed.

Here is an example what was needed to do that change... yes, it is for a different object but this may give you an idea how to set up the parameters for object list deletion.

*----------------------------------------------------------------------
* // Change the reason for delay (user defined field)
*----------------------------------------------------------------------
  IF NOT delay_reason IS INITIAL.

*   Get order routing number
    SELECT SINGLE aufpl INTO l_aufpl FROM afko WHERE aufnr = ORDER.

*   Find number of the first operation
    SELECT aufpl vornr INTO (l_aufpl,l_vornr)
                       UP TO 1 ROWS
                       FROM afvc WHERE aufpl = l_aufpl
                       ORDER BY vornr.
    ENDSELECT.

*   Update delay reason
    IF syst-subrc = 0 AND l_vornr IS NOT INITIAL.
      CONCATENATE order l_vornr INTO l_objectkey.

      l_t_methods-refnumber  = '000001'.
      l_t_methods-objecttype = 'OPERATION'.
      l_t_methods-method     = 'CHANGE'.
      l_t_methods-objectkey  = l_objectkey.
      APPEND l_t_methods.
      CLEAR l_t_methods.
      l_t_methods-refnumber  = '000001'.
      l_t_methods-method     = 'SAVE'.
      l_t_methods-objectkey  = order.
      APPEND l_t_methods.

      l_t_oper-activity      = l_vornr.
      l_t_oper-field_key     = 'ABC'.
      l_t_oper-usr00         = delay_reason.
      APPEND l_t_oper.
      l_t_operu-field_key    = 'X'.
      l_t_operu-usr00        = 'X'.
      APPEND l_t_operu.

      CLEAR l_t_return.
       CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
        TABLES
          it_methods      = l_t_methods
          it_operation    = l_t_oper
          it_operation_up = l_t_operu
          return          = l_t_return.
  ENDIF.

Hope this helps a little.

0 Kudos

Hi,

Thanks for the response. I have tried this FM with operation and components list and it works fine. But this does not work with the header notification and object list items. All what i need to do is, delete the notification from the header tab of a work order and then delete all the object list items. I have been trying this but I am not at all able to find a soultion. If any of you could help me out, it would be of great help to me.

Thanks in Advance

0 Kudos

Hi Smitha,

Can you check the function groups(10-12) in package IWO_BAPI_EX to see if there is any BAPI that you can use for your requirement.

Regards,

Shyam

0 Kudos

I can see a lot of FMs in this package. But I am not able to figure out which one is apt. I cannot test every FM at this point because of time constraint. Has anyone worked on this before or has anyone faced this problem before so that you can help me rectify it.

Thanks