File name: coresvc_wh_adds/b.pls

Function Level Description – ADD_WH

Function: ADD_WH
           (O_error_message          IN OUT  RTK_ERRORS.RTK_TEXT%TYPE,
            I_rms_async_id           IN      RMS_ASYNC_STATUS.RMS_ASYNC_ID%TYPE)

This function contains the core logic for adding a new warehouse to Merchandising. The process of adding a warehouse to Merchandising starts with the warehse.fmb form. When a user creates a new WH using the form, an entry is created in the WH and WH_ADD tables. Also, entries are made into RMS_ASYNC_STATUS with status as ‘new’ and RMS_ASYNC_RETRY tables with a new RMS_ASYNC_ID. The RMS_ASYNC_ID is placed in the queue for processing. The de-queue process picks the RMS_ASYNC_ID generated and, based on the JOB_TYPE (WH_ADD), calls the CORESVC_WH_ADD_SQL.ADD_WH for further processing. As part of warehouse creation process, RPM tables will also be updated by a call to PM_NOTIFY_API_SQL.NEW_LOCATION, which creates pricing records. The materialized views are refreshed as well. After completion of the process, it deletes the record from the WH_ADD table.

On successful creation of the WH, the user is prompted with a message saying the RMS_ASYNC_ID is processed successfully. In case if there is failure during the WH creation then the user is likewise notified. The user can use the Asynchronous Job log form to view and reprocess the failed WH. By clicking reprocess in the Asynchronous Job log form, an entry is made into the RMS_ASYNC_RETRY table. The RMS_ASYNC_ID is then placed in the queue again for processing.