You are on page 1of 2

DECLARE

l_api_version NUMBER := 2.0;


l_validation_level number default GME_COMMON_PVT.G_MAX_ERRORS;
p_init_msg_list BOOLEAN DEFAULT FALSE;
P_batch_type NUMBER := 0;
p_batch_qty number := 1;
p_item_um varchar2(5) := 'TON';
p_orgn_code VARCHAR2(4) DEFAULT 'DC1';
l_batch_header GME_BATCH_HEADER%ROWTYPE;
x_batch_header gme_batch_header%ROWTYPE;
l_message_count NUMBER;
l_message_list VARCHAR2(500);
l_return_status VARCHAR2(1);
l_msg_index_out NUMBER;
lo_exception_material_tbl GME_COMMON_PVT.EXCEPTIONS_TAB;
BEGIN
l_batch_header.batch_no:= null;
l_batch_header.plan_start_date := TO_DATE('30-DEC-2009 12:00:00','DD-MON-YYYY HH
24:MI:SS');
l_batch_header.plan_cmplt_date := TO_DATE('30-DEC-2009 12:00:00','DD-MON-YYYY HH
24:MI:SS');
l_batch_header.due_date :=TO_DATE('30-DEC-2009 12:00:00','DD-MON-YYYY HH24:MI:SS
');
l_batch_header.update_inventory_ind :='Y';
l_batch_header.recipe_validity_rule_id :=153;
l_batch_header.batch_type := 0 ;
fnd_global.apps_initialize(user_id =>1090,resp_id =>23326 ,resp_appl_id =>553 );
--------------------------------------------
gme_api_pub.create_batch
(
p_api_version => l_api_version,
p_validation_level => l_validation_level,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_TRUE,
x_message_count => l_message_count,
x_message_list => l_message_list,
x_return_status => l_return_status,
p_org_code => 'DC1',
p_batch_header_rec => l_batch_header,
x_batch_header_rec => x_batch_header,
p_batch_size => p_batch_qty,
p_batch_size_uom => p_item_um,
p_creation_mode => 'RECIPE',
p_recipe_id => 21, -- l_recipe_id,
p_recipe_no => 'SR TEST', --p_product_no,
p_recipe_version => 1, --l_recipe_version,
p_product_no => null, --p_product_no,
p_item_revision => null,
p_product_id => null, --p_item_id,
p_ignore_qty_below_cap => FND_API.G_TRUE,
p_use_workday_cal => FND_API.G_FALSE,
p_contiguity_override => FND_API.G_TRUE,
p_use_least_cost_validity_rule => FND_API.G_FALSE,
x_exception_material_tbl => lo_exception_material_tbl
);
------------------------------------------
gme_debug.display_messages(l_message_count);
dbms_output.put_line('x_message_count ='||TO_CHAR(l_message_count));
dbms_output.put_line('x_message_list =
'||length(l_message_list)||SubStr(l_message_list,length(l_message_list)-20,20));
dbms_output.put_line('x_message_list ='||l_message_list);
dbms_output.put_line('x_return_status ='||l_return_status);
dbms_output.put_line('x_batch_header.batch_id= '||TO_CHAR(x_batch_header.batch_i
d));
dbms_output.put_line(SubStr('x_batch_header.plant_code ='||x_batch_header.plant_
code,1,255));
dbms_output.put_line(SubStr('x_batch_header.batch_no ='||x_batch_header.batch_no
,1,255));
END;