4 Replies Latest reply on Nov 6, 2009 4:54 PM by user532091

    Creation of serial numbers


      We have a requirement where we have need to create a speicifc serial number.
      Meaning, if ther serial number mentioned is not defined in the system for that item,org combination then create it in the mtl_serial_numbers table

      We are using the below api

      x_retcode -- OUT NOCOPY VARCHAR2
      , x_errbuf -- OUT NOCOPY VARCHAR2
      , 5 -- p_org_id IN NUMBER
      , 187403 --p_item_id       IN            NUMBER
      , 1 --p_qty           IN            NUMBER
      , 4 --p_serial_code   IN            VARCHAR2
      , 1345 --p_wip_id        IN            NUMBER
      , 00 --p_rev           IN            NUMBER
      , 0 --p_lot           IN            NUMBER
      , Null --p_group_mark_id IN            NUMBER DEFAULT NULL
      , Null --p_line_mark_id  IN            NUMBER DEFAULT NULL

      But we can pass the serial number any where. It generates based on the oraginsation parameters setting.
      Can we some how create for a specific serial number which we need to pass. Do we have any API for that.

      Also wanted to know about this serial code. is this the serial control code in mtl_sytem_items

      Thanks in advance
        • 1. Re: Creation of serial numbers
          Use user_pkg_serial. Write you code in there to generate your serial number and return it.

          • 2. Re: Creation of serial numbers
            Even this does not have the serial number as the input parameter.
            i have say '9999999' as the serial number i need to create for Item#1234 for Org id 4

            Can i pass the serial# with the item and org data to any APIs to create the serial #
            • 3. Re: Creation of serial numbers
              You have to assign 9999999 to x_serial_number (out parameter). And pass your organization_id and inventory_item_id to p_org_id and p_item_id.

              System will generate 9999999 for you as your serial number. It is not in parameter but it is OUT. You need to write your logic here. You cannot keep using 9999999 always.

              • 4. Re: Creation of serial numbers
                But i was checkign the package
                This does not do anything...

                procedure generate_serial_number(x_return_status OUT NOCOPY VARCHAR2
                ,x_msg_data OUT NOCOPY VARCHAR2
                ,x_msg_count OUT NOCOPY NUMBER
                ,x_serial_number OUT NOCOPY VARCHAR2
                ,p_org_id IN NUMBER
                ,p_item_id IN NUMBER)


                WHEN OTHERS THEN
                x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
                x_serial_number := NULL;
                IF fnd_msg_pub.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
                END IF;
                END generate_serial_number;

                END user_pkg_serial;