Monday, 29 December 2014
Sunday, 30 November 2014
API - Supplier & Supplier Site Creation
API - Supplier & Supplier Site Creation
declare
l_vendor_rec AP_VENDOR_PUB_PKG.r_vendor_rec_type;
l_vendor_site_rec AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
l_upd number := 0;
x_vendor_id number;
x_party_id number;
x_vendor_site_id number;
x_party_site_id number;
x_location_id number;
l_party_site_id number;
l_organization_id number;
begin
--mo_global.set_policy_context('S',1650);
l_vendor_rec.SEGMENT1 := '1234577';
l_vendor_rec.VENDOR_NAME := 'TESTSUPPLIER';
l_vendor_rec.SUMMARY_FLAG := 'N';
l_vendor_rec.ENABLED_FLAG := 'Y';
AP_VENDOR_PUB_PKG.Create_Vendor
( p_api_version => 1,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_vendor_rec => l_vendor_rec,
x_vendor_id => x_vendor_id,
x_party_id => x_party_id
);
if (x_return_status <> 'S') then
dbms_output.put_line('Encountered ERROR in supplier creation!!!');
dbms_output.put_line('--------------------------------------');
dbms_output.put_line(x_msg_data);
IF x_msg_count > 1 THEN
FOR i IN 1..x_msg_count LOOP
dbms_output.put_line(substr(FND_MSG_PUB.Get( p_encoded => FND_API.G_FALSE ),1,255));
END LOOP;
END IF;
else
l_vendor_site_rec.vendor_id := x_vendor_id;
l_vendor_site_rec.VENDOR_SITE_CODE := 'HOME';
l_vendor_site_rec.org_id := 1650;
l_vendor_site_rec.COUNTRY := 'AE';
l_vendor_site_rec.ADDRESS_LINE1 :='Abu Dhabi';
l_vendor_site_rec.PURCHASING_SITE_FLAG := 'Y';
l_vendor_site_rec.PAY_SITE_FLAG := 'Y';
AP_VENDOR_PUB_PKG.Create_Vendor_Site
( p_api_version => 1,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_vendor_site_rec => l_vendor_site_rec,
x_vendor_site_id => x_vendor_site_id,
x_party_site_id => x_party_site_id,
x_location_id => x_location_id
);
if (x_return_status <> 'S') then
dbms_output.put_line('Encountered ERROR in supplier site creation!!!');
dbms_output.put_line('--------------------------------------');
dbms_output.put_line(x_msg_data);
IF x_msg_count > 1 THEN
FOR i IN 1..x_msg_count LOOP
dbms_output.put_line(substr(FND_MSG_PUB.Get( p_encoded => FND_API.G_FALSE ),1,255));
END LOOP;
END IF;
ELSE
dbms_output.put_line('Supplier Site Created!!!');
end if;
end if;
end;
l_vendor_rec AP_VENDOR_PUB_PKG.r_vendor_rec_type;
l_vendor_site_rec AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
l_upd number := 0;
x_vendor_id number;
x_party_id number;
x_vendor_site_id number;
x_party_site_id number;
x_location_id number;
l_party_site_id number;
l_organization_id number;
begin
--mo_global.set_policy_context('S',1650);
l_vendor_rec.SEGMENT1 := '1234577';
l_vendor_rec.VENDOR_NAME := 'TESTSUPPLIER';
l_vendor_rec.SUMMARY_FLAG := 'N';
l_vendor_rec.ENABLED_FLAG := 'Y';
AP_VENDOR_PUB_PKG.Create_Vendor
( p_api_version => 1,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_vendor_rec => l_vendor_rec,
x_vendor_id => x_vendor_id,
x_party_id => x_party_id
);
if (x_return_status <> 'S') then
dbms_output.put_line('Encountered ERROR in supplier creation!!!');
dbms_output.put_line('--------------------------------------');
dbms_output.put_line(x_msg_data);
IF x_msg_count > 1 THEN
FOR i IN 1..x_msg_count LOOP
dbms_output.put_line(substr(FND_MSG_PUB.Get( p_encoded => FND_API.G_FALSE ),1,255));
END LOOP;
END IF;
else
l_vendor_site_rec.vendor_id := x_vendor_id;
l_vendor_site_rec.VENDOR_SITE_CODE := 'HOME';
l_vendor_site_rec.org_id := 1650;
l_vendor_site_rec.COUNTRY := 'AE';
l_vendor_site_rec.ADDRESS_LINE1 :='Abu Dhabi';
l_vendor_site_rec.PURCHASING_SITE_FLAG := 'Y';
l_vendor_site_rec.PAY_SITE_FLAG := 'Y';
AP_VENDOR_PUB_PKG.Create_Vendor_Site
( p_api_version => 1,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_vendor_site_rec => l_vendor_site_rec,
x_vendor_site_id => x_vendor_site_id,
x_party_site_id => x_party_site_id,
x_location_id => x_location_id
);
if (x_return_status <> 'S') then
dbms_output.put_line('Encountered ERROR in supplier site creation!!!');
dbms_output.put_line('--------------------------------------');
dbms_output.put_line(x_msg_data);
IF x_msg_count > 1 THEN
FOR i IN 1..x_msg_count LOOP
dbms_output.put_line(substr(FND_MSG_PUB.Get( p_encoded => FND_API.G_FALSE ),1,255));
END LOOP;
END IF;
ELSE
dbms_output.put_line('Supplier Site Created!!!');
end if;
end if;
end;
Tuesday, 25 November 2014
Create XML Publisher report without RDF
Create
XML Publisher report without RDF
Create Oracle Report in just
4 simple easy steps.
1. Create Concurrent Program by using standard
Executable ‘XDODTEXE’
Pls note: XDODTEXE is XML Publisher Data Template Executable
Pls note: XDODTEXE is XML Publisher Data Template Executable
2. Create XML file based on below sample layout
Pls note: It will be used as Data Template File for XML Publisher Data Definition
Pls note: It will be used as Data Template File for XML Publisher Data Definition
3. Create Data Definition using XML Publisher
Administrator Responsibility.
Pls note:
-
Data Definition Code should be same as
Concurrent program Short name
-
Upload the XML File as Data Template
Pls note: Template code should be same as Data Definition code
Finish !!
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
Sample XML file for Data Template
-----------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"
?>
<property name="debug_mode"
value="on"
/>
</properties>
<parameter name="P_EMP_NUMBER"
dataType="character" />
<parameter name="P_FROM_DATE"
dataType="date" />
<parameter name="P_TO_DATE"
dataType="date" />
<parameter name="P_TIME_PERIOD"
dataType="character" />
<parameter name="P_DEPARTMENT"
dataType="character" />
</parameters>
<sqlStatement
name="Q_PAYROLL">SELECT TO_CHAR(PPA.EFFECTIVE_DATE,'MON-YYYY')
TIME_PERIOD, EMPLOYEE_NUMBER, FULL_NAME, PAP.NAME "POSITION_NAME", NATIONALITY,
HAOU.NAME
"DEPARTMENT",to_char(ORIGINAL_DATE_OF_HIRE,'DD-MM-RRRR')ORIGINAL_DATE_OF_HIRE,
PETF.ELEMENT_NAME,SUM(ROUND(RESULT_VALUE,0)) RESULT_VALUE FROM PER_ALL_PEOPLE_F
PAPF, PER_ALL_POSITIONS PAP, HR_ALL_ORGANIZATION_UNITS_TL HAOU,
PER_ALL_ASSIGNMENTS_F PAAF, PAY_ASSIGNMENT_ACTIONS PAA, PAY_ELEMENT_TYPES_F
PETF, PAY_INPUT_VALUES_F PIVF, PAY_RUN_RESULTS PRR, PAY_RUN_RESULT_VALUES PRRV,
PAY_PAYROLL_ACTIONS PPA, PAY_ELEMENT_CLASSIFICATIONS PEC WHERE PAPF.PERSON_ID =
PAAF.PERSON_ID AND PAAF.ASSIGNMENT_ID = PAA.ASSIGNMENT_ID AND
PAAF.ORGANIZATION_ID = HAOU.ORGANIZATION_ID AND PEC.CLASSIFICATION_ID =
PETF.CLASSIFICATION_ID AND PETF.ELEMENT_TYPE_ID = PIVF.ELEMENT_TYPE_ID AND
PIVF.ELEMENT_TYPE_ID = PRR.ELEMENT_TYPE_ID AND PIVF.INPUT_VALUE_ID =
PRRV.INPUT_VALUE_ID AND PRR.RUN_RESULT_ID = PRRV.RUN_RESULT_ID AND
PAA.ASSIGNMENT_ACTION_ID = PRR.ASSIGNMENT_ACTION_ID AND PAA.PAYROLL_ACTION_ID =
PPA.PAYROLL_ACTION_ID AND TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND
PAAF.EFFECTIVE_END_DATE AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND
PAPF.EFFECTIVE_END_DATE AND PAPF.EMPLOYEE_NUMBER =
nvl(:P_EMP_NUMBER,PAPF.EMPLOYEE_NUMBER) --AND PPA.EFFECTIVE_DATE BETWEEN
:P_FROM_DATE and :P_TO_DATE AND PPA.EFFECTIVE_DATE = (select max(EFFECTIVE_DATE)
from PAY_PAYROLL_ACTIONS where to_char(effective_date,'MON-RRRR') like
:P_TIME_PERIOD) AND RESULT_VALUE IS NOT NULL AND PIVF.NAME LIKE 'Pay Value%' AND
PEC.CLASSIFICATION_NAME LIKE 'Earning%' AND PAAF.POSITION_ID = PAP.POSITION_ID
AND HAOU.NAME = nvl(:P_DEPARTMENT,HAOU.NAME) AND HAOU.LANGUAGE = 'US' GROUP BY
EMPLOYEE_NUMBER, PETF.ELEMENT_NAME, FULL_NAME,NATIONALITY, PAP.NAME, HAOU.NAME,
ORIGINAL_DATE_OF_HIRE, PPA.EFFECTIVE_DATE ORDER BY EMPLOYEE_NUMBER</sqlStatement>
</dataQuery>
-----if we want one more sql
query we add here......
<element name="EMPLOYEE_NUMBER"
value="EMPLOYEE_NUMBER" />
<element name="FULL_NAME"
value="FULL_NAME" />
<element name="POSITION_NAME"
value="POSITION_NAME" />
<element name="NATIONALITY"
value="NATIONALITY" />
<element name="DEPARTMENT"
value="DEPARTMENT" />
<element name="ORIGINAL_DATE_OF_HIRE" value="ORIGINAL_DATE_OF_HIRE" />
<element name="ELEMENT_NAME"
value="ELEMENT_NAME" />
<element name="RESULT_VALUE"
value="RESULT_VALUE" />
<element name="PAYROLL_RUN"
value="PAYROLL_RUN" />
<element name="TIME_PERIOD"
value="TIME_PERIOD" />
-----if we have one more
group we can add here.....
</group>
</dataStructure>
</dataTemplate>
Tuesday, 18 November 2014
How to set where clause programmatically in OAF?
Imagine this is the query in your VO:
So in this query you want to set the where clause programatically run time. So what you do is in your VOImpl.java file where you are writing the initQuery method use the below code:
select empno,name from Employee;
So in this query you want to set the where clause programatically run time. So what you do is in your VOImpl.java file where you are writing the initQuery method use the below code:
vo.setWhereClause(null);
vo.setWhereClauseParams(null);
vo.setWhereClause("employee_number = :1 and Person_id = :2");
vo.setWhereClauseParam(1,empno);
vo.setWhereClauseParam(2,personid);
vo.executeQuery();
Below example shows coding handled in CO
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item3")!=null)
{
/* The below code line is used to initialize the application module */
OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
/* The below code line is used to initialize VO*/
XxepmVOImpl vo=(XxepmVOImpl)am.findViewObject("XxepmVO1");
String from_date = pageContext.getParameter("item1");
String to_date = pageContext.getParameter("item2");
vo.setWhereClause(null);
vo.setWhereClauseParams(null);
vo.setWhereClause("to_date(XxepmEO.START_DATE,'DD-MM-RRRR') between to_date(:1,'DD-MON-RRRR') and to_date(:2,'DD-MON-RRRR')");
vo.setWhereClauseParam(0,from_date);
vo.setWhereClauseParam(1,to_date);
vo.executeQuery();
// String message = String.valueOf(am);
// String message = String.valueOf(vo);
//throw new OAException(from_date, OAException.INFORMATION);
/* DataDisplayVO1 is the instance name in AM which is the original name of the VO */
// vo.executeQuery();
}
}
Subscribe to:
Posts (Atom)