progress bar - Sample Code(Archived)

hi sir
do you have any sample code for progress bar
i have a form that compute salary for a lot of people
and i want to show the progress of computting to the user.
thank u in advanced 

Hi Mehdi,
search for 'progress' in the forms forum.
There a couple a threads on this topic.
For example:
re:6.5.2.1 how to set application schema
Jens

you can use dbms_pipe like in this simple example:<br>
fill pipes:
<code>
create or replace procedure fillpipe is
dummy number;
progressbar varchar2(32767) := '[';
begin
for i in 1..20 loop
progressbar:=progressbar||'||';
dbms_pipe.pack_message(item => rpad(str1 => progressbar,len => 40,pad => '.')||']');
dummy:=dbms_pipe.send_message(pipename => 'progresspipe');
dbms_pipe.pack_message(item => 'testpipe message '||to_char(i));
dummy:=dbms_pipe.send_message(pipename => 'testpipe');
for j in 1..999999 loop null; end loop;
end loop;
progressbar:=progressbar||']';
dbms_pipe.pack_message(item => progressbar);
dummy:=dbms_pipe.send_message(pipename => 'progresspipe');
dbms_pipe.pack_message(item => 'stop');
dummy:=dbms_pipe.send_message(pipename => 'testpipe');
end fillpipe;
</code>
show "progessbar" and message:<br>
<code>
create or replace procedure HTMLprogress(pipeName in varchar2 := 'testpipe',progressPipe in varchar2 := 'progresspipe') is
dummy number;
message varchar2(32767);
progress varchar2(32767);
begin
dummy := dbms_pipe.receive_message(pipename => progressPipe);
dbms_pipe.unpack_message(item => progress);
dummy := dbms_pipe.receive_message(pipename => pipeName);
dbms_pipe.unpack_message(item => message);
if message <> 'stop' then htp.p('<meta http-equiv=refresh content=?time and url? >');
end if;
htp.p(progress||'<br>');
htp.p(message);
end HTMLprogress;
</code><br> 

take a item of type display
and in the run time just increase the length and use the command
"SYNCHRONIZE" to refrshing the screen.
DECLARE
i number:=0;
BEGIn
i := i + 1;
:dispaly_item := i || '%';
SYNCHRONIZE;
END;

Related

How to process multi level boms through api bom_bo_pub.Process_Bom?

