Create partners for a maintenance order

Hello:
I need create partners for a maintenance order ( IW32 transaction) in a program.
I'm using IBAPI_ALM_ORDERPARTNER_MAINT but it does  not do  anything.
when,in partners data, an error  exists, this is returned but when all is correct, bapi does not do anything.
REPORT  ZPM_PRUEBA_BAPI_INTER.
DATA G_PAR TYPE I_PARNR.
parameters p_aufnr like aufk-aufnr.
SELECT-OPTIONS: S_PAR FOR G_PAR.
parameters p_id(2).
data lv_mens(255)   TYPE c.
data: BEGIN OF lt_partner OCCURS 0.
        INCLUDE STRUCTURE BAPI_ALM_ORDER_PARTNER.
data: end of lt_partner.
data: BEGIN OF lt_partner_UP OCCURS 0.
        INCLUDE STRUCTURE BAPI_ALM_ORDER_PARTNER_UP.
data: end of lt_partner_UP.
DATA: BEGIN OF LT_ERR_COM.
       INCLUDE STRUCTURE BAPIRET2.
DATA      END OF  LT_ERR_COM.
*data begin of lt_errors occurs 0.
*       include structure BAL_S_MSG.
*data end of lt_errors.
data: lt_errors type standard table of BAL_S_MSG with header line.
start-of-selection.
  lt_partner-PARTN_ROLE = p_id.
*  lt_partner_UP
  LOOP AT S_PAR.
    lt_partner-PARTNER = S_PAR-LOW.
    APPEND lt_partner.
  ENDLOOP.
*1038062
  CALL FUNCTION 'IBAPI_ALM_ORDERPARTNER_MAINT'
    EXPORTING
      IV_ORDERID                           = p_aufnr
* IMPORTING
*   EV_CREDITLIMIT_CHECK_NECESSARY       =
  TABLES
    IT_PARTNER                           = lt_partner
*   IT_PARTNER_UP                        =
*   ET_PARTNER                            =
      ERRORS                               = lt_errors
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
   WAIT          = 'X'
IMPORTING
   RETURN        = LT_ERR_COM
  loop at  lt_errors.
*    write: /2 lt_errors-MSGV1,lt_errors-MSGV2,lt_errors-MSGV3,lt_errors-MSGV4.
       CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        ID              = lt_errors-msgid
*           LANG            = '-D'
        NO              = lt_errors-MSGNO
        V1              = lt_errors-msgv1
        V2              = lt_errors-msgv2
        V3              = lt_errors-msgv3
        V4              = lt_errors-msgv4
      IMPORTING
        MSG             = lv_mens
      EXCEPTIONS
        NOT_FOUND       = 1
        OTHERS          = 2.
     WRITE lv_mens
  endloop         .
help me please.
Thanks's

Hi,
First, you can/should not use the FM IBAPI_ALM_ORDERPARTNER_MAINT. This FM is part of the service order BAPI called BAPI_ALM_ORDER_MAINTAIN and this is the correct FM to call for your requirement.
A released BAPI by SAP will "survive" any upgrade. This is certainly not true for the mentioned FM IBAPI_ALM_ORDERPARTNER_MAINT, for instance.
Please read the documentation for FM BAPI_ALM_ORDER_MAINTAIN either from SE37 (use language EN) or from transaction BAPI. There are sections for partner handling there (you must fill both the IT_PARTNER and the IT_PARTNER_UP tables for instance.
This thread here on SDN will be of interest for solving your problem: Re: Deleting partner with BAPI_ALM_ORDER_MAINTAIN does not work
If you find this answer of help then award some points so others can benefit from the answer as well.
Best regards, Johan

Similar Messages

  • Create partners for a maintenance order ( IW32 transaction)

    Hello:
    I need create partners for a maintenance order ( IW32 transaction) in a program.
    I'm using IBAPI_ALM_ORDERPARTNER_MAINT but it does not do anything.
    when,in partners data, an error exists, this is returned but when all is correct, bapi does not do anything.
    help me please.
    Thanks's
    REPORT  ZPM_PRUEBA_BAPI_INTER.
    DATA G_PAR TYPE I_PARNR.
    parameters p_aufnr like aufk-aufnr.
    SELECT-OPTIONS: S_PAR FOR G_PAR.
    parameters p_id(2).
    data lv_mens(255)   TYPE c.
    data: BEGIN OF lt_partner OCCURS 0.
            INCLUDE STRUCTURE BAPI_ALM_ORDER_PARTNER.
    data: end of lt_partner.
    data: BEGIN OF lt_partner_UP OCCURS 0.
            INCLUDE STRUCTURE BAPI_ALM_ORDER_PARTNER_UP.
    data: end of lt_partner_UP.
    DATA: BEGIN OF LT_ERR_COM.
           INCLUDE STRUCTURE BAPIRET2.
    DATA      END OF  LT_ERR_COM.
    *data begin of lt_errors occurs 0.
    *       include structure BAL_S_MSG.
    *data end of lt_errors.
    data: lt_errors type standard table of BAL_S_MSG with header line.
    start-of-selection.
      lt_partner-PARTN_ROLE = p_id.
    *  lt_partner_UP
      LOOP AT S_PAR.
        lt_partner-PARTNER = S_PAR-LOW.
        APPEND lt_partner.
      ENDLOOP.
    *1038062
      CALL FUNCTION 'IBAPI_ALM_ORDERPARTNER_MAINT'
        EXPORTING
          IV_ORDERID                           = p_aufnr
    * IMPORTING
    *   EV_CREDITLIMIT_CHECK_NECESSARY       =
      TABLES
        IT_PARTNER                           = lt_partner
    *   IT_PARTNER_UP                        =
    *   ET_PARTNER                            =
          ERRORS                               = lt_errors
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    IMPORTING
       RETURN        = LT_ERR_COM
      loop at  lt_errors.
    *    write: /2 lt_errors-MSGV1,lt_errors-MSGV2,lt_errors-MSGV3,lt_errors-MSGV4.
           CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            ID              = lt_errors-msgid
    *           LANG            = '-D'
            NO              = lt_errors-MSGNO
            V1              = lt_errors-msgv1
            V2              = lt_errors-msgv2
            V3              = lt_errors-msgv3
            V4              = lt_errors-msgv4
          IMPORTING
            MSG             = lv_mens
          EXCEPTIONS
            NOT_FOUND       = 1
            OTHERS          = 2.
         WRITE lv_mens
      endloop         .

    Hi,
    First, you can/should not use the FM IBAPI_ALM_ORDERPARTNER_MAINT. This FM is part of the service order BAPI called BAPI_ALM_ORDER_MAINTAIN and this is the correct FM to call for your requirement.
    A released BAPI by SAP will "survive" any upgrade. This is certainly not true for the mentioned FM IBAPI_ALM_ORDERPARTNER_MAINT, for instance.
    Please read the documentation for FM BAPI_ALM_ORDER_MAINTAIN either from SE37 (use language EN) or from transaction BAPI. There are sections for partner handling there (you must fill both the IT_PARTNER and the IT_PARTNER_UP tables for instance.
    This thread here on SDN will be of interest for solving your problem: Re: Deleting partner with BAPI_ALM_ORDER_MAINTAIN does not work
    If you find this answer of help then award some points so others can benefit from the answer as well.
    Best regards, Johan

  • How to create a PR for each Maintenance Order

    Dear All,
    Please guide me how to create a PR for each Maintenance Order.
    I test on Ides, I have some Maintenance Orders, all of them require the same stock material. When I run MRP, system always create one PR for all requirements. I don't know how to change.
    Regards,
    QuangDD

    Hi,
    As you planning for Stock Items, by running MRP, system will create single PR only. If it is non stock items, then it would be possible to create different PR based on Orders.
    Regards,
    Maheswaran.

  • How to create transaction for a maintenance view, Thank you.

    How to create transaction for a maintenance view,
    Thank you.
    deniz...

    Hi Deniz,
    Go to se93.
    Then create the new T.code.
    Under that select parameter Transaction.
    Then give the sm30 in the t.code in default values tab.
    check the checkbox skip initial screen.
    in classification tab.
    click checkbox inherit gui attributes..
    Now below..
    In the default values..
    select
    viewname and give ur table name.
    UPDATE= Xsave
    view - table name ( Should be upper case
    update X ( should be upper case).
    http://www.sap-basis-abap.com/sapbs011.htm
    Hope this helps you.
    Regards,
    Viveks

  • Origin Object Type for Plant Maintenance Orders in Profit Center Accounting

    Hi,
    I want to make a selection for plant maintenance orders in transaction KE5Z, report for line items in Profit Center Accounting. When checking possible input options for the selection field <b></b>Origing Object Type<b></b> the system shows value 15 for Maintenance Orders. However I discovered in our system the maintenance orders are reported as Origing Object Type 03, which is Overhead Orders according to the selection list. So I cannot distinguish between overhead orders and maintenance orders in this report.
    What is the cause our maintenance orders are assigned to Origin Object Type 03 in stead of 15 and what is the customizing transaction to correct this ?

    Looks like, this is no longer supported. Refer to note 168004 and  102434.
    Cause and prerequisites
    These functions were not programmed to meet the above requirements.
    As of Release 4.0, the object type is transferred directly.
    Solution
    Once you have implemented the advance correction. the origin object type 'Overhead cost order' (03) is assigned irrespective of what is the SCOPE for orders.
    As a result of implementing this note or as of Release 4.6B, the order category distinguishes between overhead cost orders and production orders in the origin object type. In this case, the following origin object types result (as described above in 1.):
    Order category 04 to 10, 40 => 04 (production order)
    All other order categories => 03 (overhead cost order)
    The logic that the origin object type was set depending on the object class (as described above in 2.) is no longer supported. The object class can be evaluated separately in Reporting. -
    The corrections of this note refer in Release 4.0B to the corrections from Note 102434.

  • How to creat deadlock for the purchase order in SAP Workflow

    How to creat deadlock for the purchase order in SAP Workflow

    Hi Ben,
    Are you using FM "CONVERT_DATE_TO_EXTERNAL" before passing delivery date?  If not, use FM like this, before passing the date to BAPI_PO_CREATE1 and it might work
      DATA: vf_doc_date(10),
                 internal_date TYPE d.
         vf_doc_date = sy-datum.              "Document date.
         internal_date = vf_doc_date.
      CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
        EXPORTING
          date_internal            = internal_date
        IMPORTING
          date_external            = vf_doc_date
        EXCEPTIONS
          date_internal_is_invalid = 1
          OTHERS                   = 2.
    Regards,
    Vivek

  • One Purchase Requisition for One Maintenance Order

    Dear Consultants,
    We have implemented mySAP ECC 6.0.   We have more than 20 line items in one Maintenance order for  Item category N. Curently system is generating Purchase requisitions by line itemwise for Item category N(Non-stock items). Our client requires only one purchase requisition for every Maintenance Order. Is it possible to generate one PR for one Maintenance Order? If possible please give us the solution.
    Thanks,
    Dev

    Dear Pete Atkin,
    With your help my issue has been resolved. Thank you very much.
    With Best Regards,
    Dev

  • BAPI or FM to assign / create service master in maintenance order

    Hi Experts,
    Can you please help which BAPI or FM to assign / create service master in maintenance order during the creation of order.
    Thanks,
    Suresh

    Hi Suresh Babu,
    Look at BAPI_ALM_ORDER_MAINTAIN from IBAPI_ALM_ORDER function group.
    As customer enhancement you can use IBAPI_ALM_ORD_MODIFY.
    In help documentation you can find more information with examples.
    Bear in mind that using the BAPI to process the order data cannot support all the functions of the transaction.
    Regards
    Pawel Pyda

  • How to use WCM for a maintenance order ?

    HI friends,
         Can u please tell the steps how i should use WCM in a maintenance order?
    Regards,
    M.Alagesan

    Hi Alagesan,
    To use WCM in Maintenance Orders, you should have activated either a Standard or Enhanceed Model Architecture for the Planning Plant in SPRO. (SPRO>PMCS>WCM--> Master Data --> Architecture)
    Also you should Activate WCM for Maintenance Orders (SPRO>PMCS>WCM--> Approvals)
    Then the Reference Object you are using for Order creation should have the Permit(Approval) used above assigned to it & Auto Proposal should be checked.
    When you create a Order on such Equipment, WCM will get activated Automatically. Also you can activate using Operational Control key of WCM.
    If Standard Model the Flow is Order --> Work Clearance Application --> Work Clearence Document. Release Permits in Order and proceed to Tag in WCD. Then Release the Order for Execution.... and so on.
    If Enhanced Model the Flow is Order --> Valuation --> Work Approval --> Work Clearance Application --> Work Clearence Document. Release Permits in Order and proceed to Tag in WCD. Then Release the Order for Execution.... and so on.
    Regards,
    MLN Prasad

  • Best Practice for Change Maintenance Order Number Range

    Hello
    We have decided that our Maintenance Orders will always start with the year of the open date. Example 201112345155
    Every year we will need to change the number ranges
    What is the best practice to change the order number range? What is the best approach here?
    I have also another question. Why the "Current Number" is not incremental?
    Thanks for the help

    Hi,
    The current number can be explained by use of buffering of the numbers. Buffering is defined via transaction SNRO, the  AUFTRAG object is relevant for orders. When buffering is active, a set of unused numbers are assigned to each application server.
    In your example -  The fiirst 20 numbers were taken from the available number range and assigned to the buffer (possible 10 numbers to each of two servers). As orders are created a number is assigned from the buffer. Once the buffer values are used a further set of numbers are taken from the number range and the current number is increased (by buffer value).
    -Paul

  • Settlement rule Mandatory for Plant Maintenance order

    Hi Expert!
    I want to make the option Settlement rule mandatory while creating plant maintenance order. I would really appreciate if you provide me the menu path in customisation to make this mandatory.
    Thanks
    J

    Hi Jean
    I do not think you can make it mandatory while creation itself.
    But, you can make it mandatory (Check Functions for setting order types->settlement rule....) for order release.
    Best regards
    Ramki

  • Classifikation for plant maintenance orders

    Hello Experts,
    we want to use classification for maintenance orders but we are struggling with the set up of the order types. It seems that order type 30 - maintenance orders - is not set up for classification (differently to order type 10 for example).
    Does anybody know if there is any chance to create an order type used for PM which enables the usage of classification?
    If it is possible, all details for the set up are highly appreciated.
    Thanks
    Kurt

    Hello,
    Pushpa - sorry, I don't understand what you are talking about, please explain a little more in detail, it is also the opposite statement of what Paul has replied.
    How can I classify PM orders which belong to order category 30? How to classify objects used in the orders I know, but how to classify the orders itselves - like you can do for example with orders of order category 10 - the normal production orders.
    My first idea was to change settings for order category 30 or to copy this category and assign the new category to PM - how to do this, is it possible, this was the question since I did not find any possibility.
    Paul confirmed that there is no way to do so.
    You said that you even classify orders of the Ides standard type PM01 - how do you do that? Sorry, I did not uderstand your explaination how to do - use an activity type? Could you please tell me what and how and where to do in detail?
    thanks a lot
    Kurt

  • Reg. Capacity levelling for the maintenance order

    Hi all,
    I am using SAP R3 ECC6.0.
    I have created a maintenance order with order type PM01(Internal).In this order i have assigned Work Center 1 with the Work center category as Labour.And i have assigned 2 operations for this Work center in the maintenance order with the total hours of 60 HRS. and i saved this order & made the status to release.
    Then i went to Tcode CM33 and there i inputed the Work center name and executed it.It opens a Graphical View.But in that view my order no is not displayed .Previous order no. which is there already for that Work center is shown there.
    What could be the Reason.
    As an alternate checking i went to T code CM31 order view.There i Inputed my order no. and executed it but it throws a message
    "No Capacity requirements were found in the evaluation period"
    "No work centers or orders were found"
    What could be the reason.
    Tell me how to overcome this issue.
    More over i want to make dispatch in the capacity levelling.
    Thanks in advance,
    M.Badrinarain.

    hi badri,
    are you checking in the same period ? and next check ur overall profile and time profile assigned to ur overall profile .... u will find order no , operation no .... and once u dispatch operation status gets DSPT .
    regards
    pushpa

  • Maintenance history for Routine Maintenance Orders

    Hi I want to know where the work order history to be entered for the Functional Location for future reference and analysis for a routine maintenance order. Normally for routine maintenance we dont raise notification and directly order is created from the maintenance plan/item. Please reply.

    Depends on how you plan to use that history. If you need to do data analysis of this history then may be you should use the notification by creating it. If it is just to record info then I feel that entering the explanation in the long text during time confirmation or in the order header etc.. should be good. I feel the first option is good. Try it. If u find it too cumbersome then shift over to the second. Right now I can only think of these two.
    thanks
    Bala

  • Auto-create delivery for multiple sales orders

    I would like to ask how to create auto-create 'single' delivery
    for multiple sales order during release sales order in R11i.
    It is found in my example during release sales order, multiple
    sales orders fulfill release sales order criteria, a single pick
    slip is generated but it is found that each sales order have
    individual delivery with it. It will casue multiple pack slips
    for a singles pick slip. Is it normal feature for auto-create
    delivery, or any setup to solve it?
    Thanks in advance.

    Am not able to do Single Delivery for Muktiple sales orders
    Have you searched the forum for this question as to why you were not able to generate ??  It could be due to multiple reasons.  Please search the forum and update here what steps you have taken after taking the inputs from here, if the problem is still not resolved.
    thanks
    G. Lakshmipathi

Maybe you are looking for