We can use APPS.HR_LOCATION_API.CREATE_LOCATION API to create a Locations on Purchasing by passing the appropriate parameters to it.
APPS.MO_GLOBAL.INIT ('PO');
APPS.MO_GLOBAL.SET_POLICY_CONTEXT ('S', 204);
APPS.FND_GLOBAL.APPS_INITIALIZE ( USER_ID => 1318, RESP_ID => 50578, RESP_APPL_ID => 201 );
APPS.HR_LOCATION_API.CREATE_LOCATION
( P_VALIDATE => NULL
,p_effective_date => SYSDATE
,P_LANGUAGE_CODE => NULL
,P_LOCATION_CODE => 'Pune' -- location name
,p_description => 'Pune as Pune' -- location description
,p_timezone_code => NULL
,p_tp_header_id => NULL
,P_ECE_TP_LOCATION_CODE => NULL
,P_ADDRESS_LINE_1 => 'Pimpiri'
,p_address_line_2 => NULL
,P_ADDRESS_LINE_3 => NULL
-- ,P_BILL_TO_SITE_FLAG => NULL
,p_country => 'IN'
,P_DESIGNATED_RECEIVER_ID => NULL
-- ,p_in_organization_flag => NULL
,P_INACTIVE_DATE => NULL
,p_operating_unit_id => NULL
,P_INVENTORY_ORGANIZATION_ID => NULL
-- ,p_office_site_flag => NULL
,P_POSTAL_CODE => NULL
-- ,p_receiving_site_flag => NULL
,P_REGION_1 => NULL
,P_REGION_2 => NULL
,P_REGION_3 => NULL
,P_SHIP_TO_LOCATION_ID => NULL
-- ,P_SHIP_TO_SITE_FLAG => NULL
,p_style => 'IN' -- US_GLB etc
,p_tax_name => NULL
,p_telephone_number_1 => NULL
,p_telephone_number_2 => NULL
,p_telephone_number_3 => NULL
,p_town_or_city => NULL
,p_loc_information13 => NULL
,P_LOC_INFORMATION14 => NULL
,p_loc_information15 => 'Pune'
,p_loc_information16 => NULL
,p_loc_information17 => NULL
,p_loc_information18 => NULL
,p_loc_information19 => NULL
,p_loc_information20 => NULL
,p_attribute_category => NULL
,p_attribute1 => NULL
,p_attribute2 => NULL
,p_attribute3 => NULL
,p_attribute4 => NULL
,p_attribute5 => NULL
,p_attribute6 => NULL
,p_attribute7 => NULL
,p_attribute8 => NULL
,p_attribute9 => NULL
,p_attribute10 => NULL
,p_attribute11 => NULL
,p_attribute12 => NULL
,p_attribute13 => NULL
,p_attribute14 => NULL
,p_attribute15 => NULL
,p_attribute16 => NULL
,p_attribute17 => NULL
,p_attribute18 => NULL
,p_attribute19 => NULL
,p_attribute20 => NULL
,p_global_attribute_category=> NULL
,p_global_attribute1 => NULL
,p_global_attribute2 => NULL
,p_global_attribute3 => NULL
,p_global_attribute4 => NULL
,p_global_attribute5 => NULL
,p_global_attribute6 => NULL
,p_global_attribute7 => NULL
,p_global_attribute8 => NULL
,p_global_attribute9 => NULL
,p_global_attribute10 => NULL
,p_global_attribute11 => NULL
,p_global_attribute12 => NULL
,p_global_attribute13 => NULL
,p_global_attribute14 => NULL
,p_global_attribute15 => NULL
,p_global_attribute16 => NULL
,p_global_attribute17 => NULL
,p_global_attribute18 => NULL
,p_global_attribute19 => NULL
,p_global_attribute20 => NULL
,P_BUSINESS_GROUP_ID => NULL
,P_LOCATION_ID => X_LOCATION_ID -- gives the location id as output parameter
,P_OBJECT_VERSION_NUMBER => X_OBJECT_VERSION_NUMBER
);
APPS.MO_GLOBAL.INIT ('PO');
APPS.MO_GLOBAL.SET_POLICY_CONTEXT ('S', 204);
APPS.FND_GLOBAL.APPS_INITIALIZE ( USER_ID => 1318, RESP_ID => 50578, RESP_APPL_ID => 201 );
APPS.HR_LOCATION_API.CREATE_LOCATION
( P_VALIDATE => NULL
,p_effective_date => SYSDATE
,P_LANGUAGE_CODE => NULL
,P_LOCATION_CODE => 'Pune' -- location name
,p_description => 'Pune as Pune' -- location description
,p_timezone_code => NULL
,p_tp_header_id => NULL
,P_ECE_TP_LOCATION_CODE => NULL
,P_ADDRESS_LINE_1 => 'Pimpiri'
,p_address_line_2 => NULL
,P_ADDRESS_LINE_3 => NULL
-- ,P_BILL_TO_SITE_FLAG => NULL
,p_country => 'IN'
,P_DESIGNATED_RECEIVER_ID => NULL
-- ,p_in_organization_flag => NULL
,P_INACTIVE_DATE => NULL
,p_operating_unit_id => NULL
,P_INVENTORY_ORGANIZATION_ID => NULL
-- ,p_office_site_flag => NULL
,P_POSTAL_CODE => NULL
-- ,p_receiving_site_flag => NULL
,P_REGION_1 => NULL
,P_REGION_2 => NULL
,P_REGION_3 => NULL
,P_SHIP_TO_LOCATION_ID => NULL
-- ,P_SHIP_TO_SITE_FLAG => NULL
,p_style => 'IN' -- US_GLB etc
,p_tax_name => NULL
,p_telephone_number_1 => NULL
,p_telephone_number_2 => NULL
,p_telephone_number_3 => NULL
,p_town_or_city => NULL
,p_loc_information13 => NULL
,P_LOC_INFORMATION14 => NULL
,p_loc_information15 => 'Pune'
,p_loc_information16 => NULL
,p_loc_information17 => NULL
,p_loc_information18 => NULL
,p_loc_information19 => NULL
,p_loc_information20 => NULL
,p_attribute_category => NULL
,p_attribute1 => NULL
,p_attribute2 => NULL
,p_attribute3 => NULL
,p_attribute4 => NULL
,p_attribute5 => NULL
,p_attribute6 => NULL
,p_attribute7 => NULL
,p_attribute8 => NULL
,p_attribute9 => NULL
,p_attribute10 => NULL
,p_attribute11 => NULL
,p_attribute12 => NULL
,p_attribute13 => NULL
,p_attribute14 => NULL
,p_attribute15 => NULL
,p_attribute16 => NULL
,p_attribute17 => NULL
,p_attribute18 => NULL
,p_attribute19 => NULL
,p_attribute20 => NULL
,p_global_attribute_category=> NULL
,p_global_attribute1 => NULL
,p_global_attribute2 => NULL
,p_global_attribute3 => NULL
,p_global_attribute4 => NULL
,p_global_attribute5 => NULL
,p_global_attribute6 => NULL
,p_global_attribute7 => NULL
,p_global_attribute8 => NULL
,p_global_attribute9 => NULL
,p_global_attribute10 => NULL
,p_global_attribute11 => NULL
,p_global_attribute12 => NULL
,p_global_attribute13 => NULL
,p_global_attribute14 => NULL
,p_global_attribute15 => NULL
,p_global_attribute16 => NULL
,p_global_attribute17 => NULL
,p_global_attribute18 => NULL
,p_global_attribute19 => NULL
,p_global_attribute20 => NULL
,P_BUSINESS_GROUP_ID => NULL
,P_LOCATION_ID => X_LOCATION_ID -- gives the location id as output parameter
,P_OBJECT_VERSION_NUMBER => X_OBJECT_VERSION_NUMBER
);
No comments:
Post a Comment