I have two procedures which i call in a program.The first procedure is meant to extract the data from one organization and store in the form of table types.
The data extracted is actually a multi level bill of material (consider a tree hierarchical structure).
I just want to import this data into another organization through the second procedure.
The problem is that the one of the output parameters of first procedure doesnt match with the input parameter of second procedure since the output parameter is a table type and the other input parameter is record type .See the code below
output paramter : l_bom_header_tbl BOM_BO_PUB.BOM_HEADER_TBL_TYPE ;
Input parameter : V_bom_header_tbl Bom_Bo_Pub.Bom_Head_Rec_Type := Bom_Bo_Pub.G_MISS_BOM_HEADER_REC;
When i try to pass the paramter from output to input as below ,
for i in 1 .. l_bom_header_tbl.COUNT LOOP
--- pl('Header Record: ' || i);
V_bom_header_tbl(I).organization_code :='DSC';
v_item_name := l_bom_header_tbl(i).assembly_item_name;
V_bom_header_tbl(i).assembly_item_name:= v_item_name;
V_bom_header_tbl(i).alternate_bom_code :=NULL;
V_bom_header_tbl(i).Assembly_type := 1;
V_bom_header_tbl(i).Transaction_Type := 'CREATE';
V_bom_header_tbl(i).Return_Status := NULL;
It gives me the error
no function with name 'V_BOM_HEADER_TBL' exists in this scope
How to convert the datatype of output parameter to record datatype of input parameter?
The whole code is as below:
set serveroutput on size 1000000
declare
l_org_hierarchy_name varchar(30);
l_organization_code MTL_PARAMETERS.ORGANIZATION_CODE%TYPE;
l_assembly_item_name MTL_ITEM_FLEXFIELDS.ITEM_NUMBER%TYPE;
l_alternate_bm_designator BOM_BILL_OF_MATERIALS.ALTERNATE_BOM_DESIGNATOR%TYPE;
l_costs NUMBER := 2;
l_bom_header_tbl BOM_BO_PUB.BOM_HEADER_TBL_TYPE ;
l_bom_revisions_tbl BOM_BO_PUB.BOM_REVISION_TBL_TYPE;
l_bom_components_tbl BOM_BO_PUB.BOM_COMPS_TBL_TYPE;
l_bom_ref_designators_tbl BOM_BO_PUB.BOM_REF_DESIGNATOR_TBL_TYPE;
l_bom_sub_components_tbl BOM_BO_PUB.BOM_SUB_COMPONENT_TBL_TYPE;
l_bom_comp_ops_tbl BOM_BO_PUB.BOM_COMP_OPS_TBL_TYPE;
V_assembly_item_name MTL_ITEM_FLEXFIELDS.ITEM_NUMBER%TYPE;
V_alternate_bm_designator BOM_BILL_OF_MATERIALS.ALTERNATE_BOM_DESIGNATOR%TYPE;
l_cost_type_id NUMBER := 0;
V_bom_header_tbl Bom_Bo_Pub.Bom_Head_Rec_Type := Bom_Bo_Pub.G_MISS_BOM_HEADER_REC;
V_bom_revisions_tbl Bom_Bo_Pub.Bom_Revision_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_REVISION_TBL;
V_bom_components_tbl Bom_Bo_Pub.Bom_Comps_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_COMPONENT_TBL;
V_bom_ref_designators_tbl Bom_Bo_Pub.Bom_Ref_Designator_Tbl_type := Bom_Bo_Pub.G_MISS_BOM_REF_DESIGNATOR_TBL;
v_bom_sub_components_tbl Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_SUB_COMPONENT_TBL;
l_error_message_list Error_handler.error_tbl_type;
l_x_bom_header_rec Bom_Bo_Pub.bom_Head_Rec_Type;
l_x_bom_revision_tbl Bom_Bo_Pub.Bom_Revision_Tbl_Type;
l_x_bom_component_tbl Bom_Bo_pub.Bom_Comps_Tbl_Type;
l_x_bom_ref_designator_tbl Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type;
l_x_bom_sub_component_tbl Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type;
l_x_return_status VARCHAR2(2000);
l_x_msg_count NUMBER;
l_Err_Msg VARCHAR2(2000);
l_Error_Code NUMBER := 0;
i NUMBER;
j NUMBER;
v_item_name varchar2(1000);
a number ;
b number;
procedure p (s varchar2) is begin dbms_output.put (s); end p;
procedure pl (s varchar2) is begin dbms_output.put_line (s); end pl;
begin
FND_GLOBAL.APPS_INITIALIZE(USER_ID=>21927,RESP_ID=>50255,RESP_APPL_ID=>702);
l_organization_code :='DHV';
l_assembly_item_name := '30131-40007-10';
BOMPXINQ.Export_BOM(
P_org_hierarchy_name => l_org_hierarchy_name,
P_assembly_item_name => l_assembly_item_name,
P_organization_code => l_organization_code,
P_alternate_bm_designator => '1Test',
P_Costs => l_costs,
P_Cost_type_id => l_cost_type_id,
X_bom_header_tbl => l_bom_header_tbl,
X_bom_revisions_tbl => l_bom_revisions_tbl,
X_bom_components_tbl => l_bom_components_tbl,
X_bom_ref_designators_tbl => l_bom_ref_designators_tbl,
X_bom_sub_components_tbl => l_bom_sub_components_tbl,
X_bom_comp_ops_tbl => l_bom_comp_ops_tbl,
X_Err_Msg => l_Err_Msg,
X_Error_Code => l_Error_Code);
pl('Export_BOM for assembly item: ' || l_assembly_item_name);
pl(chr(10));
if l_Error_Code = 0 then
LOOP
for i in 1 .. l_bom_header_tbl.COUNT LOOP
--- pl('Header Record: ' || i);
V_bom_header_tbl(i).organization_code :='DSC';
v_item_name := l_bom_header_tbl(i).assembly_item_name;
V_bom_header_tbl(i).assembly_item_name:= v_item_name;
V_bom_header_tbl(i).alternate_bom_code :=NULL;
V_bom_header_tbl(i).Assembly_type := 1;
V_bom_header_tbl(i).Transaction_Type := 'CREATE';
V_bom_header_tbl(i).Return_Status := NULL;
for j in 1 .. l_bom_components_tbl.COUNT LOOP
if l_bom_header_tbl(i).organization_code = l_bom_components_tbl(j).organization_code and
l_bom_header_tbl(i).assembly_item_name = l_bom_components_tbl(j).assembly_item_name then
v_bom_components_tbl(j).organization_code :='DSC';
v_bom_components_tbl(j).Assembly_Item_name := l_bom_components_tbl(j).Assembly_Item_name ;
v_bom_components_tbl(j).Start_effective_date :=sysdate;
v_bom_components_tbl(j).Component_Item_Name := l_bom_components_tbl(j).Component_Item_Name;
v_bom_components_tbl(j).Transaction_Type := 'CREATE';
v_bom_components_tbl(j).Item_Sequence_Number :=l_bom_components_tbl(j).Item_Sequence_Number;
v_bom_components_tbl(j).alternate_bom_code:=NULL;
V_bom_components_tbl(j).Operation_Sequence_Number:=l_bom_components_tbl(j).Operation_Sequence_Number;
end if;
end LOOP;
pl(chr(10));
end LOOP;
bom_bo_pub.Process_Bom
( p_bo_identifier => 'BOM'
, p_api_version_number => 1.0
, p_init_msg_list => TRUE
, p_bom_header_rec => V_bom_header_tbl
, p_bom_revision_tbl => V_bom_revisions_tbl
, p_bom_component_tbl => V_bom_components_tbl
, p_bom_ref_designator_tbl => V_bom_ref_designators_tbl
, p_bom_sub_component_tbl => V_bom_sub_components_tbl
, x_bom_header_rec => l_x_bom_header_rec
, x_bom_revision_tbl => l_x_bom_revision_tbl
, x_bom_component_tbl => l_x_bom_component_tbl
, x_bom_ref_designator_tbl => l_x_bom_ref_designator_tbl
, x_bom_sub_component_tbl => l_x_bom_sub_component_tbl
, x_return_status => l_x_return_status
, x_msg_count => l_x_msg_count
, p_debug => 'N'
, p_output_dir => ''
, p_debug_filename => ''
);
dbms_output.put_line('Return Status = '||l_x_return_status);
dbms_output.put_line('Message Count = '||l_x_msg_count);
Error_Handler.Get_message_list(l_error_message_list);
if l_x_return_status 'S'
then
-- Error Processing
for i in 1..l_x_msg_count loop
dbms_output.put_line(TO_CHAR(i)||' MESSAGE TEXT '||SUBSTR(l_error_message_list(i).message_text,1,250));
dbms_output.put_line(TO_CHAR(i)||' MESSAGE TYPE '||l_error_message_list(i).message_type);
end loop;
rollback;
else
commit;
end if;
end loop;
else
pl('Failed to export BOM: ' || l_assembly_item_name);
pl('Error Code=' || l_Error_Code);
pl('Error Msg =' || l_Err_Msg);
end if;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLERRM||SQLCODE);
RAISE;
end;
/

Dequeue with PL/SQL to table

Hi,
so I have my type, enad my queue, but from all examples I can find in ORacle docs is to put the DBMS_OUTPUT.PUT_LINE.
I would like to dequeue the messages to a database table, but how?
I guess it is simple, but still I need the help.
My question number to is this: how does the subscriber know that it has a new message, and how do I get my procedure to execute based on a new message?
Thanks
Dequeue Message
declare
d_opt DBMS_AQ.dequeue_options_t;
m_prop DBMS_AQ.message_properties_t;
m_handle RAW(16);
message ANYDATA;
obj fun_silly_type;
ret pls_integer;
begin
-- --Buffered Message Flags
-- d_opt.delivery_mode := DBMS_AQ.buffered;
-- d_opt.visibility := DBMS_AQ.immediate;
d_opt.navigation := DBMS_AQ.first_message;
d_opt.consumer_name := 'sub1';
d_opt.wait := DBMS_AQ.no_wait;
DBMS_AQ.dequeue(
queue_name=>'fun_silly_q',
dequeue_options=>d_opt,
message_properties=>m_prop,
payload=>message,
msgid=>m_handle);
ret := message.getobject(obj=>obj );
-- Output Object Information
DBMS_OUTPUT.put_line('Stuff: '||obj.fun|| ' and ' ||obj.silly);
commit;
end; / 
See example:
http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96587/qsample.htm#66552
CONNECT boladm/boladm;
/* Create procedures to dequeue RUSH orders */
create or replace procedure get_rushtitles(consumer in varchar2) as
deq_cust_data BOLADM.customer_typ;
deq_book_data BOLADM.book_typ;
deq_item_data BOLADM.orderitem_typ;
deq_msgid RAW(16);
dopt dbms_aq.dequeue_options_t;
mprop dbms_aq.message_properties_t;
deq_order_data BOLADM.order_typ;
qname varchar2(30);
no_messages exception;
pragma exception_init (no_messages, -25228);
new_orders BOOLEAN := TRUE;
begin
dopt.consumer_name := consumer;
dopt.wait := 1;
dopt.correlation := 'RUSH';
IF (consumer = 'West_Shipping') THEN
qname := 'WS.WS_bookedorders_que';
ELSIF (consumer = 'East_Shipping') THEN
qname := 'ES.ES_bookedorders_que';
ELSE
qname := 'OS.OS_bookedorders_que';
END IF;
WHILE (new_orders) LOOP
BEGIN
dbms_aq.dequeue(
queue_name => qname,
dequeue_options => dopt,
message_properties => mprop,
payload => deq_order_data,
msgid => deq_msgid);
commit;
deq_item_data := deq_order_data.items(1);
deq_book_data := deq_item_data.item;
dbms_output.put_line(' rushorder book_title: ' ||
deq_book_data.title ||
' quantity: ' || deq_item_data.quantity);
EXCEPTION
WHEN no_messages THEN
dbms_output.put_line (' ---- NO MORE RUSH TITLES ---- ');
new_orders := FALSE;
END;
END LOOP;
end;
/ 
Great, thank you, but instead of
dbms_output.put_line(' rushorder book_title: ' ||
deq_book_data.title ||
' quantity: ' || deq_item_data.quantity);
How can I write the data from the AQ to a database table?
Regards
Kjersti 
Sure,
just put here
INSERT INTO TABLE_NAME
VALUES (...)
Sergey Rodionov. 
Great!
Better to be sure ;o)
Taanks again,
and the link you gave me with examples was excellent! Even though I searched 100 of times on Oracle and Google, I never found that site....
Regards,
Kjersti 
Kjersti,
Great thing that dequeue and insert will be in one transaction. So you will never lost messages.
There is one intersting thing: You can create APPLY process for messages dequeuing... So message will be dequeued as soon as message arrived to AQ.
Regards,
Sergey 
Hi again Sergey,
thanks for the tip with APPLY process, do you have any examples on how I can implement such a process?
That would be excellent actually, and just what I need...
Kjersti ;) 
You should be able to find example in same docs.
You just need to create DML handle
and apply process for this queue and messages handler.
I used this configuration several times for different projects without any problems.
SergeR 
something like
!!!! Apply name should be the same like subscriber name.
DBMS_APPLY_ADM.CREATE_APPLY(
queue_name IN VARCHAR2,
apply_name IN VARCHAR2,
message_handler IN VARCHAR2 DEFAULT NULL,
apply_user IN VARCHAR2 DEFAULT NULL );
You can find example of message_handler in docs or metalink

