149: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
150: l_program_id := FND_GLOBAL.CONC_PROGRAM_ID;
151:
152: -- set the return status.
153: x_return_status := FND_API.G_RET_STS_SUCCESS ;
154:
155: -- Set the return code to success
156:
157: RETCODE := 0;
470: x_orig_resp_appl_id => xrespapplid,
471: x_return_status => x_return_status,
472: x_msg_count => x_msg_count,
473: x_msg_data => x_msg_data);
474: If x_return_status = FND_API.G_RET_STS_ERROR then
475: if PG_DEBUG <> 0 then
476: oe_debug_pub.add('Set_created_by_context API ended with expected error',1);
477: end if;
478: raise FND_API.G_EXC_ERROR;
474: If x_return_status = FND_API.G_RET_STS_ERROR then
475: if PG_DEBUG <> 0 then
476: oe_debug_pub.add('Set_created_by_context API ended with expected error',1);
477: end if;
478: raise FND_API.G_EXC_ERROR;
479: elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
480: if PG_DEBUG <> 0 then
481: oe_debug_pub.add('Set_created_by_context API ended with unexpected error',1);
482: end if;
475: if PG_DEBUG <> 0 then
476: oe_debug_pub.add('Set_created_by_context API ended with expected error',1);
477: end if;
478: raise FND_API.G_EXC_ERROR;
479: elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
480: if PG_DEBUG <> 0 then
481: oe_debug_pub.add('Set_created_by_context API ended with unexpected error',1);
482: end if;
483: raise FND_API.G_EXC_UNEXPECTED_ERROR;
479: elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
480: if PG_DEBUG <> 0 then
481: oe_debug_pub.add('Set_created_by_context API ended with unexpected error',1);
482: end if;
483: raise FND_API.G_EXC_UNEXPECTED_ERROR;
484: end if; /*x_return_staus = FND_API.G_EXC_ERROR */
485: l_current_org_id := org_id_arr(i);
486: End if; /* l_current_org_id <> so_lines.org_id */
487:
480: if PG_DEBUG <> 0 then
481: oe_debug_pub.add('Set_created_by_context API ended with unexpected error',1);
482: end if;
483: raise FND_API.G_EXC_UNEXPECTED_ERROR;
484: end if; /*x_return_staus = FND_API.G_EXC_ERROR */
485: l_current_org_id := org_id_arr(i);
486: End if; /* l_current_org_id <> so_lines.org_id */
487:
488: -- We just need to push the workflow further. Workflow will take care of rest.
505: p_activity_name=>'CREATE_SUPPLY_ORDER_ELIGIBLE',
506: p_result_code=>'COMPLETE');
507: IF NOT l_res THEN
508: oe_debug_pub.add('auto_create_dropship: ' || 'Error occurred in updating the workflow status - Stmt_num'||to_char(l_stmt_num),1);
509: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
510: END IF;
511:
512: ELSE
513:
530: p_result_code=>'COMPLETE');
531:
532: IF NOT l_res THEN
533: oe_debug_pub.add('auto_create_dropship: ' || 'Error occurred in updating the workflow status - Stmt_num'||to_char(l_stmt_num),1);
534: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
535: END IF;
536: END IF;
537: END IF;
538:
568: COMMIT ;
569:
570:
571: EXCEPTION
572: WHEN FND_API.G_EXC_ERROR THEN
573: oe_debug_pub.add('auto_create_dropship: ' || ':exp error::'||to_char(l_stmt_num)||'::'||sqlerrm,1);
574: x_return_status := FND_API.G_RET_STS_ERROR;
575: RETCODE := 2;
576: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
570:
571: EXCEPTION
572: WHEN FND_API.G_EXC_ERROR THEN
573: oe_debug_pub.add('auto_create_dropship: ' || ':exp error::'||to_char(l_stmt_num)||'::'||sqlerrm,1);
574: x_return_status := FND_API.G_RET_STS_ERROR;
575: RETCODE := 2;
576: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
577:
578: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
574: x_return_status := FND_API.G_RET_STS_ERROR;
575: RETCODE := 2;
576: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
577:
578: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
579: oe_debug_pub.add('auto_create_dropship: ' || ':exp error::'||to_char(l_stmt_num)||'::'||sqlerrm,1);
580: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
581: RETCODE := 2;
582: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
576: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
577:
578: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
579: oe_debug_pub.add('auto_create_dropship: ' || ':exp error::'||to_char(l_stmt_num)||'::'||sqlerrm,1);
580: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
581: RETCODE := 2;
582: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
583:
584: WHEN OTHERS THEN
582: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
583:
584: WHEN OTHERS THEN
585: oe_debug_pub.add('auto_create_dropship: ' || ':exp error::'||to_char(l_stmt_num)||'::'||sqlerrm,1);
586: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
587: RETCODE := 2;
588: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',Current_Error_Code);
589:
590: END auto_create_dropship;