Deactivate Suppliers/Vendors in Oracle Apps using API

Deactivate Suppliers/Vendors in Oracle Apps using API

--www.askhareesh.com

DECLARE
   LV_RETURN_STATUS   VARCHAR2 (1) := NULL;
   LV_MSG_COUNT       NUMBER := 0;
   LV_MSG_DATA        VARCHAR2 (2000) := NULL;
   LV_VENDOR_REC      AP_VENDOR_PUB_PKG.R_VENDOR_REC_TYPE;
BEGIN
   LV_VENDOR_REC.END_DATE_ACTIVE := SYSDATE;                        --End Date
   AP_VENDOR_PUB_PKG.UPDATE_VENDOR (
      P_API_VERSION        => 1.0,
      P_INIT_MSG_LIST      => FND_API.G_TRUE,
      P_COMMIT             => FND_API.G_FALSE,
      P_VALIDATION_LEVEL   => FND_API.G_VALID_LEVEL_FULL,
      X_RETURN_STATUS      => LV_RETURN_STATUS,
      X_MSG_COUNT          => LV_MSG_COUNT,
      X_MSG_DATA           => LV_MSG_DATA,
      P_VENDOR_REC         => LV_VENDOR_REC,
      P_VENDOR_ID          => 33164                                --Vendor id
                                   );

   BEGIN
      IF NVL (LV_RETURN_STATUS, 'XX') = 'S'
      THEN
         DBMS_OUTPUT.PUT_LINE ('Vendor deactivated successfully');
      ELSE
         DBMS_OUTPUT.PUT_LINE (
               'Error while deactivating the supplier, Msg Count'
            || LV_MSG_COUNT
            || ', Error : '
            || LV_MSG_DATA);
      END IF;
   END;

   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.PUT_LINE (
         'Exception while deactivating supplier : ' || SQLERRM);
END;

*/

No comments:

Post a Comment