Error while creating Project using API - PA_PROJECT_PUB.CREATE_PROJECT

I am working on Projects conversion and currently trying to create a project using the API.
I have recetified all the errors it was giving and struck at 1 error. please find the error message below.
"You have submitted invalid parameters to this process, preventing its successful completion. Please contact your system administrator."
It gives me this error and I was not able to know the cause for this error. Please let me know how to bypass this error and go ahead with projects conversion???
Attached below is my package:
Thanks,
Kesava
=====================================================================================================================
CREATE OR REPLACE PACKAGE xxbwp.xxbwp_pa_proj_conv_pkg AUTHID CURRENT_USER
IS
     PROCEDURE xxbwp_pa_proj_conv_proc(errbuf           OUT      VARCHAR2
                         ,retcode           OUT      VARCHAR2);
END xxbwp_pa_proj_conv_pkg;
/
CREATE OR REPLACE PACKAGE BODY xxbwp.xxbwp_pa_proj_conv_pkg
IS
     PROCEDURE xxbwp_pa_proj_conv_proc(errbuf           OUT      VARCHAR2
                         ,retcode           OUT      VARCHAR2)
     IS
v_data VARCHAR2(2000);
v_index_out NUMBER;
     v_msg_count               NUMBER;
     v_msg_data               VARCHAR2(2000);
     v_return_status               VARCHAR2(1);
     v_api_version_number          NUMBER          :=     1.0;
     v_commit               VARCHAR2(1)     :=     apps.fnd_api.g_false;
     v_init_msg_list               VARCHAR2(1)     :=      apps.fnd_api.g_false;
     v_workflow_started          VARCHAR2(1)      :=      'Y';
     v_pm_product_code          VARCHAR2(30)      :=      NULL;
     v_op_validate_flag          VARCHAR2(1)      :=      'Y';
     v_project_in               apps.pa_project_pub.project_in_rec_type;
     v_project_out               apps.pa_project_pub.project_out_rec_type;
     v_customers_in               apps.pa_project_pub.customer_tbl_type;
     v_key_members               apps.pa_project_pub.project_role_tbl_type;
     v_class_categories          apps.pa_project_pub.class_category_tbl_type;
     v_tasks_in               apps.pa_project_pub.task_in_tbl_type;
     v_tasks_in_rec apps.pa_project_pub.task_in_rec_type;
