Wednesday, March 3, 2021

How to Create Web Service in Oracle EBS (Integrated SOA Gateway)

Step I

create one process package to deploy to database server ex. to XXTEST_INTERFACE_PKG.pls

in package test 1 PROCEDURE INSERT_AP_INTERFACE and 2 parameter in 2 parameter out

in package to add script 

CREATE OR REPLACE PACKAGE XXTEST_INTERFACE_PKG AS

/*#

 * This is the public interface for the AP Physical Invoice. 

 * It is provided to insert interface data from external system.

 * @rep:scope public

 * @rep:product AP

 * @rep:lifecycle active

 * @rep:displayname XXAP Physical Invoice Interface

 * @rep:compatibility S

 * @rep:category BUSINESS_ENTITY XXAP_INTERFACE

 */

--
-- Insert AP_INTERFACE (PUBLIC)
--   Insert interface data.
-- IN:
--          P_ORG       - Location
--          P_NUMBER       - Invoice Number
--          P_RESULT    - out parameter
--          P_ERROR_MESSAGE    - out parameter
/*#
 * Insert interface data
 * @param P_ORG Location
 * @param P_NUMBER Invoice Number
 * @param P_RESULT Import Resurt
 * @param P_ERROR_MESSAGE Error Message (if result is not OK)
 * @rep:scope public
 * @rep:lifecycle active
 * @rep:displayname XX Insert interface data
 */
PROCEDURE INSERT_AP_INTERFACE (
          P_ORG                IN  Number,
          P_NUMBER            IN  VARCHAR2,
          P_RESULT          OUT VARCHAR2,
          P_ERROR_MESSAGE   OUT VARCHAR2
);

END XXTEST_INTERFACE_PKG;
/

Step II

save package space to XXTEST_INTERFACE_PKG.pls and copy file space to program path in Oracle EBS


Step III

Run command 

$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl -g -v -username=asadmin SQLAP:patch/115/sql:XXTEST_INTERFACE_PKG.pls:12.0=XXTEST_INTERFACE_PKG.pls

check error and fix. this command to gennarate .ildt to completed



Step IV

run next script

$FND_TOP/bin/FNDLOAD apps/apps_cps 0 Y UPLOAD $FND_TOP/patch/115/import/wfirep.lct XXTEST_INTERFACE_PKG_pls.ildt


Step V

log in Oracle EBS by ASADMIN to check and deploy service

connect repose "Integrated SOA Gateway"

check service by search or check by a module in package script

to set Service name and deploy, check service to avaliable



FInish

Friday, September 14, 2018

How to create Database Link

CREATE PUBLIC DATABASE LINK ..

CONNECT TO ..

IDENTIFIED BY ..

USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = )) (CONNECT_DATA = (SID = )))';


USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = )) (CONNECT_DATA = (SERVICE_NAME = )))';

Wednesday, July 18, 2018

How to get TAX PR and PO



   
PR

select sum (nvl(recoverable_tax,0)+nvl(nonrecoverable_tax,0))


from po_req_distributions_all

where requisition_line_id = p_pr;

PO

select sum (nvl(recoverable_tax,0)+nvl(nonrecoverable_tax,0))


from po_distributions_all

where po_header_id = p_po;

 

Amount PR

select sum(unit_price*quantity +  get_tax_pr(requisition_line_id))

from po_requisition_lines_all

where requisition_header_id = p_pr;

 

Amount PO

select (zl.unit_price*zl.tax_rate)/100

from zx_lines zl

where zl.internal_organization_id = p_org

and zl.trx_id = p_po_no

and zl.trx_line_id = (select pll.line_location_id

from po_lines_all pod, po_line_locations_all pll

where pod.po_line_id = pll.po_line_id(+)

            and pod.org_id= pll.org_id(+)

and pod.po_header_id = zl.trx_id

and pod.po_line_id = p_po_line

and rownum = '1');
 

   

Oracle EBS Module Purchasing (PR and PO)

Module PO ในระบบ Oracle EBS หลักๆ

PR

-       po_requisition_headers_all

-        po_requisition_lines_all

-        po_req_distributions_all

PO

-        po_headers_all

-        po_lines_all

-        po_distributions_all

-        po_line_locations_all

 

การ link table จะเป็นในรูปแบบ นี้ เป็นการหา ข้อมูล จาก เลข PO หรือจะ ดึง ข้อมูล โดยมีเลข PR ก็ได้

            select prh.requisition_header_id, prh.segment1, prh.description

            from po_headers_all po

            ,       po_lines_all pod

            ,       po_line_locations_all pll

            ,       po_distributions_all po_dis

            ,       po_req_distributions_all pr_dis

            ,       po_requisition_lines_all prd

            ,       po_requisition_headers_all  prh

            where po.po_header_id=pod.po_header_id(+)

            and  po.org_id=pod.org_id(+)

            and pod.po_line_id = pll.po_line_id(+)

            and pod.org_id= pll.org_id(+)

            and pll.line_location_id = po_dis.line_location_id(+)

            and po_dis.req_distribution_id =pr_dis.distribution_id (+)

            and prd.requisition_line_id=pr_dis.requisition_line_id

            and prh.requisition_header_id=prd.requisition_header_id           

