DECLARE
l_api_name VARCHAR2(30) := 'sale_order_pick';
l_api_version NUMBER := 1.0;
l_batch_info_rec wsh_picking_batches_pub.Batch_Info_rec;
x_return_status VARCHAR2(1);
x_msg_count NUMBER;
x_batch_id NUMBER;
x_msg_data VARCHAR2(2000);
x_pick_result varchar2(1);
l_msg_return NUMBER;
x_request_id NUMBER;
BEGIN
l_batch_info_rec.backorders_only_flag := 'E';
l_batch_info_rec.existing_rsvs_only_flag := 'N';
l_batch_info_rec.customer_id := 37040;
l_batch_info_rec.order_header_id := 9775;
-- l_batch_info_rec.inventory_item_id := l_order_info_rec.inventory_item_id;
-- l_batch_info_rec.order_type_id := l_order_info_rec.order_type_id;
-- l_batch_info_rec.pick_grouping_rule_name := 'BJJF_STANDARD PICKING';
l_batch_info_rec.from_scheduled_ship_date := NULL;--to_date('28-07-2010','DD-MM-YYYY');
-- l_batch_info_rec.to_scheduled_ship_date :=
-- l_batch_info_rec.ship_to_location_id :=
-- l_batch_info_rec.ship_to_location_code :=
l_batch_info_rec.organization_id := 89;
-- l_batch_info_rec.ship_from_location_id := 182;--'BJJF_BCPK.BJJF_0528001.01'
-- l_batch_info_rec.ship_from_location_code := 'BJJF_BCPK.BJJF_0528001.01';
-- l_batch_info_rec.pick_grouping_rule_id := 1030;
-- l_batch_info_rec.pick_sequence_rule_id := 1010;
l_batch_info_rec.include_planned_lines := 'N';
l_batch_info_rec.autocreate_delivery_flag := 'Y';
l_batch_info_rec.autodetail_pr_flag := 'Y';
l_batch_info_rec.allocation_method := 'I';
-- l_batch_info_rec.default_stage_subinventory := 'BJJF_DF';
-- l_batch_info_rec.default_stage_locator_id := 82;
-- l_batch_info_rec.pick_from_subinventory := l_order_info_rec.subinventory;
l_batch_info_rec.pick_from_locator_id := NULL;--182;
l_batch_info_rec.auto_pick_confirm_flag := 'N';
l_batch_info_rec.autopack_flag := 'N';
-- Call Private API
wsh_picking_batches_pub.Create_Batch(p_api_version => l_api_version
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,p_batch_rec => l_batch_info_rec
,x_batch_id => x_batch_id);
dbms_output.put_line(x_return_status);
wsh_picking_batches_pub.Release_Batch(p_api_version => l_api_version,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_batch_id => x_batch_id,
p_release_mode => 'ONLINE',
x_request_id => x_request_id);
FOR i IN 1..x_msg_count LOOP
fnd_msg_pub.get(p_msg_index => i,p_encoded => 'F',p_data => x_msg_data,p_msg_index_out => l_msg_return);
dbms_output.put_line(x_msg_data);
END LOOP;
END;