398: RETURN FND_API.G_MISS_NUM;
399: END Line_Id;
400:
401: /********************************************************************
402: * Function : Standard_Operation_id for ECO BO
403: * Returns : Number
404: * Parameters IN : operation_type_code
405: * standard_operation_code
406: * Organization_Id
401: /********************************************************************
402: * Function : Standard_Operation_id for ECO BO
403: * Returns : Number
404: * Parameters IN : operation_type_code
405: * standard_operation_code
406: * Organization_Id
407: * Line_Id
408: * Parameters OUT: Error Text
409: * Purpose : Function will use the input parameters to find the
406: * Organization_Id
407: * Line_Id
408: * Parameters OUT: Error Text
409: * Purpose : Function will use the input parameters to find the
410: * Standard operation id and return a NULL if an error
411: * occured or the standard operation id could not be
412: * obtained.
413: ********************************************************************/
414: FUNCTION Standard_Operation_Id
407: * Line_Id
408: * Parameters OUT: Error Text
409: * Purpose : Function will use the input parameters to find the
410: * Standard operation id and return a NULL if an error
411: * occured or the standard operation id could not be
412: * obtained.
413: ********************************************************************/
414: FUNCTION Standard_Operation_Id
415: ( p_operation_type IN NUMBER
410: * Standard operation id and return a NULL if an error
411: * occured or the standard operation id could not be
412: * obtained.
413: ********************************************************************/
414: FUNCTION Standard_Operation_Id
415: ( p_operation_type IN NUMBER
416: , p_standard_operation_code IN VARCHAR2
417: , p_organization_id IN NUMBER
418: , p_rev_item_sequence_id IN NUMBER
412: * obtained.
413: ********************************************************************/
414: FUNCTION Standard_Operation_Id
415: ( p_operation_type IN NUMBER
416: , p_standard_operation_code IN VARCHAR2
417: , p_organization_id IN NUMBER
418: , p_rev_item_sequence_id IN NUMBER
419: , x_err_text IN OUT NOCOPY VARCHAR2
420: ) RETURN NUMBER
424: l_err_text VARCHAR2(2000);
425:
426: BEGIN
427:
428: SELECT standard_operation_id
429: INTO l_id
430: FROM bom_standard_operations bso
431: -- , eng_revised_items eri
432: WHERE NVL(bso.operation_type, 1)
426: BEGIN
427:
428: SELECT standard_operation_id
429: INTO l_id
430: FROM bom_standard_operations bso
431: -- , eng_revised_items eri
432: WHERE NVL(bso.operation_type, 1)
433: = DECODE(p_operation_type, FND_API.G_MISS_NUM, 1
434: , NVL(p_operation_type, 1 ) )
436: -- = NVL(eri.line_id, FND_API.G_MISS_NUM)
437: -- AND eri.revised_item_sequence_id = p_rev_item_sequence_id
438: AND NVL(bso.line_id, FND_API.G_MISS_NUM ) = FND_API.G_MISS_NUM
439: AND bso.organization_id = p_organization_id
440: AND bso.operation_code = p_standard_operation_code ;
441:
442:
443: RETURN l_id;
444:
448: RETURN NULL;
449:
450: WHEN OTHERS THEN
451: RETURN FND_API.G_MISS_NUM;
452: END Standard_Operation_Id;
453:
454:
455: /********************************************************************
456: * Function : Standard_Operation_Id
452: END Standard_Operation_Id;
453:
454:
455: /********************************************************************
456: * Function : Standard_Operation_Id
457: * Returns : Number
458: * Parameters IN : operation_type_code
459: * standard_operation_code
460: * Organization_Id
455: /********************************************************************
456: * Function : Standard_Operation_Id
457: * Returns : Number
458: * Parameters IN : operation_type_code
459: * standard_operation_code
460: * Organization_Id
461: * Line_Id
462: * Parameters OUT: Error Text
463: * Purpose : Function will use the input parameters to find the
460: * Organization_Id
461: * Line_Id
462: * Parameters OUT: Error Text
463: * Purpose : Function will use the input parameters to find the
464: * Standard operation id and return a NULL if an error
465: * occured or the standard operation id could not be
466: * obtained.
467: ********************************************************************/
468: FUNCTION Standard_Operation_Id
461: * Line_Id
462: * Parameters OUT: Error Text
463: * Purpose : Function will use the input parameters to find the
464: * Standard operation id and return a NULL if an error
465: * occured or the standard operation id could not be
466: * obtained.
467: ********************************************************************/
468: FUNCTION Standard_Operation_Id
469: ( p_operation_type IN NUMBER
464: * Standard operation id and return a NULL if an error
465: * occured or the standard operation id could not be
466: * obtained.
467: ********************************************************************/
468: FUNCTION Standard_Operation_Id
469: ( p_operation_type IN NUMBER
470: , p_standard_operation_code IN VARCHAR2
471: , p_organization_id IN NUMBER
472: , p_routing_sequence_id IN NUMBER
466: * obtained.
467: ********************************************************************/
468: FUNCTION Standard_Operation_Id
469: ( p_operation_type IN NUMBER
470: , p_standard_operation_code IN VARCHAR2
471: , p_organization_id IN NUMBER
472: , p_routing_sequence_id IN NUMBER
473: , x_err_text IN OUT NOCOPY VARCHAR2
474: ) RETURN NUMBER
478: l_err_text VARCHAR2(2000);
479:
480: BEGIN
481:
482: SELECT standard_operation_id
483: INTO l_id
484: FROM bom_standard_operations bso
485: , bom_operational_routings bor
486: WHERE NVL(bso.operation_type,1 )
480: BEGIN
481:
482: SELECT standard_operation_id
483: INTO l_id
484: FROM bom_standard_operations bso
485: , bom_operational_routings bor
486: WHERE NVL(bso.operation_type,1 )
487: = DECODE(p_operation_type, FND_API.G_MISS_NUM, 1
488: , NVL(p_operation_type, 1))
489: AND NVL(bso.line_id, FND_API.G_MISS_NUM)
490: = NVL(bor.line_id, FND_API.G_MISS_NUM)
491: AND bor.routing_sequence_id = p_routing_sequence_id
492: AND bso.organization_id = p_organization_id
493: AND bso.operation_code = p_standard_operation_code ;
494:
495: RETURN l_id;
496:
497: EXCEPTION
500: RETURN NULL;
501:
502: WHEN OTHERS THEN
503: RETURN FND_API.G_MISS_NUM;
504: END Standard_Operation_Id;
505:
506: /********************************************************************
507: * Function : Department id
508: * Returns : Number
565: SELECT bos.operation_sequence_id
566: INTO l_id
567: FROM BOM_OPERATION_SEQUENCES bos
568: , BOM_OPERATIONAL_ROUTINGS bor
569: , BOM_STANDARD_OPERATIONS bso
570: WHERE bso.organization_id = p_organization_id
571: AND bso.standard_operation_id = bos.standard_operation_id
572: AND bos.operation_seq_num = p_process_seq_number
573: AND bos.operation_type = 2 -- Operation Type : Process
567: FROM BOM_OPERATION_SEQUENCES bos
568: , BOM_OPERATIONAL_ROUTINGS bor
569: , BOM_STANDARD_OPERATIONS bso
570: WHERE bso.organization_id = p_organization_id
571: AND bso.standard_operation_id = bos.standard_operation_id
572: AND bos.operation_seq_num = p_process_seq_number
573: AND bos.operation_type = 2 -- Operation Type : Process
574: AND bos.routing_sequence_id = bor.common_routing_sequence_id
575: AND bor.routing_sequence_id = p_routing_sequence_id ;
577: SELECT bos.operation_sequence_id
578: INTO l_id
579: FROM BOM_OPERATION_SEQUENCES bos
580: , BOM_OPERATIONAL_ROUTINGS bor
581: , BOM_STANDARD_OPERATIONS bso
582: WHERE bso.operation_code = p_process_code
583: AND bso.organization_id = p_organization_id
584: AND bso.standard_operation_id = bos.standard_operation_id
585: AND bos.operation_seq_num = p_process_seq_number
580: , BOM_OPERATIONAL_ROUTINGS bor
581: , BOM_STANDARD_OPERATIONS bso
582: WHERE bso.operation_code = p_process_code
583: AND bso.organization_id = p_organization_id
584: AND bso.standard_operation_id = bos.standard_operation_id
585: AND bos.operation_seq_num = p_process_seq_number
586: AND bos.operation_type = 2 -- Operation Type : Process
587: AND bos.routing_sequence_id = bor.common_routing_sequence_id
588: AND bor.routing_sequence_id = p_routing_sequence_id ;
636: SELECT bos.operation_sequence_id
637: INTO l_id
638: FROM BOM_OPERATION_SEQUENCES bos
639: , BOM_OPERATIONAL_ROUTINGS bor
640: , BOM_STANDARD_OPERATIONS bso
641: WHERE bso.organization_id = p_organization_id
642: AND bso.standard_operation_id = bos.standard_operation_id
643: AND bos.operation_seq_num = p_line_seq_number
644: AND bos.operation_type = 3 -- Operation Type : Line Op
638: FROM BOM_OPERATION_SEQUENCES bos
639: , BOM_OPERATIONAL_ROUTINGS bor
640: , BOM_STANDARD_OPERATIONS bso
641: WHERE bso.organization_id = p_organization_id
642: AND bso.standard_operation_id = bos.standard_operation_id
643: AND bos.operation_seq_num = p_line_seq_number
644: AND bos.operation_type = 3 -- Operation Type : Line Op
645: AND bos.routing_sequence_id = bor.common_routing_sequence_id
646: AND bor.routing_sequence_id = p_routing_sequence_id ;
648: SELECT bos.operation_sequence_id
649: INTO l_id
650: FROM BOM_OPERATION_SEQUENCES bos
651: , BOM_OPERATIONAL_ROUTINGS bor
652: , BOM_STANDARD_OPERATIONS bso
653: WHERE bso.operation_code = p_line_code
654: AND bso.organization_id = p_organization_id
655: AND bso.standard_operation_id = bos.standard_operation_id
656: AND bos.operation_seq_num = p_line_seq_number
651: , BOM_OPERATIONAL_ROUTINGS bor
652: , BOM_STANDARD_OPERATIONS bso
653: WHERE bso.operation_code = p_line_code
654: AND bso.organization_id = p_organization_id
655: AND bso.standard_operation_id = bos.standard_operation_id
656: AND bos.operation_seq_num = p_line_seq_number
657: AND bos.operation_type = 3 -- Operation Type : Line Op
658: AND bos.routing_sequence_id = bor.common_routing_sequence_id
659: AND bor.routing_sequence_id = p_routing_sequence_id ;
2023: If BOM_Rtg_Globals.Get_Debug = 'Y'
2024: THEN Error_Handler.Write_Debug('Operaton VID conversion . . .');
2025: END IF;
2026: --
2027: -- Convert standard operation code to standard operation id
2028: --
2029: IF p_com_operation_rec.standard_operation_code IS NOT NULL AND
2030: p_com_operation_rec.standard_operation_code <> FND_API.G_MISS_CHAR
2031: THEN
2025: END IF;
2026: --
2027: -- Convert standard operation code to standard operation id
2028: --
2029: IF p_com_operation_rec.standard_operation_code IS NOT NULL AND
2030: p_com_operation_rec.standard_operation_code <> FND_API.G_MISS_CHAR
2031: THEN
2032: IF BOM_Rtg_Globals.Get_Bo_Identifier = BOM_Rtg_Globals.G_RTG_BO
2033: THEN
2026: --
2027: -- Convert standard operation code to standard operation id
2028: --
2029: IF p_com_operation_rec.standard_operation_code IS NOT NULL AND
2030: p_com_operation_rec.standard_operation_code <> FND_API.G_MISS_CHAR
2031: THEN
2032: IF BOM_Rtg_Globals.Get_Bo_Identifier = BOM_Rtg_Globals.G_RTG_BO
2033: THEN
2034:
2031: THEN
2032: IF BOM_Rtg_Globals.Get_Bo_Identifier = BOM_Rtg_Globals.G_RTG_BO
2033: THEN
2034:
2035: l_com_op_unexp_rec.Standard_Operation_Id :=
2036: Standard_Operation_Id
2037: ( p_operation_type => p_com_operation_rec.operation_type
2038: , p_standard_operation_code => p_com_operation_rec.standard_operation_code
2039: , p_organization_id => l_com_op_unexp_rec.organization_id
2032: IF BOM_Rtg_Globals.Get_Bo_Identifier = BOM_Rtg_Globals.G_RTG_BO
2033: THEN
2034:
2035: l_com_op_unexp_rec.Standard_Operation_Id :=
2036: Standard_Operation_Id
2037: ( p_operation_type => p_com_operation_rec.operation_type
2038: , p_standard_operation_code => p_com_operation_rec.standard_operation_code
2039: , p_organization_id => l_com_op_unexp_rec.organization_id
2040: , p_routing_sequence_id => l_com_op_unexp_rec.routing_sequence_id
2034:
2035: l_com_op_unexp_rec.Standard_Operation_Id :=
2036: Standard_Operation_Id
2037: ( p_operation_type => p_com_operation_rec.operation_type
2038: , p_standard_operation_code => p_com_operation_rec.standard_operation_code
2039: , p_organization_id => l_com_op_unexp_rec.organization_id
2040: , p_routing_sequence_id => l_com_op_unexp_rec.routing_sequence_id
2041: , x_err_text => l_err_text
2042: );
2041: , x_err_text => l_err_text
2042: );
2043:
2044: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
2045: ('Converted standard operation code . . .');
2046: END IF;
2047:
2048: ELSE
2049:
2046: END IF;
2047:
2048: ELSE
2049:
2050: l_com_op_unexp_rec.Standard_Operation_Id :=
2051: Standard_Operation_Id
2052: ( p_operation_type => p_com_operation_rec.operation_type
2053: , p_standard_operation_code => p_com_operation_rec.standard_operation_code
2054: , p_organization_id => l_com_op_unexp_rec.organization_id
2047:
2048: ELSE
2049:
2050: l_com_op_unexp_rec.Standard_Operation_Id :=
2051: Standard_Operation_Id
2052: ( p_operation_type => p_com_operation_rec.operation_type
2053: , p_standard_operation_code => p_com_operation_rec.standard_operation_code
2054: , p_organization_id => l_com_op_unexp_rec.organization_id
2055: , p_rev_item_sequence_id => l_com_op_unexp_rec.revised_item_sequence_id
2049:
2050: l_com_op_unexp_rec.Standard_Operation_Id :=
2051: Standard_Operation_Id
2052: ( p_operation_type => p_com_operation_rec.operation_type
2053: , p_standard_operation_code => p_com_operation_rec.standard_operation_code
2054: , p_organization_id => l_com_op_unexp_rec.organization_id
2055: , p_rev_item_sequence_id => l_com_op_unexp_rec.revised_item_sequence_id
2056: , x_err_text => l_err_text
2057: );
2056: , x_err_text => l_err_text
2057: );
2058:
2059: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
2060: ('Converted standard operation code . . .');
2061: END IF;
2062:
2063: END IF ;
2064:
2061: END IF;
2062:
2063: END IF ;
2064:
2065: IF l_com_op_unexp_rec.Standard_Operation_Id IS NULL
2066: THEN
2067: l_token_tbl(1).token_name := 'STD_OP_CODE';
2068: l_token_tbl(1).token_value :=
2069: p_com_operation_rec.standard_operation_code;
2065: IF l_com_op_unexp_rec.Standard_Operation_Id IS NULL
2066: THEN
2067: l_token_tbl(1).token_name := 'STD_OP_CODE';
2068: l_token_tbl(1).token_value :=
2069: p_com_operation_rec.standard_operation_code;
2070: Error_Handler.Add_Error_Token
2071: ( p_mesg_token_tbl => l_Mesg_Token_Tbl
2072: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
2073: , p_Message_name =>
2075: , p_token_tbl => l_token_tbl
2076: );
2077: l_return_status := FND_API.G_RET_STS_ERROR;
2078: ELSIF l_err_text IS NOT NULL AND
2079: l_com_op_unexp_rec.Standard_Operation_Id IS NULL
2080: THEN
2081: Error_Handler.Add_Error_Token
2082: ( p_mesg_token_tbl => l_Mesg_Token_Tbl
2083: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl