561: , overhead_account
562: , outside_processing_account
563: , expense_account
564: , encumbrance_account
565: from mtl_parameters
566: where (
567: default_cost_group_id is null and
568: organization_id = l_organization_id
569: );
593: l_procedure_name VARCHAR2(200):= 'upgrade subinventory data INVMPSB';
594:
595: begin
596:
597: l_table_name := 'mtl_parameters';
598:
599: for c1 in org_cursor
600: loop
601: ---/*
700: -- ** Stamp default cost group on org record
701:
702: -- dbms_output.put_line('before insert ');
703: -- dbms_output.put_line('cost gr is is' || To_char(l_cost_group_id) );
704: update mtl_parameters
705: set default_cost_group_id = l_cost_group_id
706: where organization_id = l_organization_id;
707: -- dbms_output.put_line('after insert');
708: end loop;
730: p_org_id => l_organization_id,
731: p_error_msg => Substr(l_msg_data,1,240),
732: p_proc_name => l_procedure_name);
733:
734: -- l_return_err := 'mtl_parameters default cost group upgrade:'|| l_msg_data;
735:
736: raise_application_error(-20000,l_return_err);
737:
738: when fnd_api.g_exc_unexpected_error THEN
751: );
752:
753: l_msg_data := replace(l_msg_data,chr(0),' ');
754:
755: -- l_return_err := 'mtl_parameters default cost group upgrade:'||l_msg_data;
756:
757: INS_ERROR( p_table_name => l_table_name,
758: p_ROWID => l_rowid_info,
759: p_org_id => l_organization_id,
767:
768: IF(org_cursor%isopen) THEN CLOSE org_cursor; END IF;
769:
770: x_return_status := fnd_api.g_ret_sts_error ;
771: -- l_return_err := 'mtl_parameters default cost group upgrade:'||
772: -- substrb(sqlerrm,1,55);
773:
774:
775: INS_ERROR( p_table_name => l_table_name,
801: -- ** --------------------------------------------------------
802: -- */
803: -- cursor mp_cursor is
804: -- select organization_id
805: -- from mtl_parameters;
806:
807: -- /*
808: -- ** --------------------------------------------------------
809: -- ** On hand records that do not have a default cost group yet
913: if (v_project_id > 0) THEN
914: -- should come here only if it is a project enabled org
915: IF ( l_cost_method IS NULL ) THEN
916: SELECT NVL(primary_cost_method,1) INTO l_cost_method
917: FROM mtl_parameters WHERE
918: organization_id = l_organization_id ;
919: END IF;
920: IF ( l_cost_method = 2 ) THEN /*average costing org */
921: begin
947:
948: else
949: IF ( l_cost_method IS NULL ) THEN
950: SELECT NVL(primary_cost_method,1) INTO l_cost_method
951: FROM mtl_parameters WHERE
952: organization_id = l_organization_id ;
953: END IF;
954: IF ( l_cost_method = 2 ) THEN /*average costing org */
955: IF ( l_org_cost_group_id IS NULL ) then
954: IF ( l_cost_method = 2 ) THEN /*average costing org */
955: IF ( l_org_cost_group_id IS NULL ) then
956: select nvl(default_cost_group_id,0)
957: into l_org_cost_group_id
958: from mtl_parameters
959: where organization_id = l_organization_id;
960: l_cost_group_id := l_org_cost_group_id ;
961: ELSE
962: l_cost_group_id := l_org_cost_group_id ;
1080: -- ** --------------------------------------------------------
1081: -- */
1082: -- cursor mp_cursor is
1083: -- select organization_id
1084: -- from mtl_parameters;
1085:
1086: -- /*
1087: -- ** --------------------------------------------------------
1088: -- ** Transaction records that do not have a default cost group yet
1442: return_status VARCHAR2(1);
1443: msg_count NUMBER;
1444: msg_data VARCHAR2(240);
1445: cursor oid_cursor is select organization_id
1446: from mtl_parameters ;
1447:
1448: BEGIN
1449:
1450: