Monthly Archives: November 2019
Installing and using JDEE in Emacs
I started to give a try to JDEE some days back. I don’t know how to Install/configure java in Emacs after so much searching and reading I was able to add MELPA.
Then I was able to install JDEE from Melpa. I tried but dint got time to read documentation so I just left.
Some days past and went to ILUGC meet and got to know about spacemacs and then again I tried a fresh Install of Emacs and spacemacs. Back to JDEE installation but don’t know how to use it. Today started to read JDEE Documentation and it was quite precise and short that I was able to configure and execute the java Code. Great that I have executed java program from Emacs. Below are the steps
Started to read the documentation by C-h i and then reading the manual.
RET: Enter Key
M-x: Alt+X Key
C-x: Ctrl+X Key
- Registering the configuration variable M-x customize-variable RET jdee-jdk-registry RET
- After Registering setting the jdk M-x customize-variable RET jdee-jdk RET
Now I have written a Hello World Program and then Executed by specifying the Compiler
I have specified the javac by M-x customize-variable <RET> jdee-compiler
Compilation M-x jdee-compile
Running/Execution M-x jdee-run
Voila I got the java program executed from emacs.
Adding JDEE to Emacs using Melpa
I was new to Emacs and was searching add on for Emacs and found JDEE. I have seen that from the JDEE can be installed from MELPA and I have added Melpa that is stable repo. But I was not able to find JDEE. After many searches I have added the code to .emacs file and I have refreshed the packages using M-x package-refresh-contents and then after that i have listed the packages. Voila.
While typing C-h i you will be able to find the documentation of JDEE in Emacs.
Now I was able to see JDEE and Installed it.
Adding Melpa to Emacs on Windows
I was new to Emacs and I thought to Install JDEE. So for Installing JDEE and I need Melpa. Melpa is a repo with more packages for Emacs. I checked in melpa site it was telling to insert a text into emacs init.el. As mine was a fresh Installation and Emacs file was not added and I was using Windows.
Adding to this I searched and got to know it will be in home but as I was using windows I don’t know where it was.
After a search for a long time I came to see in Youtube and below is the steps to add melpa
- Hit M-x customize-group and hit Enter
- Emacs will prompt for Customize group (default emacs):
- Enter package and hit Enter
- Select Package Archives and click on INS
- Now add the Archive name : melpa, URL or directory name: https://melpa.org/packages/ and click on Apply and Save
Oracle Apps core LCM tables and query
LCM Shipment Headers (INL_SHIP_HEADERS_ALL)
LCM Shipment Line Groups (INL_SHIP_LINE_GROUPS)
LCM Shipment Lines (INL_SHIP_LINES_ALL)
LCM Charge Lines (INL_CHARGE_LINES)
LCM Tax Lines (INL_TAX_LINES)
Landed Cost Allocations (INL_ALLOCATIONS)
Query to Link LCM, PO and Inventory Table
Oracle Apps PO Line Details Query with Org Restriction
Before Executing the query Execute apps Initialize in your SQL client.
SELECT pha.po_header_id,
pla.po_line_id,
pha.segment1
po_number,
pha.creation_date
po_date,
pha.currency_code
currency,
NVL (pla.CLOSED_CODE, pha.authorization_status)
po_status,
asup.VENDOR_NAME
buyer_name,
pla.line_num
po_line_number,
msib.segment1
item_code,
msib.description
item_description,
msib.primary_unit_of_measure,
pla.unit_price,
pla.quantity
ordered_qty,
(SELECT SUM (NVL (quantity_received, 0))
FROM po_line_locations_all plla
WHERE plla.po_line_id = pla.po_line_id)
quantity_received,
(SELECT SUM (NVL (quantity_billed, 0))
FROM po_line_locations_all plla
WHERE plla.po_line_id = pla.po_line_id)
quantity_billed,
pla.quantity
– (SELECT SUM (NVL (quantity_received, 0))
FROM po_line_locations_all plla
WHERE plla.po_line_id = pla.po_line_id)
pending_qty,
( pla.quantity
– (SELECT SUM (NVL (quantity_received, 0))
FROM po_line_locations_all plla
WHERE plla.po_line_id = pla.po_line_id))
* pla.unit_price
pending_value,
pla.quantity
– ( (SELECT SUM (NVL (quantity_received, 0))
FROM po_line_locations_all plla
WHERE plla.po_line_id = pla.po_line_id)
+ (SELECT SUM (NVL (ALLOCATION_QTY, 0))
FROM xxatc_shipment_dtl_v xsdv
WHERE xsdv.po_header_id = pha.PO_HEADER_ID
AND xsdv.po_line_id = pla.PO_LINE_ID))
available_qty,
(SELECT SUM (NVL (ALLOCATION_QTY, 0))
FROM xxatc_shipment_dtl_v xsdv
WHERE xsdv.po_header_id = pha.PO_HEADER_ID
AND xsdv.po_line_id = pla.PO_LINE_ID)
avl_qty,
mc.segment1
family_,
mc.segment2
sub_family,
pha.vendor_id
FROM po_headers_all pha,
ap_suppliers asup,
po_lines_all pla,
mtl_system_items_b msib,
mtl_item_categories mic,
mtl_categories_b_kfv mc
WHERE 1 = 1
AND pha.po_header_id = pla.po_header_id
AND pha.vendor_id = asup.vendor_id
AND pla.item_id = msib.inventory_item_id
AND msib.organization_id = pla.org_id
AND mic.CATEGORY_SET_ID = 1
AND msib.organization_id = mic.organization_id
AND msib.inventory_item_id = mic.inventory_item_id
AND mic.category_id = mc.category_id
AND pha.AUTHORIZATION_STATUS = ‘APPROVED’
AND NVL (pla.CLOSED_CODE, ‘OPEN’) = ‘OPEN’
AND fnd_profile.VALUE (‘ORG_ID’) = 142 –For Org Restriction
ORDER BY PO_NUMBER DESC, PO_LINE_NUMBER ASC
Search Code in OAF
I was facing some Issues when I need was having a Query region.
- Date From date and To date was not having in Oracle
- To have a dependent restriction then query has to be executed
Due to the above reasons I have created a search logic and below is the code.
When search Event is pressed from the button the pageContext.getParameter(“ShipmentNumber”) will have the value entered. Based on the value I will generate query to Execute VO.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
System.out.println(“Getting Event Param ———————–>”+pageContext.getParameter(EVENT_PARAM));
OAApplicationModule am=null;
am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject hvo= null;
hvo=(OAViewObject)am.findViewObject(“shipmtHdrVO1”);if (pageContext.getParameter(EVENT_PARAM).equals(“SEARCH”))
{
pageContext.writeDiagnostics(this, “Inside Search Logic ———————–>”,4);
System.out.println(“Inside Search Logic ———————–>”);
Enumeration x=null;
x=pageContext.getParameterNames();
if(x!=null){
System.out.println(“Elements in Enum”+x);
while(x.hasMoreElements())
{
String aParamName = (String)x.nextElement();
System.out.println(“Obatining the Child Names : “+aParamName);
}
System.out.println(“VO Gets Queried”);}
System.out.println(“pageContext.getParameter(\”ShipmentNumber\”)”+pageContext.getParameter(“ShipmentNumber”));
System.out.println(“pageContext.getParameter(\”SupplierName\”)”+pageContext.getParameter(“SupplierName”));
System.out.println(“pageContext.getParameter(\”SupplierInvoice\”)”+pageContext.getParameter(“SupplierInvoice”));
System.out.println(“pageContext.getParameter(\”AwbNumber\”)”+pageContext.getParameter(“AwbNumber”));
System.out.println(“pageContext.getParameter(\”CreationDate\”)”+pageContext.getParameter(“CreationDate”));
System.out.println(“pageContext.getParameter(\”Status\”)”+pageContext.getParameter(“Status”));List whClauseParams = new ArrayList();
if (pageContext.getParameter(“ShipmentNumber”) != null && pageContext.getParameter(“ShipmentNumber”) != “”) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“DocumentName”));
whClauseParams.add(” and QRSLT.SHIPMENT_NUMBER like ‘%”+pageContext.getParameter(“ShipmentNumber”)+ “%'”);
}
catch(Exception e){
System.out.println(e);
}
}if (pageContext.getParameter(“SupplierName”) != null && pageContext.getParameter(“SupplierName”)!=””) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“DocumentName”));
whClauseParams.add(” and QRSLT.SUPPLIER_NAME like ‘%”+pageContext.getParameter(“SupplierName”)+ “%'”);
}
catch(Exception e){
System.out.println(e);
}
}
if (pageContext.getParameter(“SupplierInvoice”)!= null && pageContext.getParameter(“SupplierInvoice”)!=””) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“DocumentName”));
whClauseParams.add(” and QRSLT.SUPPLIER_INVOICE like ‘%”+pageContext.getParameter(“SupplierInvoice”)+ “%'”);
}
catch(Exception e){
System.out.println(e);
}
}
if (pageContext.getParameter(“AwbNumber”) != null &&pageContext.getParameter(“AwbNumber”)!=””) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“DocumentName”));
whClauseParams.add(” and QRSLT.AWB_NUMBER like ‘%”+pageContext.getParameter(“AwbNumber”)+ “%'”);
}
catch(Exception e){
System.out.println(e);
}
}if (pageContext.getParameter(“CreationDateFrom”) != null && pageContext.getParameter(“CreationDateFrom”)!=””) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“EffectiveStartDate”));
whClauseParams.add(” and trunc(QRSLT.CREATION_DATE) >= to_date(‘”+pageContext.getParameter(“CreationDateFrom”)+ “‘, ‘DD-Mon-YYYY’)”);
}
catch(Exception e){
System.out.println(e);
}
}
if (pageContext.getParameter(“CreationDateTo”) != null && pageContext.getParameter(“CreationDateTo”)!=”” ) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“EffectiveStartDate”));
whClauseParams.add(” and trunc(QRSLT.CREATION_DATE) <= to_date(‘”+pageContext.getParameter(“CreationDateTo”)+ “‘, ‘DD-Mon-YYYY’)”);
}
catch(Exception e){
System.out.println(e);
}
}
if (pageContext.getParameter(“Status”) != null &&pageContext.getParameter(“Status”)!=””) {
try
{
// vo.setWhereClauseParam(0, pageContext.getParameter(“DocumentName”));
whClauseParams.add(” and QRSLT.STATUS like ‘%”+pageContext.getParameter(“Status”)+ “%'”);
}
catch(Exception e){
System.out.println(e);
}
}System.out.println(“To check VO is not null”+hvo);
if(hvo!=null)
{String sqlparam=” “;
if(whClauseParams.isEmpty())
{
System.out.println(“No Params for Search”);
hvo.reset();
hvo.setWhereClauseParams(null); // Always reset
hvo.setWhereClause(“1=1”);
hvo.executeQuery();
expVO.reset();
expVO.setWhereClauseParams(null); // Always reset
expVO.setWhereClause(“1=1”);
expVO.executeQuery();pageContext.writeDiagnostics(this, “Inside Params Empty SAVE – Reset 2 and getting Query ———————–>”+hvo.getQuery(),4);
}
else
{
for (int i = 0; i < whClauseParams.size(); i++)
{
String k=whClauseParams.get(i)+””;
System.out.println(whClauseParams.get(i));
sqlparam=sqlparam.concat(k);
System.out.println(“The param is “+sqlparam);
}if((sqlparam!=null)&&(sqlparam!=””))
{
sqlparam=sqlparam.substring(5);
System.out.println(“Modified param”+sqlparam);
hvo.reset();
hvo.setWhereClause(sqlparam);
hvo.executeQuery();
pageContext.writeDiagnostics(this, “Inside Params with Values “+sqlparam+”SAVE getting Query ———————–>”+hvo.getQuery(),4);
expVO.reset();
expVO.setWhereClause(sqlparam);
expVO.executeQuery();
pageContext.writeDiagnostics(this, “Inside Params with Values “+sqlparam+”SAVE getting Query ———————–>”+expVO.getQuery(),4);}
}
}
}
}



