Home » Applications » Oracle Fusion Apps & E-Business Suite » shipping using API (OM R12.1)
shipping using API [message #439013] Wed, 13 January 2010 10:56
alaa_fouad2004
Messages: 64
Registered: January 2009
Member
Dear all
i tried to do ship confirm for the delvery using the this API 'wsh_deliveries_pub.Delivery_Action' and wrote this code


CREATE OR REPLACE procedure cc_shipping
as 
 l_return_status VARCHAR2(2000); 
 l_msg_count NUMBER; 
 --l_msg_data VARCHAR2(1000); 
  
 pp_init_msg_list VARCHAR2(10) := FND_API.G_FALSE; 
 pp_return_values VARCHAR2(10) := FND_API.G_FALSE; 
 pp_action_commit VARCHAR2(10) := FND_API.G_FALSE; 
 xx_return_status VARCHAR2(1); 
 xx_msg_count NUMBER; 
 xx_msg_data VARCHAR2(2000); 
 trip_id number;
 trip_name varchar2(2000);
 l_msg_index_out number;
 l_msg_data varchar2(2000);
  x_msg_summary varchar2(2000); 
  x_msg_details varchar2(2000);
  fail_api EXCEPTION;
BEGIN 
 dbms_output.enable(1000000);
 mo_global.init('ONT');
 MO_GLOBAL.SET_POLICY_CONTEXT('S', 120); 
 --fnd_global.apps_initialize(1013475,21623,660); -- pass in user_id, responsibility_id, and application_id
 --FND_PROFILE.PUT('USER_ID','1013475') ;
 --FND_PROFILE.PUT( 'OE_ORGANIZATION_ID','204');
 oe_msg_pub.initialize; 
 oe_debug_pub.initialize; 
 --X_DEBUG_FILE := OE_DEBUG_PUB.Set_Debug_Mode('FILE'); 
 --oe_debug_pub.SetDebugLevel(5); -- Use 5 for the most debuging output, I warn  you its a lot of data 
 dbms_output.put_line('START OF NEW DEBUG'); 
--This is to UPDATE order line 
 --l_line_tbl_index :=1; 

fnd_global.apps_initialize(user_id => 1115,
resp_id => 50676,
resp_appl_id => 660,
security_group_id => 0);

/* Values for Ship Confirming the delivery. 
WSH_DELIVERIES_PUB.Delivery_Action(
p_api_version_number  =>   0.1,
    p_init_msg_list       =>   pp_init_msg_list,
    x_return_status       =>   xx_return_status,
    x_msg_count           =>   xx_msg_count,
    x_msg_data            =>   xx_msg_data,
p_action_code => 'CONFIRM', 
p_delivery_id => 2094, 
p_delivery_name => '2094', 
p_sc_action_flag => 'S', 
p_sc_close_trip_flag => 'Y',
p_sc_trip_ship_method => 'GROUND', 
--p_sc_report_set_name => null, 
--p_wv_override_flag => p_wv_override_flag, 
x_trip_id => trip_id, 
x_trip_name            =>  trip_name );
*/
/*
source_code := 'OE'; -- The only source code that should be used by the API 
changed_attributes(1).delivery_detail_id := 12132; -- Ship All quantities in this detail. 
changed_attributes(1).shipped_quantity := 1; 
--changed_attributes(2).source_line_id := 2031; -- Back Order All in this detail. 
--changed_attributes(2).shipped_quantity := 0; 
--changed_attributes(2).cycle_count_quantity := 2; 
--changed_attributes(3).source_line_id := 13433; -- Stage All in this detail. 
--changed_attributes(3).shipped_quantity := 0; 
--changed_attributes(3).cycle_count_quantity := 0; 
WSH_DELIVERY_DETAILS_PUB.Update_Shipping_Attributes( 
:::::::::::::
p_changed_attributes => changed_attributes, 
p_source_code => 'OE'); 
commit;
*/
wsh_deliveries_pub.Delivery_Action
  ( p_api_version_number  =>    1.0,
    p_init_msg_list       =>   pp_init_msg_list,
    x_return_status       =>   xx_return_status,
    x_msg_count           =>   xx_msg_count,
    x_msg_data            =>   xx_msg_data,
    p_action_code         =>   'CONFIRM',
    p_delivery_id         =>   2094,
    p_delivery_name       =>    '2094',
    p_asg_trip_id         =>    NULL,
    p_asg_trip_name       =>    NULL,
    p_asg_pickup_stop_id  =>    NULL,
    p_asg_pickup_loc_id   =>    NULL,
    p_asg_pickup_stop_seq =>    NULL,
    p_asg_pickup_loc_code =>    NULL,
    p_asg_pickup_arr_date =>    NULL,
    p_asg_pickup_dep_date =>   NULL,
    p_asg_dropoff_stop_id =>   NULL,
    p_asg_dropoff_loc_id  =>   NULL,
    p_asg_dropoff_stop_seq =>    NULL,
    p_asg_dropoff_loc_code =>   NULL,
    p_asg_dropoff_arr_date =>  NULL,
    p_asg_dropoff_dep_date =>   NULL,
    p_sc_action_flag       =>   'S',
    p_sc_intransit_flag    =>  'N',
    p_sc_close_trip_flag   =>   'Y',
    p_sc_create_bol_flag   =>   'N',
    p_sc_stage_del_flag    =>   'Y',
    p_sc_trip_ship_method  =>   null,--'UPS', --'GROUND',
    p_sc_actual_dep_date   =>   NULL,
    p_sc_report_set_id     =>   NULL,
    p_sc_report_set_name   =>   NULL,
    p_sc_defer_interface_flag =>  'Y',
    p_sc_send_945_flag       => NULL,
    p_sc_rule_id             => NULL,
    p_sc_rule_name         =>   NULL,
    p_wv_override_flag     =>   'N',
    x_trip_id              =>  trip_id,
    x_trip_name            =>  trip_name );
    
    DBMS_OUTPUT.PUT_LINE('xx_return_status= ' || xx_return_status);
    if (xx_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) then 
raise fail_api; 
end if; 
exception 
when fail_api then 
WSH_UTIL_CORE.get_messages('Y', x_msg_summary, x_msg_details, xx_msg_count); 
if xx_msg_count >= 1 then 
DBMS_OUTPUT.PUT_LINE('x_msg_summary= ' || x_msg_summary); 
DBMS_OUTPUT.PUT_LINE('x_msg_details= ' || x_msg_details);
--x_msg_data := x_msg_summary || x_msg_details; 
--else 
--x_msg_data := x_msg_summary; 
end if;

end; 
/*
    
    FOR i IN 1 .. xx_msg_count 
 LOOP 
  Oe_Msg_Pub.get( p_msg_index => i 
  , p_encoded => Fnd_Api.G_FALSE 
  , p_data => l_msg_data 
  , p_msg_index_out => l_msg_index_out); 
  DBMS_OUTPUT.PUT_LINE('message is: ' || l_msg_data); 
  DBMS_OUTPUT.PUT_LINE('message index is: ' || l_msg_index_out); 
 END LOOP; 
    
    dbms_output.put_line('trip_id='||trip_id);
    dbms_output.put_line('trip_name='||trip_name);
    dbms_output.put_line('xx_return_status='||xx_return_status);
    dbms_output.put_line('xx_msg_coun='||xx_msg_count);
    dbms_output.put_line('xx_msg_data='||xx_msg_data);
    
    
    COMMIT;
    





end;
*/


this code for any one want to do ship confirm

Alaa Fouad

[Updated on: Thu, 14 January 2010 04:59]

Report message to a moderator

Previous Topic: Absence request reason, Pending Transaction
Next Topic: OS platform for E-Business
Goto Forum:
  


Current Time: Mon Dec 23 18:30:43 CST 2024