v_tasks_out               apps.pa_project_pub.task_out_tbl_type;
     v_org_roles               apps.pa_project_pub.project_role_tbl_type;
     v_structure_in               apps.pa_project_pub.structure_in_rec_type;
     v_ext_attr_tbl_in          apps.pa_project_pub.pa_ext_attr_table_type;
     v_deliverables_in          apps.pa_project_pub.deliverable_in_tbl_type;
     v_deliverable_actions_in     apps.pa_project_pub.action_in_tbl_type;
-- Variables declaration related to project_in_rec_type
l_pm_project_reference VARCHAR2(25);
l_pa_project_id NUMBER;
l_pa_project_number VARCHAR2(25);
l_segment1 VARCHAR2(25);
l_project_name VARCHAR2(30);
l_description VARCHAR2(250);
l_long_name VARCHAR2(240);
l_department_mapping VARCHAR2(50);
l_department_mapping_c VARCHAR2(50);
l_department_mapping_e VARCHAR2(50);
l_created_from_project_id NUMBER;
l_carrying_out_organization_id NUMBER;
l_proj_start_date DATE;
l_completion_date DATE;
l_temp_project_type VARCHAR2(30);
l_company_id VARCHAR2(10);
l_company_id_c VARCHAR2(10);
l_company_id_e VARCHAR2(10);
l_proj_type VARCHAR2(30);
l_cnt NUMBER := 0;
l_task_cnt NUMBER := 0;
l_responsibility_id NUMBER;
l_application_id NUMBER;
l_user_id NUMBER;
l_global_info_msg_count NUMBER;
l_global_info_msg_data VARCHAR2(2000);
l_global_info_return_status VARCHAR2(1);
CURSOR C1 IS
SELECT *
FROM xxbwp.xxbwp_pa_proj_conv_tbl
WHERE proj_type = 'STORAGE';
begin
FOR C1_REC in C1
LOOP
SELECT APPS.pa_projects_s.nextval
INTO l_pa_project_id
FROM DUAL;
BEGIN
SELECT description
               INTO     l_proj_type
               FROM apps.fnd_lookup_values
               WHERE lookup_type = 'BWP_PROJECT_TYPES_LKP'
               AND     lookup_code = C1_REC.proj_type
               AND     1 = 1;
