Wednesday, November 24, 2010

FINALLY CLOSE -- A PO /PO Line


Following API Can be used to "FINALLY CLOSE" a Standard/Blanket PO at header/line level.

  • Given example is at Line level for blanket PO.
  • For header level PO close, P_lineid will be passed as null.
  • For standard PO , instead of PA use PO.
  • If blanket PO line is referred on any OPEN standard PO, then BPA line cannot be changed to FINALLY CLOSE status.
**************************************************

DECLARE
x_action CONSTANT VARCHAR2 (20) := 'FINALLY CLOSE';
-- Change this parameter as per requirement
x_calling_mode CONSTANT VARCHAR2 (2) := 'PO';
x_conc_flag CONSTANT VARCHAR2 (1) := 'N';
x_return_code_h VARCHAR2 (100);
x_auto_close CONSTANT VARCHAR2 (1) := 'N';
x_origin_doc_id NUMBER;
x_returned BOOLEAN;
CURSOR c_po_details
IS
SELECT pha.po_header_id, pha.org_id, pha.segment1, pha.agent_id
,pha.closed_code, pha.closed_date
FROM apps.po_headers_all pha
WHERE authorization_status = 'APPROVED'
AND pha.closed_code <> 'FINALLY CLOSED'
AND segment1 = '15000002252';
-- Enter the PO Number if one PO needs to be finally closed/Closed
BEGIN
fnd_global.apps_initialize (user_id => 1468
,resp_id => 20707
,resp_appl_id => 201
);
FOR po_head IN c_po_details
LOOP
mo_global.init ('PA');
mo_global.set_policy_context ('S', po_head.org_id);
DBMS_OUTPUT.put_line
( 'Calling PO_Actions.close_po for Closing/Finally Closing PO =>'
|| po_head.segment1
);
x_returned :=
po_actions.close_po (p_docid => po_head.po_header_id
,p_doctyp => 'PA' -- "PO" for standard PO
,p_docsubtyp => 'BLANKET' --'STANDARD' for standard PO
,p_lineid => 7885858 -- null if you want to FINALLY CLOSE at header level
,p_shipid => NULL
,p_action => x_action
,p_reason => NULL
,p_calling_mode => x_calling_mode
,p_conc_flag => x_conc_flag
,p_return_code => x_return_code_h
,p_auto_close => x_auto_close
,p_action_date => SYSDATE
,p_origin_doc_id => NULL
);
IF x_returned = TRUE
THEN
DBMS_OUTPUT.put_line
( 'Purchase Order which just got Closed/Finally Closed is '
|| po_head.segment1
);
COMMIT;
ELSE
DBMS_OUTPUT.put_line
('API Failed to Close/Finally Close the Purchase Order');
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line
('Program failed with unexpected error');
END;

Wednesday, October 27, 2010

JDeveloper and OAF

How to find correct version of jDeveloper.

1) Login to EBS.
2) In Home page , lower left corner select About this page.






3) Select Technology component and in that we can see OA Framework version









4) For aboove version we can find the required jdeveloper patch in following metalink



416708.1 How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x


Profile Options:

1) getting personalization link on page set this profile option-*Personalize Self-Service Defn* to yes

2) for getting about link on page set this profile option-*FND: Diagnostics* to yes.

3) Set profile "Sign-On:Notification" to "No" at site level

Friday, September 17, 2010

Oracle Patches

Tables: AD_APPLIED_PATCHES , AD_BUGS( bug number is the patch number)

Links:
Note: 181665.1 - Release 11i Adpatch Basics
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=181665.1

Note: 457566.1 - Oracle Applications Patching FAQ for Release 11i -- Can I determine ahead of time how a patch will affect my system?
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=457566.1

Oracle Applications Maintenance Utilities -- 11i
http://download.oracle.com/docs/cd/B25516_18/current/acrobat/11iadutil.pdf

Oracle Applications Maintenance Utilities -- R12
http://download.oracle.com/docs/cd/B40089_09/current/acrobat/r12adutil.pdf


How can I track my customizations? What happens to my customizations during patching?

You should apply patches first on a test system. Then, review the changes in the test system and identify the best way to re-integrate customizations affected by the patch.

If you have registered your customized files in $APPL_TOP/admin/applcust.txt, AutoPatch reviews the files to determine if any of those files will be replaced during the application of the patch.

Friday, July 23, 2010

FND LOAD Scripts in Oracle

Forms Personalizations:
--------------------------------------
$FND_TOP/bin/FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct ((NAME_OF_LDT)).ldt FND_FORM_CUSTOM_RULES function_name="OZF_FNDLVMLU"
$FND_TOP/bin/FNDLOAD (usrname)/(paswrd) 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct ((NAME_OF_LDT)).ldt


Form Function:
--------------------------------------
FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct ((NAME_OF_LDT)).ldt FUNCTION FUNCTION_NAME='((func name))'
$FND_TOP/bin/FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct ((NAME_OF_LDT)).ldt


Lookups :
--------------------------------------
$FND_TOP/bin/FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct ((NAME_OF_LDT)).ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME ="XXDIS" LOOKUP_TYPE="((lkp name))"
$FND_TOP/bin/FNDLOAD (usrname)/(paswrd) 0 Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct ((NAME_OF_LDT)).ldt


Profile:
--------------------------------------
FNDLOAD (usrname)/(paswrd) 0 Y UPLOAD @FND:patch/115/import/afscprof.lct ((NAME_OF_LDT)).ldt
FNDLOAD (usrname)/(paswrd) O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct ((NAME_OF_LDT)).ldt PROFILE PROFILE_NAME="((NAME_OF_profile))" APPLICATION_SHORT_NAME="CANON"


Concurrent Program:
--------------------------------------
FNDLOAD (usrname)/(paswrd) O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct ((NAME_OF_LDT)).ldt
FNDLOAD (usrname)/(paswrd) O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct ((NAME_OF_LDT)).ldt PROGRAM APPLICATION_SHORT_NAME="XXDIS" CONCURRENT_PROGRAM_NAME="((prg_name))"


Request Group:
--------------------------------------
FNDLOAD (usrname)/(paswrd) O Y UPLOAD $FND_TOP/patch/115/import/afcpreqg.lct ((NAME_OF_LDT)).ldt
FNDLOAD (usrname)/(paswrd) O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct ((NAME_OF_LDT)).ldt REQUEST_GROUP REQUEST_GROUP_NAME="System Administrator Reports" APPLICATION_SHORT_NAME="FND"

Flexi field:
--------------------------------------
FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct ((NAME_OF_LDT)).ldt DESC_FLEX APPLICATION_SHORT_NAME=PO DESCRIPTIVE_FLEXFIELD_NAME='PO_REQUISITION_LINES'

Flexi field ....category/CONTEXT
--------------------------------------
$FND_TOP/bin/FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct ((NAME_OF_LDT)).ldt DESC_FLEX APPLICATION_SHORT_NAME="FND" DESCRIPTIVE_FLEXFIELD_NAME="FND_COMMON_LOOKUPS" DFF_CONTEXT DESCRIPTIVE_FLEX_CONTEXT_CODE="((FLEX_CONTEXT))"


Valuset :
--------------------------------------
FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct ((NAME_OF_LDT)).ldt VALUE_SET FLEX_VALUE_SET_NAME="CANON_E379_MERCH_DROPSHIP_WH_VS"
FNDLOAD (usrname)/(paswrd) 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct ((NAME_OF_LDT)).ldt


Alert :
-------------------------------------
FNDLOAD (usrname)/(paswrd) 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct ((NAME_OF_LDT)).ldt ALR_ALERTS APPLICATION_SHORT_NAME='WSH'
FNDLOAD (usrname)/(paswrd) 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct ((NAME_OF_LDT)).ldt

Friday, July 16, 2010

POCIRM-222: --

Cause: POCIRM encountered an internal error. Parameters: REQIMPORT,,,ITEM,,N,Y,

Action: Note both this error number and the actions you are trying to perform. Contact your system a
POCIRM-222: ORA-06502: PL/SQL: numeric or value error: character string buffer too

Cause: A SQL error has occurred in POCIRM. The SQL error is &LSQL_ERR.

Action:To implement the solution, please execute the following steps
1. DBA should disable/ drop trigger ADS_PO_REQUISITION_HDR_TRG1. This
trigger was created by the ADS team for Demo purpose ONLY. No customer
instance should have this trigger.
This trigger is not a part of the seeded code and can be dropped.]

Document ID: 464573.1 for more detail

Sunday, May 9, 2010

SQL Loader Case Studies

http://www.cs.umbc.edu/portal/help/oracle8/server.815/a67792/ch04.htm

Friday, March 5, 2010

