Skip to Content

Problem adding components to production order using CO_XT_COMPONENT_ADD

Hi experts,

I need to add components to production order. Before doing that I delete an existing component using:

CALL FUNCTION 'CO_XT_COMPONENTS_DELETE'

CALL FUNCTION 'CO_IT_SET_FLG_ITAB_NEW'.

CALL FUNCTION 'CO_XT_ORDER_PREPARE_COMMIT'.

COMMIT WORK AND WAIT.

Then, if I have deleted position 0020, I need to add a new component in that 0020 position with function CO_XT_COMPONENT_ADD I get error X4017 (Component &1: Operation not found in order &2). Is there any posibility to add component in the same position I have previously deleted ?

Thanks in advance.

María

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 07, 2016 at 11:54 AM

    Does anybody know how to solve my issue ?

    The consultant told me to try module function CLOI_CHANGES_UPL_31 but I think it's not suitable for my requirement..

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Maria

      Can you share us a code snippet in order to replicate the error please?

      I'm not familiar with Production orders but I faced a similar issue several months ago with maintenance orders, since they also use operation numbers. In order to execute the function you need to concatenate the operations number with the ORDERID in order to create a object key that the function identifies the operation. like the following:

      CONCATENATE ORDERID CONST_OPERATION INTO IT_METHOD-OBJECTKEY.
      IT_METHOD-REFNUMBER = REFNO.
      IT_METHOD-OBJECTTYPE = 'COMPONENT'.
      IT_METHOD-METHOD = 'CREATE'. ...

      OrderID is the Maintenance order number generated by SAP

      CONST_OPERATION is the operations number (in my case is always 0010)

      REFNO is always 0001


      And to add the new component use the following code:

      IT_COMPONENTS-ACTIVITY              = CONST_OPERATION.
      IT_COMPONENTS-MATERIAL              = COMPONENTS_LIST-MATERIAL.
      IT_COMPONENTS-PLANT                 = PLANT.
      IT_COMPONENTS-ITEM_CAT              = 'L'.
      IT_COMPONENTS-STGE_LOC              = COMPONENTS_LIST-STGE_LOC.
      IT_COMPONENTS-REQUIREMENT_QUANTITY  = COMPONENTS_LIST-REQUIREMENT_QUANTITY. ...
      

      In my case the operations number is a number that in the transactions always fills with 0010.

      Hopes this helps to solve your issue.

      Warm regards.

      Lorenzo Martín Olmos

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.