Wednesday, October 14, 2015

Create, Update Organization API



This blog describes the technical information required for creating Inventory organization and their classification using API.In order to create Inventory organization we can use three API which are
    Apps.hr_organization_api.create_organization
    Apps.hr_organization_api.update_organization
    Apps.hr_organization_api.create_org_classification


apps.hr_organization_api.create_organization
                     (p_validate                    => NULL,
                      p_effective_date              => sysdate,
                      p_language_code               => apps.hr_api.userenv_lang,
                      p_business_group_id           => ln_business_group_id,
                      p_date_from                   => sysdate,
                      p_name                        => l_organization_name,
                      p_location_id                 => NULL,
                      p_date_to                     => sysdate,
                      p_internal_external_flag      => NULL,
                      p_internal_address_line       => NULL,
                      p_type                        => NULL,
                      p_comments                    => NULL,
                      p_attribute_category          => NULL,
                      p_attribute1                  => NULL
                      p_organization_id             => l_organization_id,
                      p_object_version_number       => l_object_version_number
                      );
              
hr_organization_api.update_organization
                   (p_validate                        => NULL,
                    p_effective_date                  => sysdate,
                    p_language_code                   => hr_api.userenv_lang    ,
                    p_name                            => l_organization_name,
                    p_organization_id                 => l_organization_id,
                    p_cost_allocation_keyflex_id      => hr_api.g_number,
                    p_location_id                     => ln_location_id,
                    p_date_from                       => hr_api.g_date,
                    p_date_to                         => hr_api.g_date,
                    p_internal_external_flag          => 'INT',
                    p_internal_address_line           => hr_api.g_varchar2,
                    p_comments                        => hr_api.g_varchar2,
                    p_attribute_category              => hr_api.g_varchar2,
                    p_attribute1                      => hr_api.g_varchar2,
                    p_attribute30                     => hr_api.g_varchar2,
                    p_segment1                        => hr_api.g_varchar2,
                    p_segment30                       => hr_api.g_varchar2,
                    p_concat_segments                 => hr_api.g_varchar2,
                    p_object_version_number           => l_object_version_number,
                    p_duplicate_org_warning           => l_duplicate_org_warning
                   );

apps.hr_organization_api.create_org_classification
                         (p_validate                   => NULL,
                          p_effective_date             => sysdate,
                          p_organization_id            => l_organization_id,
                          p_org_classif_code           =>l_org_information1,
                          p_org_information_id         => l_org_information_id,
                          p_object_version_number      => l_object_version_number
                           );

 


--Dhiraj Jha

1 comment: