536: l_sql_stmt_no := 30;
537: select c1.calendar_date
538: into l_need_by_date
539: from mtl_parameters o,
540: bom_calendar_dates c1,
541: bom_calendar_dates c
542: where o.organization_id = l_kanban_card_Rec_Tbl(1).Organization_id
543: and c1.calendar_code = c.calendar_code
544: and c1.exception_set_id = c.exception_set_id
537: select c1.calendar_date
538: into l_need_by_date
539: from mtl_parameters o,
540: bom_calendar_dates c1,
541: bom_calendar_dates c
542: where o.organization_id = l_kanban_card_Rec_Tbl(1).Organization_id
543: and c1.calendar_code = c.calendar_code
544: and c1.exception_set_id = c.exception_set_id
545: and c1.seq_num = (c.next_seq_num + trunc(nvl(p_lead_time,l_need_by_time)))