BAPI to change Work order operation details

Hi ,
  I have a requirement to change the operation work center of the service order . I am using the BAPI_ALM_ORDER_MAINTAIN . Could anyone let me know how the parameters i_methods and i_operation, i_operationup needs to be passed , what values need to be filled in them. Basically I am not sure about how the object key for the i_operations table is built.
Regards,
Prabaharan.G

Hi,
I used the below function module parameters as below the change operation work center of maintenance order,
CLEAR: I_METHODS[], I_HEADER[], I_HEADERUP[],
         I_OPERATION[], I_OPERATIONUP[].
  CLEAR: V_OBJKEY.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT  = P_V_AUFNR
    IMPORTING
      OUTPUT = P_V_AUFNR.
  I_METHODS-REFNUMBER = '000001'.
  I_METHODS-OBJECTTYPE = 'OPERATION'.
  I_METHODS-METHOD = 'CHANGE'.
  I_METHODS-OBJECTKEY = P_V_AUFNR.
  APPEND I_METHODS.
  I_METHODS-OBJECTTYPE = ' '.
  I_METHODS-METHOD = 'SAVE'.
  APPEND I_METHODS.
  I_OPERATION-ACTIVITY = P_V_VORNR.
  I_OPERATION-WORK_CNTR = P_V_WORK_CENTER.
  APPEND I_OPERATION.
  I_OPERATIONUP-ACTIVITY = 'X'.
  I_OPERATIONUP-WORK_CNTR = 'X'.
  APPEND I_OPERATIONUP.
  CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
    TABLES
      IT_METHODS             = I_METHODS
     IT_HEADER               = I_HEADER
     IT_HEADER_UP            = I_HEADERUP
  IT_HEADER_SRV          =
  IT_HEADER_SRV_UP       =
  IT_USERSTATUS          =
  IT_PARTNER             =
  IT_PARTNER_UP          =
   IT_OPERATION           = I_OPERATION
   IT_OPERATION_UP        = I_OPERATIONUP
  IT_RELATION            =
  IT_RELATION_UP         =
  IT_COMPONENT           =
  IT_COMPONENT_UP        =
  IT_TEXT                =
  IT_TEXT_LINES          =
  EXTENSION_IN           =
     RETURN                 = I_RETURN
  ET_NUMBERS             =
  READ TABLE I_RETURN INTO WA_RETURN WITH KEY TYPE = 'E'.
  IF SY-SUBRC NE 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    WAIT UP TO  1 SECONDS.
  ELSE.
    MOVE P_V_AUFNR TO WA_MSG_LOG-AUFNR.
    MOVE P_V_VORNR TO WA_MSG_LOG-VORNR.
    MOVE WA_RETURN-MESSAGE TO WA_MSG_LOG-MESSAGE.
    APPEND WA_MSG_LOG TO I_MSG_LOG.
    CLEAR: WA_MSG_LOG.
  ENDIF.
Regards,
Prabaharan.G