END;
BEGIN
SELECT project_id, project_type, carrying_out_organization_id
INTO l_created_from_project_id, l_temp_project_type, l_carrying_out_organization_id
FROM apps.pa_projects_all
WHERE project_type = l_proj_type
AND template_flag = 'Y';
END;
BEGIN
SELECT rt.responsibility_id, rt.application_id
INTO l_responsibility_id, l_application_id
FROM apps.fnd_responsibility_tl rt
WHERE rt.responsibility_name = 'BWP PA Projects Superuser';
EXCEPTION WHEN OTHERS THEN
RETURN;
END;
BEGIN
SELECT u.user_id
INTO l_user_id
FROM APPS.fnd_user u
WHERE u.user_name = 'CHUNDURK';
EXCEPTION WHEN OTHERS THEN
RETURN;
END;
-- Set the environment
APPS.pa_interface_utils_pub.set_global_info
(p_api_version_number => 1.0
,p_responsibility_id => l_responsibility_id
,p_user_id => l_user_id
,p_resp_appl_id => l_application_id
,p_msg_count => l_global_info_msg_count
,p_msg_data => l_global_info_msg_data
,p_return_status => l_global_info_return_status);
--Assign values to project_in_rec_type
v_project_in.pm_project_reference := C1_REC.PROJ_NUM;
v_project_in.pa_project_id := l_pa_project_id;
v_project_in.pa_project_number := C1_REC.PROJ_NUM;
v_project_in.project_name := C1_REC.PROJ_NAME;
v_project_in.description := NULL;
v_project_in.long_name := C1_REC.PROJ_LONG_NAME;
v_project_in.created_from_project_id := l_created_from_project_id;
v_project_in.carrying_out_organization_id := l_carrying_out_organization_id;
v_project_in.start_date := C1_REC.trans_start_date;
v_project_in.completion_date := C1_REC.trans_end_date;
v_project_in.scheduled_start_date := C1_REC.trans_start_date;
v_project_in.scheduled_finish_date := C1_REC.trans_end_date;
v_project_in.project_status_code := 'APPROVED';
FOR x IN (SELECT person_id, project_role_type, start_date_active, end_date_active
FROM apps.pa_project_players
WHERE project_id = 262)
LOOP
APPS.fnd_file.put_line(APPS.FND_FILE.LOG,'PERSON ID '||x.person_id);
APPS.fnd_file.put_line(APPS.FND_FILE.LOG,'PROJECT ROLE TYPE '||x.project_role_type);
l_cnt := l_cnt + 1;
v_key_members(l_cnt).person_id := x.person_id;
v_key_members(l_cnt).project_role_type := x.project_role_type;
v_key_members(l_cnt).start_date := x.start_date_active;
v_key_members(l_cnt).end_date := x.end_date_active;
END LOOP;
-- Retrieving and assigning tasks from template to a project
FOR x IN (SELECT task_id, parent_task_id, task_name, long_task_name, task_number, description,
billable_flag, cint_eligible_flag, chargeable_flag
FROM apps.pa_tasks t
WHERE t.project_id = l_created_from_project_id
START WITH parent_task_id IS NULL CONNECT BY PRIOR task_id = parent_task_id)
LOOP
l_task_cnt := l_task_cnt + 1;
v_tasks_in_rec.pm_task_reference := x.task_id;
v_tasks_in_rec.task_name := x.task_name;
v_tasks_in_rec.long_task_name := x.long_task_name;
v_tasks_in_rec.pa_task_number := x.task_number;
v_tasks_in_rec.task_description := x.description;
v_tasks_in_rec.task_start_date := C1_REC.trans_start_date;
v_tasks_in_rec.task_completion_date := C1_REC.trans_end_date;
v_tasks_in_rec.scheduled_start_date := C1_REC.trans_start_date;
v_tasks_in_rec.scheduled_finish_date := C1_REC.trans_end_date;
v_tasks_in_rec.pm_parent_task_reference := x.parent_task_id;
v_tasks_in_rec.billable_flag := x.billable_flag;
v_tasks_in_rec.cint_eligible_flag := x.cint_eligible_flag;
v_tasks_in_rec.chargeable_flag := x.chargeable_flag;
v_tasks_in_rec.tasks_dff := 'Y';
v_tasks_in_rec.attribute1 := l_pa_project_id;
v_tasks_in(l_task_cnt) := v_tasks_in_rec;
END LOOP;
v_class_categories(0).class_category := 'Reimbursable';
v_class_categories(0).class_code := 'No';
APPS.FND_MSG_PUB.initialize;
apps.pa_project_pub.create_project
(p_api_version_number => v_api_version_number
,p_commit => v_commit
,p_init_msg_list => v_init_msg_list
,p_msg_count => v_msg_count
,p_msg_data => v_msg_data
,p_return_status => v_return_status
,p_workflow_started => v_workflow_started
,p_pm_product_code => v_pm_product_code
,p_op_validate_flag => v_op_validate_flag
,p_project_in => v_project_in
,p_project_out => v_project_out
,p_customers_in => v_customers_in
,p_key_members => v_key_members
,p_class_categories => v_class_categories
,p_tasks_in => v_tasks_in
,p_tasks_out => v_tasks_out
,p_org_roles => v_org_roles
,p_structure_in => v_structure_in
,p_ext_attr_tbl_in => v_ext_attr_tbl_in
,p_deliverables_in => v_deliverables_in
,p_deliverable_actions_in => v_deliverable_actions_in
);
APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_return_status||' '||v_msg_count);
IF v_msg_count > 0 THEN
FOR i in 1 .. v_msg_count
LOOP
apps.pa_interface_utils_pub.get_messages
(p_encoded => 'F'
,p_msg_count => v_msg_count
,p_msg_index => i
,p_msg_data => v_msg_data
,p_data => v_data
,p_msg_index_out => v_index_out);
APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_data);
END LOOP;
END IF;
END LOOP;
end xxbwp_pa_proj_conv_proc;
end xxbwp_pa_proj_conv_pkg;
/
show errors;
Edited by: user644005 on Sep 11, 2009 11:02 AM 
Pl see if MOS Doc 315668.1 (AMG Invalid Parameters Error Calling PA_PROJECT_PUB.Create_Project) is applicable in your case
HTH
Srini 
Hi,
Please see if the sample code in (Note: 206389.1 - Sample Script to create a project using AMG with composite datatypes) helps.
Regards,
Hussein 
Hey Srini,
Thanks for the reply.
I am actually passing NULL to p_pm_product_code parameter.
I tried passing 'CONVERSION','CONVERT','CONV','conv','convert','conversion'.
But it doesn't allow me to pass any of these values. It errors out saying: "Please enter a valid product code for this project."
Please suggest???
Thanks,
Kesava
Edited by: user644005 on Sep 11, 2009 2:17 PM 
Hi Hussein,
Thanks for the response.
I have compared my code against the code provided by you, Its almost similar and doesn't have much variations.
Thanks,
Kesava 
Hi Srini,
Thanks for the same.
I've discovered the solution.
I have digged down into the API code and have found that the PRODUCT_CODE only accepts those LOOKUP_CODEs that are defined in PA_LOOKUPS.
I tried using one among those LOOKUP_CODEs defined and it works fine and has created the project successfully.
Thanks a lot for your help.
Thanks,
Kesava 
Thanks for sharing the solution
Srini 
Hi Kesava,
I notice that in the package you used the application user_name=CHUNDUK calls the API pa_project_pub.create_project.
I wonder if you used chunduk as database user to execute the package Or you used APPS to execute the package?
The APi document states that it is a requirement to create a db username as the same name with the application username.
I have been running the problem to execute API 's delete project and try to figure what could be my problem.
TIA