Spliting One row into Multi rows

select * from (
with t as (select 'A-INSTALL,6-FOLLOWUP' str from dual)
SELECT trim(REGEXP_SUBSTR (str,'[^,]+' ,1,level))
FROM t
connect by instr(str, ',', 1, level - 1) > 0
and connect_by_root str = str)

Concatenating Multiple Rows into single row

SELECT customer_product_id,
SUBSTR(MAX(REPLACE(SYS_CONNECT_BY_PATH(incident_number, '/') ,
'/',' ,')),3) Concatenated_String
FROM (SELECT cia.incident_number,cia.customer_product_id
,ROW_NUMBER () OVER (PARTITION BY customer_product_id ORDER BY customer_product_id) row#
FROM cs_incidents_all cia
,csi_item_instances cii
WHERE 1 = 1
AND cia.customer_product_id = cii.instance_id
AND cii.serial_number = 'XXXXXX'
AND NOT EXISTS (
SELECT 1
FROM cs_incident_statuses
WHERE NAME IN ('Cancelled', 'Closed')
AND incident_subtype = 'INC'
AND incident_status_id = cia.incident_status_id))
START
WITH ROW#=1
CONNECT
BY PRIOR row# = row#-1 and prior customer_product_id = customer_product_id
GROUP
BY customer_product_id

Wednesday, February 3, 2010

Back to Back Orders (B2B)


In Drop-ship items are directly shipped to customer from the supplier and only logical receiving is performed in Oracle. In B2B orders items are physically received to Oracle from supplier and later they are shipped to customers.

Ex: When an order for Laptop is placed, you cannot send laptop and charger differently to the customer. If the company is not interested in maintaining the inventory of chargers, B2B is perfect solution as laptop charger order will go out when ever an order is created for laptop.And the charger is received to oracle and can be shipped with the Laptop.

Flow status code of the order line --FSC
Item reservation type ….IRT


1. Enter sales order …source code Internal
2. Book the order, at this time FSC – Supply Eligible
3. Perform progress order … and FSC –PO Req. Requested & IRT inventory
4. Req. Import –FSC –PO Req. Created & IRT external requisition
5. Auto Create PO –FSC – PO created & IRT PO order
6. Perform receiving transaction--- FSC Awaiting shipping& IRT Inventory
After this complete the order as normal sales order.

Important Notes:
Items used in Back to back order should be ATO enabled, Build in WIP flag checked and in general planning set the Buy flag.
In B2B order at some point we will physically receive goods before shipping them out, where as in Drop ship goods are directly shipped to Customer
Drop ship order may connect to more than one PO but B2B is connected to single PO.

SetupDocument Link:

http://functionalguy.blogspot.com/2009/02/back-to-back-order-cycle.html

Drop Shipment


It means you can receive orders for items that you do not stock or for which you lack sufficient inventory, and have a supplier provide the items directly to your customer

Drop Shipment - Process Steps
• Create a Sales Order with line where the line source is External
• Book and Schedule the Sales Order this will populate data in OE_DROP_SHIP_SOURCES
• The Purchase Release program this will populate data into PO_REQUISITIONS_INTERFACE_ALL
• Run Requisition Import Process PO_REQUISITION_HEADERS_ALL/ LINES/DISTRIBUTION
• Now the line status will be in Awaiting Receipt
• Login to the Receiving Organization (Purchasing) who has been setup as an Approver
• Create Purchase Order from the Requisition , populates data into PO tables
• Approve the PO
• Receive the full quantity
• Run Auto Invoice
• Verify Invoice in Sales Order

Things not to forget in a Drop Shipment

• Release 11i/12 does not support Drop Shipment across operating units.
• Blanket PO's will not used with Drop Shipment, the reason the PO must be created when OM notifies PO that a Drop Ship order has been created.
• You can't cancel Drop Shipments once Oracle Purchasing obtains the receipt.
• Standard Items can be used for Drop Shipment.

