If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Urget Urget with procedure import into FM

Started by coghelp, 29 Jul 2011 05:09:36 PM

Previous topic - Next topic

coghelp

Is it possible to use below procedure from FM or do I need to make any modifications. If I can use it direclty what is the steps if not what changes do I need to make for procedure to work with FM.

Thanks for the help and support!!

create or replace
procedure test_date
(
  p_ship_nbr  in ship_hdr.ship_nbr%type,
  p_resultoutout number
)
as
v_days_orgin     number:=0;
v_ddlvry  date;
v_plusdays        number:=0;
v_actual_ship_date   date;
v_t_hours        number:=0;
begin
p_resultout:=0;

    select days_from_orgn,ord_hdr.dlvry_date
    into v_days_orgin,v_dlvry_date
    from part_zone, part_orgin, ship_via, ship_hdr, ord_hdr
    where ship_hdr.ship_via = ship_via.ship_via
    and ship_via.serv_type = part_orgin.serv_type
    and part_orgin.part_zone_grp = part_zone.part_zone_grp
    and ship_hdr.pkt_ctrl_nbr = ord_hdr.pkt_ctrl_nbr
    and part_zone.dest_from_zip <= ord_hdr.shipto_zip
    and part_zone.dest_to_zip > ord_hdr.shipto_zip
    and part_zone.date_eff <=  sysdate
    and ship_hdr.ship_nbr = p_ship_nbr and rownum =1
    order by part_zone.date_eff desc;

    c_is_available_today(p_ship_nbr,v_addnl_days);
    v_days_orgin := v_days_orgin + v_addnl_days;
    v_aship_date := sysdate;

    if v_plusdays= 0
    then
    select case when (  (   to_char(sysdate,'hh24')
                          + to_char(sysdate,'mi') /60
                          + to_char(sysdate,'ss') /3600
                        )
                        >
                        (   to_char(carr_cut_day.cut_time,'hh24')
                          + to_char(carr_cut_day.cut_time,'mi')/60
                          + to_char(carr_cut_day.cut_time,'ss')/3600
                        )
                     )
    then carr_cut_day.add_on_days else 0 end
    into v_addnl_days
    from carr_cut_hdr,ship_hdr,carr_cut_day
    where carr_cut_hdr.ship_via = ship_hdr.ship_via
    and carr_cut_hdr.carr_cut_id = carr_cut_day.carr_cut_id
    and carr_cut_day.carr_cut_day = to_char(trunc(sysdate),'d')  -1
    and ship_hdr.ship_nbr = p_ship_nbr;
    v_days_orgin := v_days_orgin + v_addnl_days;
    end if;

    v_addnl_days:=0;
   c_is_valid(p_ship_nbr,v_aship_date,v_days_orgin,v_addnl_days);
    v_days_orgin := v_days_orgin + v_addnl_days;

    v_aship_date := trunc(sysdate) + v_days_orgin;

    if v_aship_date > v_dlvry_date
    then
        p_resultout:=1;
    end if;

exception when others then
p_resultout:= 1;
end;