Using AP_CANCEL_PKG.IS_INVOICE_CANCELLABLE not return v_error_code

Hello,
I'm using function AP_CANCEL_PKG.IS_INVOICE_CANCELLABLE to check if we can canceled some invoice.
Here is our code :
SET SERVEROUTPUT ON SIZE 100000;
DECLARE
v_boolean BOOLEAN;
v_error_code VARCHAR2(100);
v_debug_info VARCHAR2(1000);
P_inv_id NUMBER;
begin
P_inv_id := 7966021;
v_boolean :=AP_CANCEL_PKG.IS_INVOICE_CANCELLABLE(
P_invoice_id => p_inv_id,
P_error_code => v_error_code,
P_debug_info => v_debug_info,
P_calling_sequence => NULL);
IF v_boolean=TRUE
THEN
DBMS_OUTPUT.put_line ('Invoice '||p_inv_id|| ' is cancellable' );
ELSE
DBMS_OUTPUT.put_line ('Invoice '||p_inv_id|| ' is not cancellable :'|| v_error_code );
END IF;
End;
RESULT :
Invoice 7966021 is not cancellable :
There is no v_error_code return by function. in fact there is certainly an error_code but it seems that i can't display/use it.
Can you help to use v_error_code please ?
Thx
Regards

portal