Similar Messages

  • BAPI for changing Work order user status in IW32

    Hello Experts,
    I am getting Same Problem in updating status via BAPI, BAPI_ALM_ORDER_MAINTAIN.  Its not giving any error but even not update status.
    I know i can use this for changing the user status also but not sure how to carry out things.
    I used this code.
    fi_methods-method = 'SAVE'.
    APPEND fi_methods.
    fi_methods-refnumber = 1.
    fi_methods-objecttype = 'USERSTATUS'.
    fi_methods-method = 'CHANGE'.
    fi_methods-objectkey = '002000002453'.
    APPEND fi_methods.
    fi_userstatus-user_st_text = 'COMM'.
    fi_userstatus-user_langu   = 'EN'.
    fi_userstatus-change_event = ' 01 '.
    APPEND fi_userstatus.
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
      TABLES
        it_methods    = fi_methods
        it_userstatus = fi_userstatus
        return        = fi_return.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Above code I am using and there the message comes like
    T ID                   NUM           MESSAGE
    S IW                   080           Order saved with number 2000002453
    S IWO_BAPI2     110           BAPI control was ended
    can any on know what is wrong in this? please help if having knowledge.
    Thank You,
    Jahnavee Trivedi

    I am getting Same Problem.
    fi_methods-method = 'SAVE'.
    APPEND fi_methods.
    fi_methods-refnumber = 1.
    fi_methods-objecttype = 'USERSTATUS'.
    fi_methods-method = 'CHANGE'.
    fi_methods-objectkey = '002000002453'.
    APPEND fi_methods.
    fi_userstatus-user_st_text = 'COMM'.
    fi_userstatus-user_langu   = 'EN'.
    fi_userstatus-CHANGE_EVENT = ' 01 '.
    APPEND fi_userstatus.
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
      TABLES
        it_methods    = fi_methods
        it_userstatus = fi_userstatus
        return        = fi_return.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Above code I am using and there the message comes like
    T ID                   NUM           MESSAGE
    S IW                   080           Order saved with number 2000002453
    S IWO_BAPI2     110           BAPI control was ended
    can any on know what is wrong in this? please help if having knowledge.
    Thank You,
    Jahnavee Trivedi

  • BAPI to change planned orders details

    Hi Experts,
    I need BAPI to change Planned order details,which are created through SNP PPM's.I searched for Bapi and got one 'BAPI_MOSRVAPS_SAVEMULTI3'  but this BAPI will change order details if created for PP/DS PPM's.
    Kindly suggest will this BAPI only work or someother.
    I want to keep the PPM name blank and save the order details through BAPI.
    Pls reply asap.
    Thanks
    surbhi

    Hi Surbhi,
    You may please search on google, there are lots of tutorial on BDC, you will surely get the solution... in short BDC is to record a transaction & then use same recording to generate ABAP program & you can play with screen navigations & update the fields you required...
    Regards,
    Adarsh

  • Use of field 'StartPoint' in work order operation's 'Dates' tab

    Hi,
    Can someone please explain me on the uase of field 'StartPoint' on work order operation's Dates tab.
    Regards.

    Start point will be used in case of scheduling for the operation.
    By mentioning the condition & date, while doing automatic scheduling, system will change the start date of the operation & correspondingly finish date.
    Note: This will work only when Automatic scheduling is ticked for the control key.
    Regards,

  • Work Order Operation Duplicated on Operation/Activity Number

    I had a coworker duplicated his activity number on a operation. He hit save after he had changed the operation number. Now it is giving an error "Inconsistent data: Order 20066826 02/11/2008, duplicate entry U 0125. This had only happened once before and I tecoed/business completed the work order. Then told them to create a new order. But this one, has important information in it, so I was asked to save this order.
    Any way to renumber the operation or delete it, or just get in the work order itself? I get this error in change or display.
    Thanks

    What you describe should not have happened, and in 11 years of consulting on SAP Plant Maintenance I can only recall having seen this kind of problem once previously. It's not a very easy problem to resolve. There are a couple of suggestions I can make, neither of which are particularly easy or straighforward:
    1. Raise an OSS message with help.sap.com to see if they are aware of the problem and have an ABAP that you can download that will correct or delete the database entries. I have done this successfully previously but whether they have an off the shelf solution for this will depend on which version you are on and which tables have corrupted entries in them.
    2. Get an ABAPer to look at the problem and produce an ABAP program to correct the entries internally. It wouldn't need to be a particularly complex program, only a few lines, but some analysis would be needed to ensure that all of the affected table entries are corrected as the work order operations are split across several tables.
    Sorry but there is not really an easy answer to this one.

  • Bapi for change work center data

    HIi All
                    I need BAPI to change work center data for all categories and work center change transactions .....IR02 ,CNR2,CR02.
    Thanks in advance .

    Hai,
    Try the fm CRAP_WORKCENTER_CREATE
    BAPI_BUS2054_CHANGE_MULTI
    CRAP_WORKCENTER_CREATE
    Regards,
    Venkat

  • Assign equipment to work order operations

    What configuration is needed to be able to assign a equipment to work order operation ?
    I already have few equipments assigned to a work order (displayed on the objects tab) but I need to assign some equipments to certain operations.

    Sveinn,
      You would need to be in ECC6.0 to be able to do this. This should be available through SPRO under PM> Maintenace and service processing > Functions and setting for order types > Define notification and order integration.Within this you would need to enable the assignment of operations to object list for specific order types.
    Hope it helps.
    Regards
    Narasimhan

  • 1.     Defining dependencies between Work order operations and Isolation Operation Steps

    Hi All
    Will you please let me know how i can define dependencies between Work order operations and
    Isolation Operation Steps? Suppoose I want to have WAP--->WCA-->WCD at operation level, is it possible? Can we have the Switching of Status & allowing that perticular operation for releads. e.g. I have operation 1 in Maintenance WO Which needs machine where only operational control panel to be Locked & tagged. No Need to Tag total machine. So once i complete complete the taging for it & once give permits for it, system should permits only that much operation. Not all operation which may have some other permits which needs to be issued.
    Regards
    Makarand      

    Hi All
    Will you please let me know how i can define dependencies between Work order operations and
    Isolation Operation Steps? Suppoose I want to have WAP--->WCA-->WCD at operation level, is it possible? Can we have the Switching of Status & allowing that perticular operation for releads. e.g. I have operation 1 in Maintenance WO Which needs machine where only operational control panel to be Locked & tagged. No Need to Tag total machine. So once i complete complete the taging for it & once give permits for it, system should permits only that much operation. Not all operation which may have some other permits which needs to be issued.
    Regards
    Makarand      

  • How to regenerate COSS table for work order operation planning hours

    Hello,
    I am looking for a SAP report or a custom solution to update the table COSS table from work order operation hours. Several work orders incorrectly updated in the table COSS with result the cost is incorrect.
    For example: In the work order opertions, I have  planned 2.5 hrs and in the table COSS it is 1.5.
    Much appreciate for your help
    Bill

    It is quite simple actually.
    As soon as your array exceeds SDU (defaults to 2048), sqlnet will fragment the packet. (see: sqlnet more data to client messages in your trace file)
    As soon as the packet is bigger than your NICs MTU, the NIC will fragment the packet.
    So, depending on the number of bytes for 1 record, high array size make sense or don't make sense.
    And ideally SDU should be a multiple of MTU.
    So do high arraysizes make sense? Usually not.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • Work order operation number in Production Scheduling

    Hi,
    We are using production scheduling for scheduling the discrete jobs. In production pegging view, the work order operation is shown in number "xx:xx:xx:xx:xx" not the name of the operation. Is there any setup required to display operation name? Any patch required?
    Thanks,
    Anitha.

    Hi,
    I have face similar issue in deleting PO line items.
    Even though I delete items, system check budget for deleted qty with the currency conversion + value & gives budget exceed error.
    In some cases we have asked user to deactivated AVAC asked to do the transaction, which is not recommended.
    You can try running CJBN & CJBV in sequence for affected WBS.
    Thanks & reg,
    Sam

  • BAPI to change data at operation level

    Hi,
    I have this requirement:
    I need to change data at operation level, more particularly Person No (PERNR) by using a BAPI.
    Is there any BAPI - in which I can pass the basic data (say Order data and Operation data) and change the PERNR for it.
    The name of the BAPI and its usage will help.
    Ankur

    Hello,
    Assuming you are talking about maintenance or service orders, you can use BAPI_ALM_ORDER_MAINTAIN. See function module documentation from SE37. The structure BAPI_ALM_ORDER_OPERATION contains PERS_NO field.
    -Paul
    Please use Enterprise Asset Management (EAM) forum for PM/CS specific topics
    Enterprise Asset Management (SAP EAM)

  • Work order operation

    how to find out action log for operation line item changes in work order. ( ex Deletion / changes )
    Thanks in advance
    S.Naresh

    Hi,
    For setting up ECM you can follow the steps given in the below link with all the T-Codes:
    http://www.sap-img.com/pp007.htm
    And for the complete explanation of ECM you can follow the link:
    http://www50.sap.com/businessmaps/D0A45D785990457D990738D4CC4FD4C6.htm
    Amit.

  • Function module for changing Work order user status in IW32

    Hi,
    I want to change the work order user status in IW32 using ABAP.
    Is there any function module to do so or any other way? I have tried using BDC but this does not work.
    Please suggest.
    Regards,
    Naba
    Edited by: n. saha on Nov 5, 2008 6:46 AM

    I am getting Same Problem.
    fi_methods-method = 'SAVE'.
    APPEND fi_methods.
    fi_methods-refnumber = 1.
    fi_methods-objecttype = 'USERSTATUS'.
    fi_methods-method = 'CHANGE'.
    fi_methods-objectkey = '002000002453'.
    APPEND fi_methods.
    fi_userstatus-user_st_text = 'COMM'.
    fi_userstatus-user_langu   = 'EN'.
    fi_userstatus-CHANGE_EVENT = ' 01 '.
    APPEND fi_userstatus.
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
      TABLES
        it_methods    = fi_methods
        it_userstatus = fi_userstatus
        return        = fi_return.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Above code I am using and there the message comes like
    T ID                   NUM           MESSAGE
    S IW                   080           Order saved with number 2000002453
    S IWO_BAPI2     110           BAPI control was ended
    can any on know what is wrong in this? please help if having knowledge.
    Thank You,
    Jahnavee Trivedi

  • How to change Work order status ?

    Hi,
    I am using an ABAP program to change the user status of a work order to "CLOP" , This is like IW32 , Here Which function module I can use to do this ?
    Thank you for your help.
    Thanks

    Hi,
    You can use the FM 'STATUS_CHANGE_EXTERN' for updating the user status. and 'STATUS_CHANGE_INTERN for updating the system status.
    Hope this solves your problem.
    Regards,
    Hari

  • Standard IDOC/BAPI to create work order in CRM from ECC PS

    Hello Guys,
    Any input on any standard IDOC/BAPI I could use to create a work order in SAP CRM based on the data feed from SAP ECC (Project systems)?
    Any help on this would be really appreciated.

    Hii.
    Did u get answer of SAP-> XI->CRM. IF so, share wid us.
    I m stuck in same kinda scenario

Maybe you are looking for