and po.po_header_id = p_po_header_id;

 

 
 
 

 
 

Introduction

หลังจากที่ผมได้ย้ายงานเมื่อ ปี 2016 เพื่อย้ายงานจากการทำงานด้าน Oracle Form Report และ implement ด้วย มาสู่ July 2016 ผมก็ย้ายมาทำที่ให้ ในบริษัทที่ทำเกี่ยวกับด้วน Oracle Enterprise Business System (EBS) 

ทั้งหมด ผมก็จะเริ่มทำการ ลง บทความเกี่ยวกับ Oracle EBS ต่อไปครับ โดยหลักๆ ผมทำไว้ดูเอง เพื่ออีกหน่อยจะลืม ผมจะได้รู้ว่า เออ ทำอะไรไป ได้อะไรมาบ้าง สิ่งที่แชร์ อาจจจะมีประโยชน์ กับบางท่าน หรือไม่มี สุดแล้วแต่ ท่านจะทำไปใช้แล้ว ช่วยให้ท่านสามารถ แก้ไขปัญหาได้

 

 ขอบคุณครับ

Suebpong Sunsujjanont

Thursday, October 13, 2016

Error Oracle*Terminal cannot open fmrweb





Error Oracle*Terminal cannot open fmrweb


problem


- Error by copy .env file to location Form Config


solution


- create env file in console Enterprice management

Monday, August 3, 2015

การแก้ไขปัญหา Oracle + Toad :: You have no Oracle Clients Installed

Problem
ปัญหามีดังนี้  อยู่ดีๆ มาวันนึง TOAD 9.0.0.160 ที่เคยใช้ปกติ เกิดใช้ขึ้นมาไม่ได้ เสียอย่างนั้น โดย error message ที่เจอก็คือ

You have no Oracle Clients Installed

ถึงกับงงกันไปเลย ทั้งๆ ที่มันก็ไม่ได้มีอะไรผิดปกติ  ตัว client มันก็ต้องมีอยู่แล้ว เพราะว่าใช้กันทุกวัน

OS ที่ใช้คือ Windows XP SP2

Solution
เมื่อเจอปัญหา ก็ลองไปค้นหาใน google ก็ไม่ได้เรื่องอะไรเลย ไม่เจออะไรนอกจากปัญหาที่เจอกัน ที่ไม่มีการแก้ไขอะไร

แต่พอดูไปเรื่อยๆ ก็ไปเจอกับบทความเกี่ยวกับการใช้ติดต่อไปยัง Oracle server โดยไม่ต้องติดตั้ง Oracle client มันก็เข้าทางเราเลย เพราะว่า เครื่องเราเป็น client เหมือนกัน และต้องการติดต่อไปยัง Server เท่านั้น และเรายังติดตั้ง Oracle client ไว้อีก

ดังนั้นมาดูวิธีการหน่อยว่าทำอย่างไร
1. ไป Download Oracle Instant Client จากที่นี่
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

แล้วก็เลือกตาม OS ที่ใช้งานกันเลย

โดยผมเลือกใช้
  • Instant Client for Microsoft Windows (32-bit) 
  • และเลือก version เลย จากที่ลองใช้งานนั้นในเครื่องผม ที่ทำงานได้คือ Version 10.1.0.5 Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications

2. หลังจากที่ downalod มาแล้วก็ extract ออกมาซะ 
ตัวอย่างที่ผมได้คือ

c:\instant_client\instantclient10_1

โดยใน folder จะประกอบไปด้วย file ต่างๆ เช่น oci.dll, ojdbc.jar เป็นต้น

3. ทำการ config environment variables ของระบบดังนี้
สำหรับ folder ที่เก็บ file tnsnames.ora ซึ่งถ้ามีอยู่แล้วก็กำหนดไปเลย เช่น
Quote
TNS_ADMIN=c:\oracle\product\NETWORK\ADMIN
PATH=c:\instant_client\instantclient10_1;%PATH%

หมายเหตุ
  • สร้าง TNS_ADMIN ใน User Variable
  • แก้ไข PATH ใน System Variable

ถ้าไม่มี file tnsnames.ora ก็สามารถสร้างขึ้นมาเองได้ครับ

4. ทำการทดสอบโดยเปิด TOAD ขึ้นมาดู จะพบว่าปัญหาจะหมดไปแล้ว

How to Create shell script to Start Database and Checking Table Space

 #dr_check_db_ERPGF.sh #!/bin/bash #run ./dr_check_db_ERPGF.sh | tee dr_ERPGF.out echo -e "\n" echo -e "+++++ Start Check Dat...