TABLES Involved
• PO_LINE_LOCATIONS_ALL
o This table stores document shipment schedules for purchase orders, purchase agreements, quotations, and RFQs.
o This table stores purchase document lines for purchase orders, purchase agreements, quotations, and RFQs.
• PO_HEADERS_ALL/ PO_LINES_ALL/ PO_DISTRIBUTIONS_ALL
• PO_REQUISITION_HEADERS_ALL/ PO_REQUISITION_LINES_ALL/ PO_REQ_DISTRIBUTIONS_ALL
• PO_REQUISITIONS_INTERFACE_ALL
o This is the Requisition Import interface table.
• OE_ORDER_LINES_ALL/OE_ORDER_LINES_ALL/OE_DROP_SHIP_SOURCES
o This table stores relationships between order lines in OE_ORDER_LINES_ALL table and associated oracle purchasing requisitions in PO_REQUISITIONS_ALL and Oracle purchasing purchase orders in PO_LINES_ALL.
• RCV_SHIPMENT_LINES
o This table stores receiving shipment line information

Wednesday, January 6, 2010

Purchase Order Interface -- PO_HEADERS_INTERFACE

Interface Tables Used

1)PO_HEADERS_INTERFACE
2)PO_LINES_INTERFACE
3)PO_DISTRIBUTIONS_INTERFACE

INSERT INTO po_headers_interface
(interface_header_id
,batch_id
,action
,org_id
,document_type_code
,vendor_id
,vendor_site_code
,vendor_site_id
,vendor_doc_num
,currency_code
,agent_id
,terms_id
,approval_status
,ship_to_location_id
,effective_date
,creation_date
,created_by
,last_update_date
,last_updated_by
,attribute_category
,attribute9 --xtra information
,comments
)
VALUES (po_headers_interface_s.NEXTVAL
,po_headers_interface_s.CURRVAL
,'ORIGINAL'
,g_org_id
,'STANDARD'
,rec_get_header_info.vendor_id
,rec_get_header_info.vendor_site_code
,rec_get_header_info.vendor_site_id
,po_headers_interface_s.CURRVAL
,'USD'
,l_agent_id
,rec_get_header_info.terms_id
,'APPROVED'
,rec_get_header_info.deliver_to_location_id
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,fnd_profile.VALUE ('USER_ID')
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,fnd_profile.VALUE ('USER_ID')
,'DS Fields'
,rec_get_header_info.attribute9 --xtra information
,l_comments
)

INSERT INTO po_lines_interface
(interface_header_id
,interface_line_id
,requisition_line_id
,line_num
,shipment_num
,line_type_id
,item
,item_description
,category_id
,unit_of_measure
,quantity
,unit_price
,ship_to_organization_id
,line_location_id
,effective_date
,need_by_date
,creation_date
,created_by
,last_update_date
,last_updated_by
,taxable_flag
)
VALUES (po.po_headers_interface_s.CURRVAL
,po.po_lines_interface_s.NEXTVAL
,rec_get_line_info.requisition_line_id
,l_line_num
,1
,rec_get_line_info.line_type_id
,rec_get_line_info.segment1
,rec_get_line_info.item_description
,rec_get_line_info.category_id
,rec_get_line_info.primary_unit_of_measure
,rec_get_line_info.quantity
,rec_get_line_info.unit_price
,rec_get_line_info.destination_organization_id
, po_line_locations_s.NEXTVAL
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,TO_DATE (rec_get_line_info.need_by_date, 'DD-MON-RRRR')
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,fnd_profile.VALUE ('USER_ID')
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,fnd_profile.VALUE ('USER_ID')
,'Y'
);


INSERT INTO po.po_distributions_interface
(interface_header_id
,interface_line_id
,interface_distribution_id
,req_distribution_id
,org_id
,distribution_num
,quantity_ordered
,destination_organization_id
,destination_type_code
,destination_subinventory
, deliver_to_location_id
,set_of_books_id
,charge_account_id
,budget_account_id
,accrual_account_id
,variance_account_id
,deliver_to_person_id
,creation_date
,created_by
,last_update_date
,last_updated_by
)
VALUES (po.po_headers_interface_s.CURRVAL
,po.po_lines_interface_s.CURRVAL
,po.po_distributions_interface_s.NEXTVAL
,rec_get_distrib_info.distribution_id
,g_org_id
,rec_get_distrib_info.distribution_num
,rec_get_distrib_info.req_line_quantity
,rec_get_distrib_info.destination_organization_id
,rec_get_distrib_info.destination_type_code
,l_destination_subinventory
, rec_get_line_info.deliver_to_location_id
,rec_get_distrib_info.set_of_books_id
,rec_get_distrib_info.code_combination_id
,rec_get_distrib_info.budget_account_id
,l_new_accrual_account_id
,rec_get_distrib_info.variance_account_id
,rec_get_line_info.to_person_id
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,fnd_profile.VALUE ('USER_ID')
,TO_DATE (SYSDATE, 'DD-MON-RRRR')
,fnd_profile.VALUE ('USER_ID')
);