I created one Form in Portal,In this
form i have S_NO as a field.
In the footer ,buttons are there,if i
click the reset button i want to increment the serial no,so i wrote one pl/sql
procedure using PL/SQL Event Handler in the
Reset Event.This is my procedure
declare
serial_no number;
value varchar2(32767);
begin
select max(s_no) into serial_no from feeds;
if value='reset' then
doReset;
serial_no:=serial_no + 1;
htp.p(''); //here,i don't know do use the 'htp' package //
end if;
end;
here, i want to display this s_no directly
into the filed s_no,how do i publish the
result of the above procedure in the portal form.
null 
Ramola
U can use api here
Please find example
declare
serial_no number;
value varchar2(32767);
v_language varchar2(100);
begin
v_language:=PIB30.wwctx_api.get_nls_language;
select max(s_no) into serial_no from feeds;
if value='reset' then
doReset;
serial_no:=serial_no + 1;
htp.p(''); //here,i don't know do use the 'htp' package //
p_session.set_value_as_string(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_FIELDNAME',
p_value => serial_no,
p_language => v_language
);
end if;
end;
Here value for parameter p_attribute_name should have prefix as "A_" and if u don't have master detail form then p_block should have value as "DEFAULT"
Hope it will solve ur problem
Good Luck
Let me know if it solves
Regards
Yogesh Dahale
Mastek Ltd
null

Categories

Resources