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

Similar Messages

  • 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

  • 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 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.

  • 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 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

  • PM: Create notification from a work order using transaction IW32.

    Hi guys,
    I am trying to create a Notification for a Functional Location thru Work Order Using transaction Code IW32.
    The actual transaction works fine as below -
    1. Open a work order in change mode using T code IW32
    2. Choose tab "Objects" to see the list of functional locations.
    3. Select a line with a functional loc, for which you want to create Notification & click "Create" Button at the bottom of the list.
    4. Enter Notification type on the pop up screen & enter.
    5. Enter the activity code, text & start date on the notif create screen & click Back. You can see the temp Notif Number in the row selected from the object list.
    6. Click save on the order change screen & the Notification is saved & is associated with the order & func Loc..
    However I can not do this in a program.
    I tried using Batch Input method. It works, but the problem is if you have more than 1 page of the Objects (Func locations) in objects tab, you can not goto the next pages.
    I also tried using BAPI_ALM_NOTIF_CREATE. Which doesnot for this purpose. It tries to create Notification but can't associate with the order.
    I appreciate your help.
    Thank you,
    Raj

    Hi:
    Check with Tcode: IBIP - Plant maintenace batch input utility tool.
    Hope, it may help!
    Thanks,
    Murali.

  • Define Purch. Req. transaction type for Plant Maintenance Order

    Hello,
    Does anybody know how i can specify the (default) Purch. Req. transaction type for a Plant Maintenance Order (IW31)? By default it picks up 'NB' but i would want to change this.
    Kind regards,
    Tim

    Hi,
    Go to this menupath spro>IMG->Plant Maintenance and Customer Service>Maintenance and Service Processing>Maintenance and Service Orders>General Data>Define Account Assignment Cat. and Document Type for Purchase Requisitions.Here you can change the doc.type for the PR.
    Regards,
    Venkatesh

  • 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

  • Using Manufacturer Part numbers (HERS) in Maintenance orders (IW32)

    We want to be able to allow our maintenance engineers to select the MPN's they want (material type HERS) from the maintenance order creation screen (Iw31/IW32) but we get the message CO010 Material nnnnnnnn not found in plant xxxx. Of course the HERS will not be created in MARC, however the end user should be able to select the HERS and generate a reservation for the "Firms own inventory managed material" (the ERSA).
    Any suggestions?

    We have the same problem; so far we think we have to create a custom search help and append the MAT1.
    I spent a long time searching for OSS notes but could not find any ...

  • Goods issue for plant maintenance order

    Goods issue with ref to plant maintenance order( Componenets of the order) is not possible in transaction code MIGO. Error message " MIGO is not possible for the refurbishment order".
    Goods issue for the same order can be posted with transaction MB!A.

    hi santhosh
    kindly check the order type .i think you are using MB1A for refurbishment process.but it is not possible.only maintenance order can be posted via MB1A
    follow the procedure for goods issue in refurbishment order.
    Choose Logistics ® Plant maintenance ® Maintenance processing ® Completion confirmation ® Goods movement ® Goods movement.
    The entry screen for a goods issue appears.
    Choose the pushbutton For order.
    Enter the relevant order number in the dialog box and choose Continue.
    An entry screen appears.
    Choose Copy.
    The Maintain Serial Numbers dialog box appears.
    Choose Reference document.
    Enter the order number in the Refurbishment order group box and choose Execute.
    A list appears with the planned serial numbers for the refurbishment order.
    Check the selections of serial numbers, for whose material you want to post a goods issue, and choose Copy.
    The serial numbers are copied into the Maintain Serial Numbers dialog box.
    Choose Exit window.
    The goods issue is posted.
    regards
    thyagarajan

  • Vendor Invoice for Plant maintenance order

    Hi
    WE generate 100's of PM order everyday. WE have technicians from outside contractor who work on PM Order. Instead of creating 100's of reqs and Pos for the service, we want to post invoice for the labor against PM order. IS it possible to do this?

    Hi Tridev,
    In such scenarios you should go for Blanket Purchase orders. In blanket PO you make a PO with vendor for a particular period and amount. Then you post only invoice with reference to the Blanket PO. You are not required to raise a PR and PO every time. Even you are not required to create service entry sheet. In blanket PO you may assign different cost center during invoice postings. Please talk to your MM consultant. Document type of such POs is Frame work.
    Following are the advantages of blanket PO:
    1. Different materials and/or services are procured over a longer period
    with a single PO item.
    2. It is not necessary to issue separate purchase orders for the individual
    procurement transactions.
    3. There is no goods receipt or service entry process.
    Please reply for more clarification.
    Regards,
    Vaibhav
    Edited by: VM1234 on Apr 15, 2010 6:07 AM

  • 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

  • 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

Maybe you are looking for

  • We have two iTunes accounts on one computer. Why is my music, apps, etc showing in my husbands account? home sharing is not selected

    We have two iTunes accounts on one computer. Why is my music, apps, etc showing in my husbands account? Home sharing is NOT selected. This recently became an issue when we added additional devices. Now we keep getting each other's apps!

  • Error while running root.sh

    Hi, I am trying to install Oracle 9i (9.2.0.1.0) in my Red Hat Advanced Server 2.1 and everything went fine from installing to linking it. But when it´s asked me to run root.sh as root it gives me an error while trying to install LSSV. It´s an depend

  • Playing iTunes videos to a personal DVD player

    I'd like to play iTunes videos on my DVD player. I copied them on to a USB, then tried to play them on the DVD player. But they show up as "MPEG4" files and a red circle with a line through it appears. Guess that means it's a No Go. Any suggestions?

  • ORA-06550 and PLS-00201 in PL/SQL Developer

    Hi all , I am facing the following error when i try to view the DDL of a table using pl/sql developer. ( right click on table and then DBMS_Metadata -> DDL) ORA-06550: line 7, column 5: PLS-00201: identifier 'SYS.DBMS_LOB' must be declared ORA-06550:

  • Code hints for id's and classes, already used in CSS

    Often when writing CSS I have to repeat #idnames and .classnames again and again, because I tend to write like this: #myelement {} #myelement .inner {} #myelement .inner .subdiv {} #myelement .inner .subdiv ul li {} #myelement .inner .subdiv ul li a