769: END IF;
770: end loop;
771: else
772: x_Return_Status := 1;
773: fnd_message.set_name('EGO','EGO_DUP_ICC_COMPONENTS_REL');
774: x_Error_Message := fnd_message.get;
775: end if;
776: end if;
777: EXCEPTION
770: end loop;
771: else
772: x_Return_Status := 1;
773: fnd_message.set_name('EGO','EGO_DUP_ICC_COMPONENTS_REL');
774: x_Error_Message := fnd_message.get;
775: end if;
776: end if;
777: EXCEPTION
778: WHEN others THEN
1631: when others then
1632: G_COMP_ITEM_NAME := null;
1633: G_EFF_FROM := null;
1634: end;
1635: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1636: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1637: fnd_message.set_token('ALTCODE', p_alt_desg);
1638: fnd_message.set_token('EFFECTIVE_FROM', G_EFF_FROM);
1639: x_error_msg := substr(x_error_msg||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1632: G_COMP_ITEM_NAME := null;
1633: G_EFF_FROM := null;
1634: end;
1635: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1636: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1637: fnd_message.set_token('ALTCODE', p_alt_desg);
1638: fnd_message.set_token('EFFECTIVE_FROM', G_EFF_FROM);
1639: x_error_msg := substr(x_error_msg||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1640: --return l_count;
1633: G_EFF_FROM := null;
1634: end;
1635: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1636: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1637: fnd_message.set_token('ALTCODE', p_alt_desg);
1638: fnd_message.set_token('EFFECTIVE_FROM', G_EFF_FROM);
1639: x_error_msg := substr(x_error_msg||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1640: --return l_count;
1641: end if;
1634: end;
1635: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1636: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1637: fnd_message.set_token('ALTCODE', p_alt_desg);
1638: fnd_message.set_token('EFFECTIVE_FROM', G_EFF_FROM);
1639: x_error_msg := substr(x_error_msg||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1640: --return l_count;
1641: end if;
1642:
1635: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1636: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1637: fnd_message.set_token('ALTCODE', p_alt_desg);
1638: fnd_message.set_token('EFFECTIVE_FROM', G_EFF_FROM);
1639: x_error_msg := substr(x_error_msg||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1640: --return l_count;
1641: end if;
1642:
1643: end loop;
1842: l_stmt_no := 130;
1843: for component in get_all_icc_components(l_catalog_group_id,v_item_revisions_tbl(rev_count).start_date) loop
1844: If(component.component_item_id = p_inventory_item_id) then
1845: x_Return_Status := 1;
1846: fnd_message.set_name('EGO','EGO_ASSY_AS_INH_COMP');
1847: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1848: --Return;
1849: End If;
1850: l_stmt_no := 140;
1843: for component in get_all_icc_components(l_catalog_group_id,v_item_revisions_tbl(rev_count).start_date) loop
1844: If(component.component_item_id = p_inventory_item_id) then
1845: x_Return_Status := 1;
1846: fnd_message.set_name('EGO','EGO_ASSY_AS_INH_COMP');
1847: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1848: --Return;
1849: End If;
1850: l_stmt_no := 140;
1851: select concatenated_segments into G_COMP_ITEM_NAME
1854: l_stmt_no := 150;
1855: if v_icc_comp_tbl.exists(component.component_item_id) then
1856: x_Return_Status := 1;
1857:
1858: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1859: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1860: fnd_message.set_token('ALTCODE', p_alt_desg);
1861: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(rev_count).revision);
1862: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1855: if v_icc_comp_tbl.exists(component.component_item_id) then
1856: x_Return_Status := 1;
1857:
1858: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1859: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1860: fnd_message.set_token('ALTCODE', p_alt_desg);
1861: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(rev_count).revision);
1862: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1863: --Return;
1856: x_Return_Status := 1;
1857:
1858: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1859: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1860: fnd_message.set_token('ALTCODE', p_alt_desg);
1861: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(rev_count).revision);
1862: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1863: --Return;
1864: end if;
1857:
1858: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1859: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1860: fnd_message.set_token('ALTCODE', p_alt_desg);
1861: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(rev_count).revision);
1862: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1863: --Return;
1864: end if;
1865: l_stmt_no := 160;
1858: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
1859: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1860: fnd_message.set_token('ALTCODE', p_alt_desg);
1861: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(rev_count).revision);
1862: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1863: --Return;
1864: end if;
1865: l_stmt_no := 160;
1866: -- Added for Bom Item type validation for inherited components.
1895: null;
1896: else
1897: x_Return_Status := 1;
1898: l_stmt_no := 170;
1899: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
1900: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1901: fnd_message.set_token('ALTCODE', p_alt_desg);
1902: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1903: --Return;
1896: else
1897: x_Return_Status := 1;
1898: l_stmt_no := 170;
1899: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
1900: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1901: fnd_message.set_token('ALTCODE', p_alt_desg);
1902: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1903: --Return;
1904: end if;
1897: x_Return_Status := 1;
1898: l_stmt_no := 170;
1899: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
1900: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1901: fnd_message.set_token('ALTCODE', p_alt_desg);
1902: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1903: --Return;
1904: end if;
1905: l_stmt_no := 180;
1898: l_stmt_no := 170;
1899: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
1900: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
1901: fnd_message.set_token('ALTCODE', p_alt_desg);
1902: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1903: --Return;
1904: end if;
1905: l_stmt_no := 180;
1906: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
1903: --Return;
1904: end if;
1905: l_stmt_no := 180;
1906: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
1907: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
1908: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1909: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1910: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1911: x_Return_Status := 1;
1904: end if;
1905: l_stmt_no := 180;
1906: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
1907: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
1908: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1909: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1910: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1911: x_Return_Status := 1;
1912: end if;
1905: l_stmt_no := 180;
1906: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
1907: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
1908: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1909: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1910: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1911: x_Return_Status := 1;
1912: end if;
1913: l_stmt_no := 190;
1906: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
1907: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
1908: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1909: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1910: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1911: x_Return_Status := 1;
1912: end if;
1913: l_stmt_no := 190;
1914: if l_assy_pick_components_flag = 'Y' and component.basis_type = 2 then
1911: x_Return_Status := 1;
1912: end if;
1913: l_stmt_no := 190;
1914: if l_assy_pick_components_flag = 'Y' and component.basis_type = 2 then
1915: fnd_message.set_name('BOM','BOM_LOT_BASED_PTO');
1916: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1917: x_Return_Status := 1;
1918: end if;
1919: l_stmt_no := 200;
1912: end if;
1913: l_stmt_no := 190;
1914: if l_assy_pick_components_flag = 'Y' and component.basis_type = 2 then
1915: fnd_message.set_name('BOM','BOM_LOT_BASED_PTO');
1916: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1917: x_Return_Status := 1;
1918: end if;
1919: l_stmt_no := 200;
1920: IF component.PLANNING_FACTOR <> 100 THEN
1918: end if;
1919: l_stmt_no := 200;
1920: IF component.PLANNING_FACTOR <> 100 THEN
1921: IF l_assy_bom_item_type = 4 THEN
1922: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
1923: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1924: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1925: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1926: x_Return_Status := 1;
1919: l_stmt_no := 200;
1920: IF component.PLANNING_FACTOR <> 100 THEN
1921: IF l_assy_bom_item_type = 4 THEN
1922: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
1923: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1924: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1925: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1926: x_Return_Status := 1;
1927: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
1920: IF component.PLANNING_FACTOR <> 100 THEN
1921: IF l_assy_bom_item_type = 4 THEN
1922: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
1923: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1924: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1925: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1926: x_Return_Status := 1;
1927: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
1928: component.ato_forecast_control <> 2 ) THEN
1921: IF l_assy_bom_item_type = 4 THEN
1922: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
1923: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1924: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1925: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1926: x_Return_Status := 1;
1927: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
1928: component.ato_forecast_control <> 2 ) THEN
1929: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
1925: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1926: x_Return_Status := 1;
1927: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
1928: component.ato_forecast_control <> 2 ) THEN
1929: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
1930: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1931: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1932: x_Return_Status := 1;
1933: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
1926: x_Return_Status := 1;
1927: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
1928: component.ato_forecast_control <> 2 ) THEN
1929: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
1930: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1931: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1932: x_Return_Status := 1;
1933: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
1934: component.ato_forecast_control <> 2 )) THEN
1927: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
1928: component.ato_forecast_control <> 2 ) THEN
1929: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
1930: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1931: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1932: x_Return_Status := 1;
1933: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
1934: component.ato_forecast_control <> 2 )) THEN
1935: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
1931: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1932: x_Return_Status := 1;
1933: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
1934: component.ato_forecast_control <> 2 )) THEN
1935: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
1936: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1937: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1938: x_Return_Status := 1;
1939: END IF;
1932: x_Return_Status := 1;
1933: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
1934: component.ato_forecast_control <> 2 )) THEN
1935: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
1936: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1937: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1938: x_Return_Status := 1;
1939: END IF;
1940: END IF;
1933: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
1934: component.ato_forecast_control <> 2 )) THEN
1935: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
1936: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1937: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1938: x_Return_Status := 1;
1939: END IF;
1940: END IF;
1941: l_stmt_no := 210;
1941: l_stmt_no := 210;
1942: IF ( l_assy_pick_components_flag = 'Y' AND l_assy_bom_item_type IN ( 1, 2) AND
1943: component.replenish_to_order_flag = 'Y' AND component.bom_item_type = 4 AND
1944: NVL(component.base_item_id,0) = 0 AND component.OPTIONAL = 2 ) THEN
1945: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL');
1946: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1947: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1948: x_Return_Status := 1;
1949: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
1942: IF ( l_assy_pick_components_flag = 'Y' AND l_assy_bom_item_type IN ( 1, 2) AND
1943: component.replenish_to_order_flag = 'Y' AND component.bom_item_type = 4 AND
1944: NVL(component.base_item_id,0) = 0 AND component.OPTIONAL = 2 ) THEN
1945: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL');
1946: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1947: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1948: x_Return_Status := 1;
1949: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
1950: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
1943: component.replenish_to_order_flag = 'Y' AND component.bom_item_type = 4 AND
1944: NVL(component.base_item_id,0) = 0 AND component.OPTIONAL = 2 ) THEN
1945: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL');
1946: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1947: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1948: x_Return_Status := 1;
1949: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
1950: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
1951: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1946: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1947: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1948: x_Return_Status := 1;
1949: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
1950: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
1951: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1952: x_Return_Status := 1;
1953: END IF;
1954: l_stmt_no := 220;
1947: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1948: x_Return_Status := 1;
1949: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
1950: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
1951: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1952: x_Return_Status := 1;
1953: END IF;
1954: l_stmt_no := 220;
1955: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1952: x_Return_Status := 1;
1953: END IF;
1954: l_stmt_no := 220;
1955: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1956: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1957: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1958: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1959: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1960: x_Return_Status := 1;
1953: END IF;
1954: l_stmt_no := 220;
1955: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1956: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1957: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1958: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1959: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1960: x_Return_Status := 1;
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1954: l_stmt_no := 220;
1955: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1956: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1957: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1958: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1959: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1960: x_Return_Status := 1;
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1962: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1955: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1956: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1957: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1958: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1959: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1960: x_Return_Status := 1;
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1962: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1963: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1958: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1959: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1960: x_Return_Status := 1;
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1962: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1963: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1964: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1965: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1966: x_Return_Status := 1;
1959: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1960: x_Return_Status := 1;
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1962: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1963: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1964: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1965: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1966: x_Return_Status := 1;
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1960: x_Return_Status := 1;
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1962: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1963: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1964: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1965: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1966: x_Return_Status := 1;
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1961: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
1962: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1963: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1964: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1965: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1966: x_Return_Status := 1;
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1964: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1965: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1966: x_Return_Status := 1;
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1965: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1966: x_Return_Status := 1;
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1966: x_Return_Status := 1;
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1974: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1967: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1974: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1975: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1968: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1974: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1975: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1976: x_Return_Status := 1;
1969: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1974: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1975: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1976: x_Return_Status := 1;
1977: END IF;
1970: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1974: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1975: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1976: x_Return_Status := 1;
1977: END IF;
1978: l_stmt_no := 230;
1971: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1972: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
1973: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
1974: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
1975: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
1976: x_Return_Status := 1;
1977: END IF;
1978: l_stmt_no := 230;
1979: v_icc_comp_tbl(component.component_item_id).bill_sequence_id := component.bill_sequence_id;
2452: l_stmt_no := 120;
2453: for component in get_all_icc_components(l_catalog_group_id,l_catalog_str_type_id,G_ALTCODE) loop
2454: If(component.component_item_id = p_inventory_item_id) then
2455: x_Return_Status := 1;
2456: fnd_message.set_name('EGO','EGO_ASSY_AS_INH_COMP');
2457: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2458: --Return;
2459: End If;
2460: l_stmt_no := 130;
2453: for component in get_all_icc_components(l_catalog_group_id,l_catalog_str_type_id,G_ALTCODE) loop
2454: If(component.component_item_id = p_inventory_item_id) then
2455: x_Return_Status := 1;
2456: fnd_message.set_name('EGO','EGO_ASSY_AS_INH_COMP');
2457: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2458: --Return;
2459: End If;
2460: l_stmt_no := 130;
2461: select concatenated_segments into G_COMP_ITEM_NAME
2463: and organization_id = p_organization_id;
2464: l_stmt_no := 140;
2465: if v_icc_comp_tbl.exists(component.component_item_id) then
2466: x_Return_Status := 1;
2467: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
2468: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2469: fnd_message.set_token('ALTCODE', G_ALTCODE);
2470: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(v_rev_index(p_revision_id)).revision);
2471: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2464: l_stmt_no := 140;
2465: if v_icc_comp_tbl.exists(component.component_item_id) then
2466: x_Return_Status := 1;
2467: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
2468: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2469: fnd_message.set_token('ALTCODE', G_ALTCODE);
2470: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(v_rev_index(p_revision_id)).revision);
2471: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2472: end if;
2465: if v_icc_comp_tbl.exists(component.component_item_id) then
2466: x_Return_Status := 1;
2467: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
2468: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2469: fnd_message.set_token('ALTCODE', G_ALTCODE);
2470: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(v_rev_index(p_revision_id)).revision);
2471: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2472: end if;
2473: l_stmt_no := 150;
2466: x_Return_Status := 1;
2467: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
2468: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2469: fnd_message.set_token('ALTCODE', G_ALTCODE);
2470: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(v_rev_index(p_revision_id)).revision);
2471: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2472: end if;
2473: l_stmt_no := 150;
2474: -- Added for Bom Item type validation for inherited components.
2467: fnd_message.set_name('EGO','EGO_INHERIT_COMP_OVERLAP');
2468: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2469: fnd_message.set_token('ALTCODE', G_ALTCODE);
2470: fnd_message.set_token('EFFECTIVE_FROM', v_item_revisions_tbl(v_rev_index(p_revision_id)).revision);
2471: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2472: end if;
2473: l_stmt_no := 150;
2474: -- Added for Bom Item type validation for inherited components.
2475: if (
2502: ) then
2503: null;
2504: else
2505: x_Return_Status := 1;
2506: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
2507: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2508: fnd_message.set_token('ALTCODE', G_ALTCODE);
2509: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2510: --Return;
2503: null;
2504: else
2505: x_Return_Status := 1;
2506: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
2507: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2508: fnd_message.set_token('ALTCODE', G_ALTCODE);
2509: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2510: --Return;
2511: end if;
2504: else
2505: x_Return_Status := 1;
2506: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
2507: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2508: fnd_message.set_token('ALTCODE', G_ALTCODE);
2509: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2510: --Return;
2511: end if;
2512: l_stmt_no := 160;
2505: x_Return_Status := 1;
2506: fnd_message.set_name('EGO','EGO_INHERIT_COMP_ITEMTYPE');
2507: fnd_message.set_token('COMPONENT_ITEM_NAME', G_COMP_ITEM_NAME);
2508: fnd_message.set_token('ALTCODE', G_ALTCODE);
2509: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2510: --Return;
2511: end if;
2512: l_stmt_no := 160;
2513: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
2510: --Return;
2511: end if;
2512: l_stmt_no := 160;
2513: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
2514: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
2515: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2516: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2517: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2518: x_Return_Status := 1;
2511: end if;
2512: l_stmt_no := 160;
2513: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
2514: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
2515: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2516: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2517: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2518: x_Return_Status := 1;
2519: end if;
2512: l_stmt_no := 160;
2513: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
2514: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
2515: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2516: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2517: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2518: x_Return_Status := 1;
2519: end if;
2520: l_stmt_no := 170;
2513: if (component.component_yield_factor <> 1 and l_assy_bom_item_type = 3) then
2514: fnd_message.set_name('BOM','BOM_COMP_YIELD_NOT_ONE');
2515: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2516: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2517: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2518: x_Return_Status := 1;
2519: end if;
2520: l_stmt_no := 170;
2521: if l_assy_pick_components_flag = 'Y' and component.basis_type = 2 then
2518: x_Return_Status := 1;
2519: end if;
2520: l_stmt_no := 170;
2521: if l_assy_pick_components_flag = 'Y' and component.basis_type = 2 then
2522: fnd_message.set_name('BOM','BOM_LOT_BASED_PTO');
2523: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2524: x_Return_Status := 1;
2525: end if;
2526: l_stmt_no := 180;
2519: end if;
2520: l_stmt_no := 170;
2521: if l_assy_pick_components_flag = 'Y' and component.basis_type = 2 then
2522: fnd_message.set_name('BOM','BOM_LOT_BASED_PTO');
2523: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2524: x_Return_Status := 1;
2525: end if;
2526: l_stmt_no := 180;
2527: IF component.PLANNING_FACTOR <> 100 THEN
2525: end if;
2526: l_stmt_no := 180;
2527: IF component.PLANNING_FACTOR <> 100 THEN
2528: IF l_assy_bom_item_type = 4 THEN
2529: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
2530: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2531: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2532: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2533: x_Return_Status := 1;
2526: l_stmt_no := 180;
2527: IF component.PLANNING_FACTOR <> 100 THEN
2528: IF l_assy_bom_item_type = 4 THEN
2529: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
2530: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2531: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2532: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2533: x_Return_Status := 1;
2534: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
2527: IF component.PLANNING_FACTOR <> 100 THEN
2528: IF l_assy_bom_item_type = 4 THEN
2529: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
2530: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2531: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2532: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2533: x_Return_Status := 1;
2534: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
2535: component.ato_forecast_control <> 2 ) THEN
2528: IF l_assy_bom_item_type = 4 THEN
2529: fnd_message.set_name('BOM','BOM_NOT_A_PLANNING_PARENT');
2530: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2531: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2532: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2533: x_Return_Status := 1;
2534: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
2535: component.ato_forecast_control <> 2 ) THEN
2536: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
2532: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2533: x_Return_Status := 1;
2534: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
2535: component.ato_forecast_control <> 2 ) THEN
2536: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
2537: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2538: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2539: x_Return_Status := 1;
2540: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
2533: x_Return_Status := 1;
2534: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
2535: component.ato_forecast_control <> 2 ) THEN
2536: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
2537: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2538: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2539: x_Return_Status := 1;
2540: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
2541: component.ato_forecast_control <> 2 )) THEN
2534: ELSIF ( l_assy_bom_item_type IN (1,2) AND component.OPTIONAL <> 1 AND
2535: component.ato_forecast_control <> 2 ) THEN
2536: fnd_message.set_name('BOM','BOM_COMP_MODEL_OC_OPTIONAL');
2537: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2538: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2539: x_Return_Status := 1;
2540: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
2541: component.ato_forecast_control <> 2 )) THEN
2542: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
2538: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2539: x_Return_Status := 1;
2540: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
2541: component.ato_forecast_control <> 2 )) THEN
2542: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
2543: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2544: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2545: x_Return_Status := 1;
2546: END IF;
2539: x_Return_Status := 1;
2540: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
2541: component.ato_forecast_control <> 2 )) THEN
2542: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
2543: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2544: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2545: x_Return_Status := 1;
2546: END IF;
2547: END IF;
2540: ELSIF ( l_assy_bom_item_type IN (1,2) AND ( component.OPTIONAL = 1 AND
2541: component.ato_forecast_control <> 2 )) THEN
2542: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL_ATO_FORECAST');
2543: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2544: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2545: x_Return_Status := 1;
2546: END IF;
2547: END IF;
2548: l_stmt_no := 190;
2548: l_stmt_no := 190;
2549: IF ( l_assy_pick_components_flag = 'Y' AND l_assy_bom_item_type IN ( 1, 2) AND
2550: component.replenish_to_order_flag = 'Y' AND component.bom_item_type = 4 AND
2551: NVL(component.base_item_id,0) = 0 AND component.OPTIONAL = 2 ) THEN
2552: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL');
2553: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2554: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2555: x_Return_Status := 1;
2556: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
2549: IF ( l_assy_pick_components_flag = 'Y' AND l_assy_bom_item_type IN ( 1, 2) AND
2550: component.replenish_to_order_flag = 'Y' AND component.bom_item_type = 4 AND
2551: NVL(component.base_item_id,0) = 0 AND component.OPTIONAL = 2 ) THEN
2552: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL');
2553: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2554: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2555: x_Return_Status := 1;
2556: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
2557: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
2550: component.replenish_to_order_flag = 'Y' AND component.bom_item_type = 4 AND
2551: NVL(component.base_item_id,0) = 0 AND component.OPTIONAL = 2 ) THEN
2552: fnd_message.set_name('BOM','BOM_COMP_OPTIONAL');
2553: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2554: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2555: x_Return_Status := 1;
2556: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
2557: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
2558: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2553: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2554: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2555: x_Return_Status := 1;
2556: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
2557: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
2558: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2559: x_Return_Status := 1;
2560: END IF;
2561: l_stmt_no := 200;
2554: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2555: x_Return_Status := 1;
2556: ELSIF ( l_assy_bom_item_type IN (3,4) AND component.OPTIONAL = 1 ) THEN
2557: fnd_message.set_name('BOM','BOM_COMP_NOT_OPTIONAL');
2558: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2559: x_Return_Status := 1;
2560: END IF;
2561: l_stmt_no := 200;
2562: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2559: x_Return_Status := 1;
2560: END IF;
2561: l_stmt_no := 200;
2562: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2563: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2564: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2565: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2566: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2567: x_Return_Status := 1;
2560: END IF;
2561: l_stmt_no := 200;
2562: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2563: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2564: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2565: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2566: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2567: x_Return_Status := 1;
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2561: l_stmt_no := 200;
2562: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2563: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2564: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2565: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2566: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2567: x_Return_Status := 1;
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2569: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2562: IF component.required_for_revenue = 1 AND component.required_to_ship = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2563: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2564: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2565: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2566: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2567: x_Return_Status := 1;
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2569: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2570: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2565: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2566: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2567: x_Return_Status := 1;
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2569: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2570: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2571: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2572: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2573: x_Return_Status := 1;
2566: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2567: x_Return_Status := 1;
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2569: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2570: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2571: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2572: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2573: x_Return_Status := 1;
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2567: x_Return_Status := 1;
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2569: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2570: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2571: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2572: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2573: x_Return_Status := 1;
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2568: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 2 AND l_assy_atp_comp_flag = 'Y' THEN
2569: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2570: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2571: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2572: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2573: x_Return_Status := 1;
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2571: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2572: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2573: x_Return_Status := 1;
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2572: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2573: x_Return_Status := 1;
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2573: x_Return_Status := 1;
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2581: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2574: ELSIF component.required_to_ship = 1 AND component.required_for_revenue = 1 AND l_assy_atp_comp_flag = 'Y' THEN
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2581: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2582: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2575: fnd_message.set_name('BOM','BOM_COMP_REQ_TO_SHIP_INVALID');
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2581: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2582: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2583: x_Return_Status := 1;
2576: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2581: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2582: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2583: x_Return_Status := 1;
2584: END IF;
2577: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2581: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2582: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2583: x_Return_Status := 1;
2584: END IF;
2585: l_stmt_no := 210;
2578: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2579: fnd_message.set_name('BOM','BOM_COMP_REQ_FOR_REV_INVALID');
2580: fnd_message.set_token('REVISED_COMPONENT_NAME', G_COMP_ITEM_NAME);
2581: fnd_message.set_token('REVISED_ITEM_NAME', G_ASSY_ITEM_NAME);
2582: x_Error_Message := substr(x_Error_Message||FND_CONST.NEWLINE||fnd_message.get,1,2000) ;
2583: x_Return_Status := 1;
2584: END IF;
2585: l_stmt_no := 210;
2586: v_icc_comp_tbl(component.component_item_id).bill_sequence_id := component.bill_sequence_id;
3178: l_sub_locator_control Number :=0;
3179: Begin
3180: FND_MSG_PUB.Delete_Msg(null);
3181: if p_component_yield_factor is null then
3182: FND_MESSAGE.set_name('BOM', 'BOM_COMP_YIELD_MISSING');
3183: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3184: FND_MSG_PUB.add;
3185: l_val_failure := l_val_failure+1;
3186: end if;
3179: Begin
3180: FND_MSG_PUB.Delete_Msg(null);
3181: if p_component_yield_factor is null then
3182: FND_MESSAGE.set_name('BOM', 'BOM_COMP_YIELD_MISSING');
3183: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3184: FND_MSG_PUB.add;
3185: l_val_failure := l_val_failure+1;
3186: end if;
3187:
3186: end if;
3187:
3188: if (p_component_yield_factor is not null AND
3189: (p_component_yield_factor < 0 OR p_component_yield_factor > 1 )) then
3190: FND_MESSAGE.set_name('BOM', 'BOM_COMPYIELD_OUT_OF_RANGE');
3191: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3192: FND_MSG_PUB.add;
3193: l_val_failure := l_val_failure+1;
3194: end if;
3187:
3188: if (p_component_yield_factor is not null AND
3189: (p_component_yield_factor < 0 OR p_component_yield_factor > 1 )) then
3190: FND_MESSAGE.set_name('BOM', 'BOM_COMPYIELD_OUT_OF_RANGE');
3191: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3192: FND_MSG_PUB.add;
3193: l_val_failure := l_val_failure+1;
3194: end if;
3195:
3195:
3196: -- Component is Option Class and yield <> 1
3197: if nvl(p_component_yield_factor,1) <> 1 and
3198: p_bom_item_type = 2 then
3199: FND_MESSAGE.set_name('BOM', 'BOM_COMP_YIELD_NOT_ONE');
3200: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3201: FND_MESSAGE.set_token('REVISED_ITEM_NAME', null);
3202: FND_MSG_PUB.add;
3203: l_val_failure := l_val_failure+1;
3196: -- Component is Option Class and yield <> 1
3197: if nvl(p_component_yield_factor,1) <> 1 and
3198: p_bom_item_type = 2 then
3199: FND_MESSAGE.set_name('BOM', 'BOM_COMP_YIELD_NOT_ONE');
3200: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3201: FND_MESSAGE.set_token('REVISED_ITEM_NAME', null);
3202: FND_MSG_PUB.add;
3203: l_val_failure := l_val_failure+1;
3204: end if;
3197: if nvl(p_component_yield_factor,1) <> 1 and
3198: p_bom_item_type = 2 then
3199: FND_MESSAGE.set_name('BOM', 'BOM_COMP_YIELD_NOT_ONE');
3200: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3201: FND_MESSAGE.set_token('REVISED_ITEM_NAME', null);
3202: FND_MSG_PUB.add;
3203: l_val_failure := l_val_failure+1;
3204: end if;
3205:
3213: and organization_id = p_organization_id
3214: and rounding_control_type = 1;
3215: EXCEPTION
3216: WHEN NO_DATA_FOUND THEN
3217: FND_MESSAGE.set_name('BOM', 'BOM_ENFORCE_INT_INVALID');
3218: FND_MSG_PUB.add;
3219: l_val_failure := l_val_failure+1;
3220: END;
3221: end if;
3220: END;
3221: end if;
3222:
3223: if p_basis_type = 2 and p_wip_supply_type = 6 then
3224: FND_MESSAGE.set_name('BOM', 'BOM_LOT_BASED_PHANTOM');
3225: FND_MSG_PUB.add;
3226: l_val_failure := l_val_failure+1;
3227: end if;
3228:
3226: l_val_failure := l_val_failure+1;
3227: end if;
3228:
3229: if ( p_basis_type = 2 and ( p_optional = 1 or p_bom_item_type in (1,2))) THEN
3230: FND_MESSAGE.set_name('BOM', 'BOM_LOT_BASED_ATO');
3231: FND_MSG_PUB.add;
3232: l_val_failure := l_val_failure+1;
3233: end if;
3234:
3232: l_val_failure := l_val_failure+1;
3233: end if;
3234:
3235: if p_auto_request_material IS NOT NULL AND upper(p_auto_request_material) NOT IN ('Y','N') THEN
3236: FND_MESSAGE.set_name('BOM', 'BOM_AUTO_REQ_MAT_INVALID');
3237: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3238: FND_MESSAGE.set_token('AUTO_REQ_MATERIAL', p_auto_request_material);
3239: FND_MSG_PUB.add;
3240: l_val_failure := l_val_failure+1;
3233: end if;
3234:
3235: if p_auto_request_material IS NOT NULL AND upper(p_auto_request_material) NOT IN ('Y','N') THEN
3236: FND_MESSAGE.set_name('BOM', 'BOM_AUTO_REQ_MAT_INVALID');
3237: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3238: FND_MESSAGE.set_token('AUTO_REQ_MATERIAL', p_auto_request_material);
3239: FND_MSG_PUB.add;
3240: l_val_failure := l_val_failure+1;
3241: end if;
3234:
3235: if p_auto_request_material IS NOT NULL AND upper(p_auto_request_material) NOT IN ('Y','N') THEN
3236: FND_MESSAGE.set_name('BOM', 'BOM_AUTO_REQ_MAT_INVALID');
3237: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3238: FND_MESSAGE.set_token('AUTO_REQ_MATERIAL', p_auto_request_material);
3239: FND_MSG_PUB.add;
3240: l_val_failure := l_val_failure+1;
3241: end if;
3242:
3240: l_val_failure := l_val_failure+1;
3241: end if;
3242:
3243: if NVL(p_high_quantity,p_component_quantity) < NVL(p_component_quantity,0) THEN
3244: FND_MESSAGE.set_name('BOM', 'BOM_MAX_QUANTITY_INVALID');
3245: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3246: FND_MSG_PUB.add;
3247: l_val_failure := l_val_failure+1;
3248: end if;
3241: end if;
3242:
3243: if NVL(p_high_quantity,p_component_quantity) < NVL(p_component_quantity,0) THEN
3244: FND_MESSAGE.set_name('BOM', 'BOM_MAX_QUANTITY_INVALID');
3245: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3246: FND_MSG_PUB.add;
3247: l_val_failure := l_val_failure+1;
3248: end if;
3249:
3247: l_val_failure := l_val_failure+1;
3248: end if;
3249:
3250: if NVL(p_low_quantity, p_component_quantity) > NVL(p_component_quantity,0) THEN
3251: FND_MESSAGE.set_name('BOM', 'BOM_MIN_QUANTITY_INVALID');
3252: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3253: FND_MSG_PUB.add;
3254: l_val_failure := l_val_failure+1;
3255: end if;
3248: end if;
3249:
3250: if NVL(p_low_quantity, p_component_quantity) > NVL(p_component_quantity,0) THEN
3251: FND_MESSAGE.set_name('BOM', 'BOM_MIN_QUANTITY_INVALID');
3252: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3253: FND_MSG_PUB.add;
3254: l_val_failure := l_val_failure+1;
3255: end if;
3256:
3256:
3257: if BOM_EAMUTIL.Asset_Activity_Item(item_id => p_component_item_id,
3258: org_id => p_organization_id ) = 'Y' and
3259: p_wip_supply_type NOT IN (1,4) THEN
3260: FND_MESSAGE.set_name('BOM', 'BOM_INVALID_AA_SUPTYPES');
3261: FND_MSG_PUB.add;
3262: l_val_failure := l_val_failure+1;
3263: end if;
3264:
3262: l_val_failure := l_val_failure+1;
3263: end if;
3264:
3265: if p_wip_supply_type is not null and p_wip_supply_type = 7 THEN
3266: FND_MESSAGE.set_name('BOM', 'BOM_WIP_SUPPLY_TYPE_7');
3267: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3268: FND_MESSAGE.set_token('WIP_SUPPLY_TYPE', 'Based On Bill');
3269: FND_MSG_PUB.add;
3270: l_val_failure := l_val_failure+1;
3263: end if;
3264:
3265: if p_wip_supply_type is not null and p_wip_supply_type = 7 THEN
3266: FND_MESSAGE.set_name('BOM', 'BOM_WIP_SUPPLY_TYPE_7');
3267: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3268: FND_MESSAGE.set_token('WIP_SUPPLY_TYPE', 'Based On Bill');
3269: FND_MSG_PUB.add;
3270: l_val_failure := l_val_failure+1;
3271: end if;
3264:
3265: if p_wip_supply_type is not null and p_wip_supply_type = 7 THEN
3266: FND_MESSAGE.set_name('BOM', 'BOM_WIP_SUPPLY_TYPE_7');
3267: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3268: FND_MESSAGE.set_token('WIP_SUPPLY_TYPE', 'Based On Bill');
3269: FND_MSG_PUB.add;
3270: l_val_failure := l_val_failure+1;
3271: end if;
3272:
3270: l_val_failure := l_val_failure+1;
3271: end if;
3272:
3273: if p_check_atp = 1 and p_component_quantity < 0 THEN
3274: FND_MESSAGE.set_name('BOM', 'BOM_COMP_QTY_NEGATIVE');
3275: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3276: FND_MSG_PUB.add;
3277: l_val_failure := l_val_failure+1;
3278: end if;
3271: end if;
3272:
3273: if p_check_atp = 1 and p_component_quantity < 0 THEN
3274: FND_MESSAGE.set_name('BOM', 'BOM_COMP_QTY_NEGATIVE');
3275: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3276: FND_MSG_PUB.add;
3277: l_val_failure := l_val_failure+1;
3278: end if;
3279:
3277: l_val_failure := l_val_failure+1;
3278: end if;
3279:
3280: if p_pick_components = 1 and p_component_quantity < 0 THEN
3281: FND_MESSAGE.set_name('BOM', 'BOM_COMP_PTO_QTY_NEGATIVE');
3282: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3283: FND_MSG_PUB.add;
3284: l_val_failure := l_val_failure+1;
3285: end if;
3278: end if;
3279:
3280: if p_pick_components = 1 and p_component_quantity < 0 THEN
3281: FND_MESSAGE.set_name('BOM', 'BOM_COMP_PTO_QTY_NEGATIVE');
3282: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3283: FND_MSG_PUB.add;
3284: l_val_failure := l_val_failure+1;
3285: end if;
3286:
3291: industry => l_industry) AND
3292: p_bom_item_type IN (1,2) THEN
3293: null;
3294: ELSIF p_bom_item_type NOT IN (1,2) THEN
3295: FND_MESSAGE.set_name('BOM', 'BOM_MUT_EXCL_NOT_MDL_OPTCLASS');
3296: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3297: FND_MSG_PUB.add;
3298: l_val_failure := l_val_failure+1;
3299: ELSE
3292: p_bom_item_type IN (1,2) THEN
3293: null;
3294: ELSIF p_bom_item_type NOT IN (1,2) THEN
3295: FND_MESSAGE.set_name('BOM', 'BOM_MUT_EXCL_NOT_MDL_OPTCLASS');
3296: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3297: FND_MSG_PUB.add;
3298: l_val_failure := l_val_failure+1;
3299: ELSE
3300: FND_MESSAGE.set_name('BOM', 'BOM_MUT_EXCL_BOM_NOT_INST');
3296: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3297: FND_MSG_PUB.add;
3298: l_val_failure := l_val_failure+1;
3299: ELSE
3300: FND_MESSAGE.set_name('BOM', 'BOM_MUT_EXCL_BOM_NOT_INST');
3301: FND_MSG_PUB.add;
3302: l_val_failure := l_val_failure+1;
3303: END IF;
3304: ELSE
3305: null;
3306: END IF;
3307:
3308: IF p_so_basis = 1 AND p_bom_item_type <> Bom_Globals.G_OPTION_CLASS THEN
3309: FND_MESSAGE.set_name('BOM', 'BOM_SO_BASIS_ONE');
3310: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3311: FND_MSG_PUB.add;
3312: l_val_failure := l_val_failure+1;
3313: END IF;
3306: END IF;
3307:
3308: IF p_so_basis = 1 AND p_bom_item_type <> Bom_Globals.G_OPTION_CLASS THEN
3309: FND_MESSAGE.set_name('BOM', 'BOM_SO_BASIS_ONE');
3310: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3311: FND_MSG_PUB.add;
3312: l_val_failure := l_val_failure+1;
3313: END IF;
3314:
3329: Sub_Control => l_item_locator_control,
3330: Item_Control => l_sub_locator_control);
3331:
3332: if l_locator_control = 1 and p_supply_locator_id is null then
3333: FND_MESSAGE.set_name('BOM', 'BOM_LOCATOR_REQUIRED');
3334: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3335: FND_MSG_PUB.add;
3336: l_val_failure := l_val_failure+1;
3337: end if;
3330: Item_Control => l_sub_locator_control);
3331:
3332: if l_locator_control = 1 and p_supply_locator_id is null then
3333: FND_MESSAGE.set_name('BOM', 'BOM_LOCATOR_REQUIRED');
3334: FND_MESSAGE.set_token('REVISED_COMPONENT_NAME', p_component_name);
3335: FND_MSG_PUB.add;
3336: l_val_failure := l_val_failure+1;
3337: end if;
3338: Exception