Pages

06 December 2012

PL/SQL Script To Create Asset Numbers In Oracle EAM R12


Sample Script :-

set serveroutput on
declare
g_Return_Status VARCHAR2(1000);
g_Msg_Count NUMBER;
g_Msg_Data VARCHAR2(1000);
g_Object_Id NUMBER;

begin

fnd_global.apps_initialize (user_id => 1318,resp_id => 23118,resp_appl_id => 426);

EAM_ASSETNUMBER_PUB.Insert_Asset_Number
(  p_api_version => 1.0,
   p_init_msg_list => FND_API.G_FALSE,
 p_commit => FND_API.G_FALSE,
 p_validation_level => FND_API.G_VALID_LEVEL_FULL,
 x_return_status => g_Return_Status,
 x_msg_count => g_Msg_Count,
 x_msg_data => g_Msg_Data,
 x_object_id => g_Object_Id,
 p_INVENTORY_ITEM_ID => 7891,
 p_SERIAL_NUMBER => 'VEH99',
 p_INSTANCE_NUMBER => NULL,
 p_CURRENT_STATUS => 4,
 p_DESCRIPTIVE_TEXT => NULL,
 p_CURRENT_ORGANIZATION_ID => 4812,
 p_ATTRIBUTE_CATEGORY => NULL,
    p_WIP_ACCOUNTING_CLASS_CODE => NULL,
    p_MAINTAINABLE_FLAG
   => NULL,
    p_OWNING_DEPARTMENT_ID => NULL,
    p_NETWORK_ASSET_FLAG => NULL,
    p_FA_ASSET_ID => NULL,
    p_PN_LOCATION_ID => NULL,
    p_EAM_LOCATION_ID => NULL,
    p_ASSET_CRITICALITY_CODE => NULL,
    p_CATEGORY_ID => NULL,
    p_PROD_ORGANIZATION_ID => NULL,
    p_EQUIPMENT_ITEM_ID    => NULL,
    p_EQP_SERIAL_NUMBER    => NULL,
    p_EQUIPMENT_GEN_OBJECT_ID => NULL,
    p_instantiate_flag => TRUE,
    p_eam_linear_id    => NULL
    ,p_active_start_date => sysdate
    ,p_active_end_date => sysdate
    ,p_location    =>  NULL
    ,p_operational_log_flag    =>NULL
    ,p_checkin_status => NULL
    ,p_supplier_warranty_exp_date => NULL
);
commit;
dbms_output.put_line('Asset Number Status'|| g_Return_Status);
dbms_output.put_line('Error Message'||g_Msg_Data );
dbms_output.put_line('Message'||g_Msg_Count );
END;
/

No comments:

Post a Comment