Vous êtes sur la page 1sur 4

12/14/2016

OracleApplications:PA_PROJECT_PUB.CREATE_PROJECTCreatingProject,TaskandChildTaskwithAPI

Home

AP

AR

GL

INV

PO

OM

HR

PA

FAQS

SCRIPTS

PLSQL

TECH

OAF

CLOUD

WEDNESDAY,OCTOBER7,2015

PA_PROJECT_PUB.CREATE_PROJECT
PA_PROJECT_PUB.CREATE_PROJECTCreatingProject,TaskandChildTaskwithAPI
DECLARE
jNUMBER:=0
kNUMBER:=0
>APIstandardparameters
l_msg_countNUMBER
l_msg_dataVARCHAR2(2000)
l_return_statusVARCHAR2(1)
l_api_version_numberNUMBER:=1.0
l_commitVARCHAR2(1):='T'
l_init_msg_listVARCHAR2(1):='F'
l_workflow_statusVARCHAR2(1):='Y'
l_msg_index_outNUMBER
l_dataVARCHAR2(2000)
l_outputVARCHAR2(2000)
l_msg_dummyVARCHAR2(2000)
>COMPOSITEDATATYPES
l_project_inPA_PROJECT_PUB.PROJECT_IN_REC_TYPE
l_project_outPA_PROJECT_PUB.project_out_rec_type
l_key_membersPA_PROJECT_PUB.project_role_tbl_type
l_class_categoriesPA_PROJECT_PUB.class_category_tbl_type
l_task_inPA_PROJECT_PUB.task_in_tbl_type
l_tasks_outPA_PROJECT_PUB.task_out_tbl_type
l_task_in_recPA_PROJECT_PUB.task_in_rec_type

l_person_idNUMBER:=257
l_pm_product_codeVARCHAR2(20):='GMS'
l_project_idNUMBER:=19767
l_organization_idNUMBER:=121
l_project_role_typeVARCHAR2(20):='PROJECTMANAGER'
p_project_numberVARCHAR2(20):=TO_CHAR(SYSDATE,'DDMONRRRR:HH24MISS')
>variablesneededfortheuser_idandresponsibility_id
l_user_idNUMBER
l_responsibility_idNUMBER

CURSORC1
IS
SELECTTask_id,
TASK_NUMBER,
TASK_NAME,
TOP_TASK_ID,
PROJECT_ID,
WBS_LEVEL
FROMpa_tasks
WHERE1=1
ANDproject_id=19767
andWBS_LEVELin=1

CURSORC2
IS
SELECTTask_id,
TASK_NUMBER,
TASK_NAME,

http://oracleapps88.blogspot.com/2015/10/paprojectpubcreateprojectcreating.html

1/4

12/14/2016

OracleApplications:PA_PROJECT_PUB.CREATE_PROJECTCreatingProject,TaskandChildTaskwithAPI

TOP_TASK_ID,
PROJECT_ID,
WBS_LEVEL
FROMpa_tasks
WHERE1=1
ANDproject_id=19767
andWBS_LEVELin=2

CURSORC3
IS
selectpapp.RESOURCE_SOURCE_ID,pprtt.PROJECT_ROLE_TYPE
frompa_project_partiespapp,pa_project_role_typespprtt
where1=1
ANDpprtt.project_role_id=papp.project_role_id
andpapp.project_id=19767
Andpapp.resource_type_id=101
andsysdatebetweenpapp.start_date_activeandnvl(papp.end_date_active,SYSDATE)

BEGIN
>>=============================================================================================
GETGLOBALINFO
SELECTuser_id,responsibility_id
INTOl_user_id,l_responsibility_id
FROMpa_user_resp_v
WHEREuser_name='RCHINTHAPATLA'
andRESPONSIBILITY_name='ProjectBillingSuperUser'
SETGLOBALINFO
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_msg_count=>l_msg_count,
p_msg_data=>l_msg_data,
p_return_status=>l_return_status
)
>>=============================================================================================
>PRODUCTRELATEDDATA
l_project_in.pm_project_reference:=p_project_number
l_project_in.project_name:=p_project_number
l_project_in.pa_project_number:=p_project_number
l_project_in.created_from_project_id:=l_project_id
l_project_in.carrying_out_organization_id:=l_organization_id
l_project_in.public_sector_flag:='N'
l_project_in.project_status_code:='UNAPPROVED'
l_project_in.description:=p_project_number
l_project_in.start_date:=SYSDATE
l_project_in.completion_date:=SYSDATE+60

/*
l_key_members(1).person_id:=l_person_id
l_key_members(1).project_role_type:=l_project_role_type
l_key_members(1).start_date:=SYSDATE
*/
/*
BEGIN
FORiINC3
LOOP
BEGIN
k:=k+1
l_key_members(k).person_id:=i.resource_source_id
l_key_members(k).project_role_type:=i.project_role_type
l_key_members(k).start_date:=SYSDATE
END
ENDLOOP
END
*/
>Thisisjustasetofloopingstructurestocreatethetasksandsubtasks
j:=0
FORp_taskINC1
LOOP
j:=j+1