Concurrent Program:
apps.fnd_request.submit_request (application => 'PO' --Application,
program => 'POXPOPDOI'--Program,
argument1 => ''--Buyer ID,
argument2 => 'STANDARD'--Document Type,
argument3 => ''--Document Subtype,
argument4 => 'N'--Process Items Flag,
argument5 => 'N'--Create Sourcing rule,
argument6 => ''--Approval Status,
argument7 => ''--Release Generation Method,
argument8 => ''--NULL,
argument9 => g_org_id--Operating Unit ID,
argument10 => ''--Global Agreement
);

Calling PO Approval workflow to approve POs

SELECT TO_CHAR (po_wf_itemkey_s.NEXTVAL)
INTO v_wf_seq
FROM SYS.DUAL;

v_itemkey := TO_CHAR (l_header.po_header_id)
|| '-'
|| v_wf_seq;
po_reqapproval_init1.start_wf_process (itemtype => 'POAPPRV'
,itemkey => v_itemkey
,workflowprocess => 'POAPPRV_TOP'
,actionoriginatedfrom => 'PO_FORM'
,documentid => l_header.po_header_id
,documentnumber => l_header.segment1
,preparerid => l_header.agent_id
,documenttypecode => 'PO'
,documentsubtype => 'STANDARD'
,submitteraction => 'APPROVE'
,forwardtoid => NULL
,forwardfromid => l_header.agent_id
,defaultapprovalpathid => 10
,note => NULL
,printflag => 'N'
,faxflag => NULL
,faxnumber => NULL
);

Requisition Interface - PO_REQUISITIONS_INTERFACE_ALL

-- insert data into Interface tables
INSERT INTO PO_REQUISITIONS_INTERFACE_ALL
(interface_source_code
,source_type_code
,requisition_type
,destination_type_code
,item_id
,item_description
,quantity
,authorization_status
,preparer_id
,autosource_flag
,req_number_segment1 *** see the note
,header_attribute13 ---xtra infomation
,line_attribute15 ---xtra infomation
,uom_code
,destination_organization_id
,destination_subinventory
,deliver_to_location_id
,deliver_to_requestor_id
,need_by_date
,gl_date
,charge_account_id
,accrual_account_id
,variance_account_id
,org_id
,suggested_vendor_id
,suggested_vendor_site_id
,unit_price
,creation_date
,created_by
,last_update_date
,last_updated_by
)
VALUES ('INV'
,'VENDOR'
,'PURCHASE'
,'INVENTORY'
,rec_get_lines_info.inventory_item_id
,rec_get_lines_info.item_desc
,rec_get_lines_info.ordered_quantity
,l_authorization_status --------'INCOMPLETE' or 'APPROVED'
,g_employee_id
,'P'
,l_req_segment1
,'ZZ' ---xtra infomation
,rec_get_lines_info.ship_to_org_id ---xtra infomation
,rec_get_lines_info.uom_code
,rec_get_lines_info.ship_from_org_id
,rec_get_lines_info.subinventory
,rec_get_lines_info.location_id
,get_requestor (fnd_global.user_id) --rec_get_lines_info.requestor
,rec_get_lines_info.schedule_ship_date
,SYSDATE
,rec_get_lines_info.charge_account
,rec_get_lines_info.ap_accrual_account
,rec_get_lines_info.invoice_price_var_account
,g_org_id
, rec_get_lines_info.vendor_id
, rec_get_lines_info.vendor_site_id
,rec_get_lines_info.list_price
,SYSDATE
,fnd_global.user_id
,SYSDATE
,fnd_global.user_id
);


Note:

Standard grouping rules provided by Oracle are by
Buyer
Category
Item
Location
Vendor or
ALL , these grouping rules can be over written by populating "req_number_segment1" .
When we use req_number_segment1 with ALL grouping option, requisiton will be grouped by req_number_segment1


Concurrent Program:

apps.fnd_request.submit_request (application => 'PO' --Application,
program => 'REQIMPORT' --Program,
argument1 => 'INV' --Interface Source code,
argument2 => '' --Batch ID,
argument3 => 'ALL'--Group By,
argument4 => ''--Last Req Number,
argument5 => ''--Multi Distributions,
argument6 => 'N' --Initiate Approval after ReqImport
);