3 Replies Latest reply: Mar 29, 2012 10:32 AM by user12010732 RSS

    How import items with the API  INV_ITEM_PVT.create_item and template item

    user12010732
      Hello

      I would like to use the API INV_ITEM_PVT.create_item and also the flags defined in the template item to create new items.
      I define the variable lr_item_rec as INV_ITEM_API.ITEM_REC_TYPE.
      I fill in this record with the value from the template but the item is not created and I get the error ORA-20001
      Could you help me to know the list of columns manadatory in the record INV_ITEM_API.ITEM_REC_TYPE and how can I have more information on the error in the API.

      INV_ITEM_PVT.create_item(
      p_item_rec => lr_item_rec --IN INV_ITEM_API.ITEM_REC_TYPE
      ,p_item_category_struct_id => NULL --IN NUMBER
      ,p_inv_install => cn_inv_application_id --IN NUMBER
      ,p_master_org_id => cn_master_inv_org_id --IN MTL_SYSTEM_ITEMS.ORGANIZATION_ID%TYPE
      ,p_category_set_id => NULL --IN NUMBER
      ,p_item_category_id => NULL --IN NUMBER
      ,p_event => 'INSERT'
      ,x_row_id => lv_rowid --OUT ROWID
      ,p_default_move_order_sub_inv => '' --IN VARCHAR2
      ,p_default_receiving_sub_inv => '' --IN VARCHAR2
      ,p_default_shipping_sub_inv => '' --IN VARCHAR2
      );

      Thanks in advance for your help


      If I use

      EGO_ITEM_PUB.Process_Items
      I can use the template

      but when I use EGO_ITEM_PUB.Assign_Item_To_Org to assign the item
      the DFF value from the master are copy in the DDF on the org level.
      I don't have the same DFF on master level and org level

      How can I create item on master level and assign those items to org level without the DFF from the master level

      thanks for your help

      Edited by: user12010732 on 28 mars 2012 05:13
        • 1. Re: How import items with the API  INV_ITEM_PVT.create_item and template item
          Sandeep Gandhi, Consultant
          I would avoid using the API INV_ITEM_PVT. As the name suggests, the _PVT routines are used by Oracle.
          We should use the _PUB routines as much as possible.

          You can always create the org assignment and then make the flexfield values as null.

          Or
          instead of using the assignment pub, you can use process_items_pub for org item creation and make the flexfield values =null in the Item_Tbl_Type record.

          Sandeep Gandhi
          • 3. Re: How import items with the API  INV_ITEM_PVT.create_item and template item
            user12010732
            I wanted to use the second solution but in fact, if the DFF has a value on the master, If I put null in the Item_Tbl_Type record , the value from the master is used on the org level , if I put another value in the Item_Tbl_Type record , the new value was used.


            This API seems to use the interface program and follows this rule :
            ++Item DFF attribute is always controlled at the org level, so each org can have different values for it. However, if the value is not specified for the child org, then Oracle defaults the value from the master++
            ++org.++

            ++Example 1:++

            ++Populate mtl_system_items_interface with a master org value for the DFF. Do NOT populate child org with any value for the DFF. The DFF in the child org will get populated with the same value as in master org.++

            ++Example 2:++

            ++Populate mtl_system_items_interface with a master org value for the DFF.++
            ++Populate the child org record with a value for the DFF which is different from that defined in the master org. The DFF in the child org will keep the value populated in the child record.++


            So finally I mixed the both solutions :
            use process_items_pub for org item creation
            and update the DFF after.

            Thanks again

            Regards