http://oracleapps88.blogspot.com/2015/10/paprojectpubcreateprojectcreating.html

2/4

12/14/2016

OracleApplications:PA_PROJECT_PUB.CREATE_PROJECTCreatingProject,TaskandChildTaskwithAPI

l_task_in_rec.pm_task_reference:=p_task.TASK_NUMBER
l_task_in_rec.task_name:=p_task.TASK_NUMBER
l_task_in_rec.task_start_date:=SYSDATE+1
l_task_in_rec.task_completion_date:=SYSDATE+60
l_task_in_rec.actual_start_date:=''
l_task_in_rec.actual_finish_date:=''
l_task_in_rec.early_start_date:=''
l_task_in_rec.early_finish_date:=''
l_task_in_rec.late_start_date:=''
l_task_in_rec.late_finish_date:=''
L_TASK_IN(J):=L_TASK_IN_REC
FORc_taskINC2
LOOP
j:=j+1
l_task_in_rec.pm_task_reference:=c_task.TASK_NUMBER
l_task_in_rec.task_name:=c_task.TASK_NUMBER
l_task_in_rec.pm_parent_task_reference:=p_task.TASK_NUMBER
L_TASK_IN(J):=L_TASK_IN_REC
ENDLOOP>ChildTaskLoop
ENDLOOP>ParentTaskLoop
>INITIALIZEPROJECT
PA_PROJECT_PUB.INIT_PROJECT
>=======================================================================================================
>CREATINGPROJECT
PA_PROJECT_PUB
PA_PROJECT_PUB.
.CREATE_PROJECT
(
p_api_version_number=>l_api_version_number,
p_commit=>l_commit,
p_init_msg_list=>l_init_msg_list,
p_msg_count=>l_msg_count,
p_msg_data=>l_msg_data,
p_return_status=>l_return_status,
p_workflow_started=>l_workflow_status,
p_pm_product_code=>l_pm_product_code,
p_project_in=>l_project_in,
p_project_out=>l_project_out,
p_key_members=>l_key_members,
p_class_categories=>l_class_categories,
p_tasks_in=>l_task_in,
p_tasks_out=>l_tasks_out
)
IFl_return_status='S'
THEN
DBMS_OUTPUT.put_line('ProjectID='||l_project_out.pa_project_id||'ProjectNumber='||
l_project_out.pa_project_number)
FORIIN1..l_task_in.COUNT
LOOP
DBMS_OUTPUT.put_line('ReturnStatus='||l_tasks_out(i).return_status||'TaskId='||l_tasks_out(i).pa_task_id||
TaskRef='||l_tasks_out(i).pm_task_reference)
ENDLOOP
ELSE
FORnIN1..l_msg_count
LOOP
fnd_msg_pub.get(n,fnd_api.g_false,l_msg_data,l_msg_dummy)
l_output:=(TO_CHAR(n)||':'||l_msg_data)
DBMS_OUTPUT.PUT_LINE('APIErrorwhileCREATE_PROJECT:'||l_output||''||SQLERRM)
ENDLOOP
ENDIF
>=======================================================================================================
HANDLEEXCEPTIONS
EXCEPTION
WHENOTHERS
THEN
FORiIN1..l_msg_count
LOOP
PA_INTERFACE_UTILS_PUB.GET_MESSAGES(p_msg_data=>l_msg_data,
p_data=>l_data,
p_msg_count=>l_msg_count,
p_msg_index_out=>l_msg_index_out
)
DBMS_OUTPUT.put_line('ErrorMsg2:'||l_data)
DBMS_OUTPUT.put_line('ErrorMsg2:'||l_msg_data)

http://oracleapps88.blogspot.com/2015/10/paprojectpubcreateprojectcreating.html

3/4

12/14/2016

OracleApplications:PA_PROJECT_PUB.CREATE_PROJECTCreatingProject,TaskandChildTaskwithAPI

ENDLOOP
DBMS_OUTPUT.put_line('Anerroroccuredwhilecreatingproject,SQLCODE>'||SQLERRM)
END
>=======================================================================================================

BestBloggerGadgets
PostedbyRajuChinthapatlaat2:51:00AM

+1 Recommend this on Google

Labels:API,CONVERSIONS,PA ,SCRIPTS

2comments:
generalmanagersaid...
Goodshareaboutoracle,
MarkHurd
October17,2015at11:49PM

Unknownsaid...
Thankyou...
August3,2016at3:18PM

PostaComment

Enteryourcomment...

Commentas:

Publish

Unknown(Google)

Signout

Notifyme

Preview

Linkstothispost
CreateaLink

NewerPost

Home

OlderPost

Subscribeto:PostComments(Atom)

Email:OracleApps88@Yahoo.Com.PictureWindowtemplate.Templateimagesbykonradlew.PoweredbyBlogger.

GetFlowerEffect

http://oracleapps88.blogspot.com/2015/10/paprojectpubcreateprojectcreating.html

4/4