Today we’ll demonstrate how to update EAM asset number using API EAM_AssetNumber_PUB.Update_Asset_Number :
API to update EAM Asset Numbers.
Now First of all this The table below provides the specifications for this API:
Parameter | Type | Req | Default | Description |
---|---|---|---|---|
p_api_version | NUMBER | Yes | – | Standard API parameter |
p_init_msg_list | VARCHAR2 | – | FND_API.G_FALSE | Standard API parameter |
p_commit | VARCHAR2 | – | FND_API.G_FALSE | Standard API parameter |
p_validation_level | NUMBER | – | FND_API.G_VALID_LEVEL_FULL | Standard API parameter |
x_return_status | VARCHAR2 | – | – | Standard API output parameter |
x_msg_count | NUMBER | – | – | Standard API output parameter |
x_msg_data | VARCHAR2 | – | – | Standard Oracle API output parameter |
p_inventory_item_id | NUMBER | Yes | – | Inventory Item ID |
p_serial_number | VARCHAR2 | Yes | – | Serial Number |
p_current_status | NUMBER | – | 3 | Current Status 3 – activated 4 – deactivated |
p_descriptive_text | VARCHAR2 | – | NULL | Description |
p_current_organization_id | NUMBER | Yes | – | Current Organization ID |
p_attribute_category | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute1 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute2 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute3 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute4 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute5 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute6 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute7 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute8 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute9 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute10 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute11 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute12 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute13 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute14 | VARCHAR2 | – | – | Descriptive Flexfield |
p_attribute15 | VARCHAR2 | – | – | Descriptive Flexfield |
p_wip_accounting_class_code | VARCHAR2 | – | NULL | WIP Accounting Class Code |
p_maintainable_flag | VARCHAR2 | – | NULL | Maintainable Flag: Y, N, or Null |
p_owning_department_id | NUMBER | Yes | – | Owning Department ID |
p_network_asset_flag | VARCHAR2 | – | NULL | Network Asset Flag: Y, N, or Null |
p_fa_asset_id | NUMBER | – | NULL | Fixed Asset ID |
p_pn_location_id | NUMBER | – | NULL | PN Location ID |
p_eam_location_id | NUMBER | – | NULL | EAM Location ID |
p_asset_criticality_code | VARCHAR2 | – | NULL | Asset Criticality Code |
p_category_id | NUMBER | – | NULL | Category ID |
p_prod_organization_id | NUMBER | – | NULL | Production Organization ID |
p_equipment_item_id | NUMBER | – | NULL | Equipment Item ID |
p_eqp_serial_number | VARCHAR2 | – | NULL | Equipment Serial Number |
And this the form we want to update :
Now this the API we are using to do this task : EAM_AssetNumber_PUB.Update_Asset_Number
And this the example to updating Asset Number Field in (Others) Tab in this form or anything else except Asset Serial Number this the only field wouldn’t updated by API as mentioned by ORACLE :
“The API EAM_AssetNumber_PUB.Update_Asset_Number cannot update the Asset Serial Number as seen in the Asset Number Definition form. This is the intended behavior of the API.” Reference : Doc ID 1362277.1
DECLARE o_return_status VARCHAR2 (32767); o_msg_count NUMBER; o_msg_data VARCHAR2 (32767); l_output_mesg VARCHAR2 (32767); BEGIN apps.eam_assetnumber_pub.update_asset_number (p_api_version => 1.0 ,x_return_status => o_return_status ,x_msg_count => o_msg_count ,x_msg_data => o_msg_data ,p_inventory_item_id => 11017 ,p_serial_number => 'Compressor' ,p_instance_number => 'Compressor' ,p_instance_id => 1768487 -- MAINTENANCE_OBJECT_ID in the form ,p_current_organization_id => 1645 ,p_owning_department_id => 708 ,p_fa_asset_id => 100075); IF (o_return_status = 'S') THEN -- COMMIT; l_output_mesg := 'EAM Asset Updated Successfully with return status : ' || ' ' || o_return_status; dbms_output.put_line (l_output_mesg); -- ELSE -- FOR i IN 1 .. (o_msg_count) LOOP l_output_mesg := substr (fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false), 1, 250); dbms_output.put_line (l_mesg); END LOOP; -- END IF; EXCEPTION WHEN OTHERS THEN dbms_output.put_line ('API Faild with error code: ' || sqlcode || ' and error message is: ' || sqlerrm); END;
This is the End
Hope this help.
1 Comment