Thursday, August 26, 2010
OTC
1.customer sends details of order or sales dept brings order from customer.
2.Enter the order in Sales order (SO)
3.Book an SO
4.Check for ATP (Available to promise)
5. Check for CTP (Capable to Promise) and CTD (capable to deliver)
6.Schedule SOship date
7.Send SO Acknowledgement
8.Resolve SO Holds
9.Release Credit Holds (Go to SO actions tab and release hold or increase the credit amount in customers->>standard-->>profile:amount)
10.Pick material (Pick release material from Inventory)
11.Pick wave MO is generated by system and material is moved to staging
12.prepare material for shipment (Packing)
13.Load Material
14.Ship material (Send ship documentslike bill of lading,customer invoice,packing list,vehicle load sheet)
15.Generate invoice in AR AR-> setup-> Auto invoice and send it to cus.
16.customer followup (calling customer thruphone,Dunning letters etc)
17.Customer payment aganist the invoice and receive payment
18.Financial reconcilation (reconsile shipment and payment done by customer)
Order to cash life cycle contains following steps
Order Entry --> OrderBooked --> Pick release --> Ship confirm --> Auto invoice
--> invoice --> Receipt --> Bank Reconcilations
Steps in Order management
Enter the sales orderBook the sales order
Steps in Shipping exexution
release the sales order for picking
Ship confirm the sales order
Steps in Receivables
Run auto invoiceInvoiceBank Reconcilation
Technical point of o2c(order to cash) is as follows
first we setup the customer,tax category details,item details,pricing definitions,payment terms,freight terms and then only we can order the product.
for set up main base tables are
RA_CUSTOMERS,
RA_ADDRESSES,
RA_CUST_SITE_USES_ALL
then go for the order entry
here effected tables are
OE_ORDER_HEADERS_ALL,
OE_ORDER_LINES_ALL
flow_status_code for both tables will be 'ENTER'
then book the order
flow_status_code for both tables of
OE_ORDER_HEADERS_ALL,
OE_ORDER_LINES_ALLwill be 'Booked'
WSH_DELIVERY_DETAILS,
WSH_DELIVERY_ASSIGNMENTS will be going to effect.
the pick release
the flow_status_code for OE_ORDER_HEADERS_ALL will be 'BOOKED"
and flow_status_code for OE_ORDER_LINES_ALL will be 'awaiting shipping"
pick conform
flow_status_code for both tables of OE_ORDER_HEADERS_ALL,
OE_ORDER_LINES_ALL will be 'PICKED'
ship conform
flow_status_code for both tables of OE_ORDER_HEADERS_ALL,
OE_ORDER_LINES_ALL will be 'SHIPPED'
here in WSH_NEW_ASSIGNMENTS the status_code is 'CL' then the order details are conformed and otherwise it is 'Open' stage
here in WSH_DELIVERY_DETAILS the oe_interface_flag is 'Y' then the order is closed and if it is 'N' it is an error in the order line details and we need to assign line level order details
once the shipping is conformed invoice will be generated
the effected tables are RA_CUSTOMER_TRX_ALL,RA_CUSTOMER_TRX_LINES_ALL
this is O2C
API's
FND_PROGRAM.EXECUTABLE ( )
FND_PROGRAM.DELETE_EXECUTABLE( )
FND_PROGRAM.REGISTER( )
FND_PROGRAM.DELETE_PROGRAM( )
FND_PROGRAM.PARAMETER( )
FND_PROGRAM.DELETE_PARAMETER( )
FND_PROGRAM.INCOMPATIBILITY( )
FND_PROGRAM.DELETE_INCOMPATIBILITY( )
FND_PROGRAM.REQUEST_GROUP( )
FND_PROGRAM.DELETE_GROUP( )
FND_PROGRAM.ADD_TO_GROUP( )
FND_PROGRAM.REMOVE_FROM_GROUP( )
FND_REQUEST.SUBMIT_REQUEST( )
FND_CONCURRENT.WAIT_FOR_REQUEST( )
FND_REQUEST.SET_PRINT_OPTIONS ( )
FND_GLOBAL.USER_IDFND_GLOBAL.APPS_INITIALIZE(user_id in number,resp_id in number,resp_appl_id in number);
FND_GLOBAL.LOGIN_ID
FND_GLOBAL.CONC_LOGIN_ID
FND_GLOBAL.PROG_APPL_ID
FND_GLOBAL.CONC_PROGRAM_ID
FND_GLOBAL.CONC_REQUEST_ID
FND_PROFILE.PUT(name,value)
FND_PROFILE.GET(name IN varchar2,value out varchar2)
API’S IN APPS
PO
PO_CUSTOM_PRICE_PUB
PO_DOCUMENT_CONTROL_PUB
PO_DOC_MANAGER_PUB
PO_WFDS_PUB
AP
AP_NOTES_PUB
AP_WEB_AUDIT_LIST_PUB
INV
INV_COST_GROUP_PUB
INV_ITEM_CATALOG_ELEM_PUB
INV_ITEM_CATEGORY_PUB
INV_ITEM_PUB
INV_ITEM_REVISION_PUB
INV_ITEM_STATUS_PUB
INV_LOT_API_PUB
INV_MATERIAL_STATUS_PUB
INV_MOVEMENT_STATISTICS_PUB
INV_MOVE_ORDER_PUB
INV_PICK_RELEASE_PUB
INV_PICK_WAVE_PICK_CONFIRM_PUB
INV_RESERVATION_PUB
INV_SERIAL_NUMBER_PUB
INV_SHIPPING_TRANSACTION_PUB
Concurrent Program Submission Through Backend
l_request_id number(9) ;
begin
l_request_id := Fnd_Request.submit_request
( 'PO', -Concurrent Prog Application Name
'SQL-USERS', -Conccurrent Prog Short Name
'Users Data', -Concurrent Prog description '',
-start time '',
-sub request 1000,
-first parameter value 2000,
-second parameter value
'CREATION_DATE');-third parameter value
Commit;
if l_request_id = 0
then fnd_file.put_line(fnd_file.log,'Prograqm not sumitted Succesfully');
else
fnd_file.put_line(fnd_file.log,'Prograqm sumitted Succesfully Request ID ='l_request_id);
End If;
Exception
when others then
fnd_file.put_line(fnd_file.log,'Error occured during Porgram submission');
End ;
from Triggers
declare
l_request_id number(9) ;
begin
l_request_id := Fnd_Request.submit_request
( 'PO', -Concurrent Prog ApplciationName
'SQL-USERS', -Conccurrent Prog Short Name
'Users Data', -Concurrent Prog description '',
-start time '',
-sub request 1000,
-first parameter value 2000,
-second parameter value
'CREATION_DATE','','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','' '','','','','','','','','','');
Commit;
if l_request_id = 0 then
fnd_file.put_line(fnd_file.log,'Prograqm not sumitted Succesfully');
else
fnd_file.put_line(fnd_file.log,'Prograqm sumitted Succesfully Request ID ='l_request_id);
End If;
Exception
when others then
fnd_file.put_line(fnd_file.log,'Error occured during Porgram submission');
End ;
fnd_global.apps_initialize(user_id, Resp_id, Resp_appl_id);
-To initialize the Application Environment by specifying the UserID and RespID system will verify the User Access details based on that it will submit the Program.
1)fnd_Program.executable
2)fnd_program.register
3)fnd_program.request_group
4)fnd_program.add_to_group - Add concurrent Pogram to the Group
5)fnd_program.parameter - To create parameters for concurrent Program
6)fnd_program.incompatibility - TO attach Incompatibility Programs List
7)fnd_program.delete_group - To delete the Request Group
Any Table ,Procedure,Package,view any database Object starting with "FND" then it is relatedfor AOL(Application Obejct Library) , AOL ObjectSchema Name :APPLSYS"fnd" is nothing but foundation
Requisition Interface
-- 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
);
Purchase Order 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
);
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
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)
SQL Loader Case Studies
http://www.cs.umbc.edu/portal/help/oracle8/server.815/a67792/ch04.htm
Importing material cost associated to item.
First check which cost elements are defined for the organizaion.
select cost_type_id,cost_type,description
from CST_COST_TYPES;
Output looks like this.
cost_type_id cost_type description
------------ ------------ ------------------------------------
1 Frozen Frozen Standard Cost Type
2 Average Average Cost Type
3 Pending Pending Standard Cost Type
.....
To find the sub element name defined for your organization for a particular cost type please check bom resources table.
In our example we are checking for material sub element in organization M1 with organization_id = 207 for cost_code type 1.
select resource_code,description,cost_element_id,cost_code_type
from bom_resources where organization_id = 207
and cost_code_type= 1;
resource_code description cost_element_id cost_code_type
------------- ----------------- --------------- --------------
Material Material Sub element 1 1
Labor Labor Sub element 1 1
Expense Expense Sub element 1 1
In our scenario we want to create a new item in organization M1 along with its material cost (say $11) assuming the same item is already created in master organization V1.
insert into mtl_system_items_interface
(process_flag, set_process_id, transaction_type,organization_id,segment1,
description,template_id,MATERIAL_COST,MATERIAL_SUB_ELEM)
values
(1,1,'CREATE',207,'TESTCOSTMATERIAL', 'Testing Item Material Cost Import',
259,11,'Material');
commit;
Note : Using mtl_system_items_interface 'Frozen cost' also be converted
Similary we can use MATERIAL_SUB_ELEM_ID, MATERIAL_OH_RATE,MATERIAL_OH_SUB_ELEM and MATERIAL_OH_SUB_ELEM_ID colums.
To check the subelements you can go to Cost management responsibility for your organization and under Setup > Sub-Elements you will see the respective
subelements being defined.
Now run the item import program ie. Item > Import > Import Items.
In Process Set enter 1 as we had used 1 in the set_process_id column.
Now enter 1 in create or update items field and hit OK button.You can check view requests to check whether your request has completed successfully.
Now go to organization items and query on 'TESTCOSTMATERIAL' the item that we had populated and you should be able to see the item.
Go to Tools > Item Costs and then hit Open button from Item Cost Summary screen
and you should see the details. In out example we see a material cost of $11 for the item in cost type 'Frozen'(Standard Costing).
NOTE: Item import cannot be used to update item costs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You have to populate
CST_ITEM_CST_DTLS_INTERFACE,
CST_RESOURCE_COSTS_INTERFACE,
CST_RES_OVERHEADS_INTERFACE and
CST_DEPT_OVERHEADS_INTERFACE accordingly.
The concurrent request can be launched by navigating to cost->cost massedits->Import Cost Information.
The parameters for the Cost Import concurrent program and their description is
as follows :
Import Cost Option : A LOV is provided from which the user can select one of the import options which may be either to import Only item costs , Only resource costs , Only overhead rates or all the cost information .
Option Table from which data is processed
---------- --------------------------------------------
Only item cost cst_item_cst_dtls_interface
Only resource costs cst_resource_costs_interface
Only overhead rates cst_res_overheads_interface ,
cst_dept_overheads_interface
All Cost Information From all the four interface tables
Mode to run this request : A LOV is provided with possible two values , 'Insert new cost' or 'Remove and replace cost'.
The 'Insert new cost' mode , is useful if you are importing large # of items and are not sure if that Item/Organization/Cost Type combination already exists in the production tables, if it does then the row in the interface table would be flaged as errored and not imported.This would prevent any accidental overwrite of already existing data.
With 'Remove and replace cost' mode all the previous cost information for this item, cost_type and organization combination will be deleted from the production tables and the new information will overwrite (replace) the already existing one.
Group Id Option : A LOV is provided from which the user can either select 'ALL' or 'Specific Group Id' . If the user wishes to submit multiple Cost Import process requests he can do so by submitting one request per group id. For doing so the data in the interface tables should be stamped with distinct group id value by using the NEXTVAL from the sequence generator CST_LISTS_S .The use of this sequence geneartor is a MUST for generating multiple groups or may lead to data corruption as these interface tables are used by other processes too.
If the user selects "ALL" from the list then a group ID generated by a sequence will replace the group ID in the interface tables (if any) and all the unprocessed rows from the four interface table (viz.cst_item_cst_dtls_interface , cst_resource_costs_interface ,cst_res_overheads_interface , cst_dept_overheads_interface ) will be processed in one run.
Cost type to import to : The user is provided with a LOV from which he needs to select the cost type in which he wishes to import the cost information. Even if the user has populated a cost type or cost type ID in the interface tables, it would be overwritten with the one that is selected here.
The cost types that the user can pick from is restricted to the multi-org,
updateable cost types.
Delete succesfull rows : This parameter decides whether the successfully processed rows should be deleted from the interface tables at the end of the run. If the user selects 'Yes' then all the successful rows be deleted, basically rows that do not have their error flag set to "E".
Importing directly into Frozen/Average cost type (i.e non updateable cost types)and merging of new cost with existing costs is not supported at this time and would still have to be processed by cost update routines. Also when importing the costs from the interface table ,material overhead defaults (if any) specified for an Organization/Category would not be respected.
Minimum columns in each table that the user needs to provide
1. CST_ITEM_CST_DTLS_INTERFACE
The columns that the user has to provide are
a. Inventory_item_id
b. organization_ID or organization_code.
c. resource_ID or resource_code for cost elements other than 1(material).
If we are importing cost into material cost element and default material
subelement has been specified on 'Define Organization parameters' form
then that would be respected unless the user overides it with a value
in this column.
d. usage_rate_or_amount
e. cost_element_ID or cost_element
f. Process Flag (must be set to 1)
We default values for based_on_rollup, shrinkage_rate, inventory_asset_flag,
lot_size from the row from CST_ITEM_COSTS for this item and the default cost
type(default cost type of the cost type specified to import the costs into). If
there is no such row already defined in CST_ITEM_COSTS, then, the values for
these 4 columns also need to be specified and they have to be the same for all
rows of this item, cost type and organization combination.
CST_RESOURCE_COSTS_INTERFACE
a. Resource_ID or resource_code
b. organization_ID or organization_code
c. resource_rate
d. Process_flag (must be set to 1)
CST_RES_OVERHEADS_INTERFACE
a. Resource_ID or resource_code
b. Overhead_ID or overhead
c. Organization_ID or organization_code
d. Process_flag(must be set to 1)
CST_DEPT_OVERHEADS_INTERFACE
a. Department_ID or department
b. Overhead_ID or overhead
c. Organization_ID
d. Rate_or_amount
e. Process_flag(must be set to 1)
The other columns will be defaulted.
CST_ITEM_COSTS_INTERFACE can be used to import all the costs
MATERIAL_COST, OUTSIDE PROCESSING COST, OVER HEAD COST and other costs
Article from Uday Somavarapu Blog
Ship To address and Bill to Address Qry
SELECT hp.party_name
FROM hz_parties hp
,hz_party_sites site
,hz_locations loc
,hz_party_site_uses uses
,fnd_territories_vl terr
,hz_cust_site_uses hcsua
,hz_cust_acct_sites hcasa
WHERE site.party_id = hp.party_id
AND site.location_id = loc.location_id
AND site.party_site_id = uses.party_site_id(+)
AND loc.country = terr.territory_code
AND hp.status = 'A'
AND site.status = 'A'
AND hcsua.status = 'A'
AND uses.site_use_type = 'SHIP_TO'
AND NVL (uses.status, 'A') = 'A'
AND hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = site.party_site_id
AND hcsua.site_use_code = uses.site_use_type
AND hcsua.site_use_id = ol.ship_to_org_id
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SELECT hp.party_name
FROM hz_parties hp
,hz_party_sites site
,hz_locations loc
,hz_party_site_uses uses
,fnd_territories_vl terr
,hz_cust_site_uses hcsua
,hz_cust_acct_sites hcasa
WHERE site.party_id = hp.party_id
AND site.location_id = loc.location_id
AND site.party_site_id = uses.party_site_id(+)
AND loc.country = terr.territory_code
AND hp.status = 'A'
AND site.status = 'A'
AND hcsua.status = 'A'
AND uses.site_use_type = 'BILL_TO'
AND NVL (uses.status, 'A') = 'A'
AND hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = site.party_site_id
AND hcsua.site_use_code = uses.site_use_type
AND hcsua.site_use_id = ol.invoice_to_org_id
OTC (Order To Cash Techinical Overview )
Enter order --> Book Order --> Pick Release --> Pick Slip --> Confirm Shipment à Generate Invoice --> Customer follow up --> Receipt --> [Final Reconciliation]
Steps in Cycle:
1. Order Entry
This is first stage, when the order is entered in the system; it creates a record in order headers and Order Lines table.
Enter header details: Once you enter details on the order header and save it or move it to lines, record goes to one table OE_ORDER_HEADERS_ALL
FLOW_STATUS_CODE = ENTERED,
BOOKED_FLAG = N),
Primary key=HEADER_ID
No record exists in any other table for this order till now.
Enter Line details for this order: Enter different item numbers, quantity and other details in line tab. When the record gets saved, it goes to one table. Order header details will be linked with line details by order HEADER_ID.
OE_ORDER_LINES_ALL
FLOW_STATUS_CODE = ENTERED,
BOOKED_FLAG = N,
OPEN_FLAG = Y
Primary key= LINE_ID
2. Order Booking
This is next stage, when Order is booked then the Flow status changed from Entered to Booked.At this stage, these below table get affected.
OE_ORDER_HEADERS_ALL (FLOW_STATUS_CODE as BOOKED, BOOKED_FLAG updated to Y)
OE_ORDER_LINES_ALL (FLOW_STATUS_CODE as AWAITING_SHIPPING, BOOKED_FLAGupdated Y)
WSH_DELIVERY_DETAILS (DELIVERY_DETAIL_ID is assigned here, RELEASED_STATUS ‘R’ ready to release, LINE_ID comes as SOURCE_LINE_ID)
WSH_DELIVERY_ASSIGNMENTS (DELIVERY_ASSIGNMENT_ID is assigned for DELIVERY_DETAIL_ID present in WSH_DELIVERY_DETAILS, DELIVERY_ID remains blank till this stage)
In shipping transaction form order status remains "Ready to Release".
At the same time, Demand interface program runs in background And insert into inventory tables MTL_DEMAND, here LINE_ID come as a reference in DEMAND_SOURCE_LINE
3. Reservation
This step is required for doing reservations SCHEDULE ORDER PROGRAM runs in the background and quantities are reserved. Once these programs get successfully get completed.
MTL_DEMAND andMTL_RESERVATIONS table get updated. LINE_ID gets updated in DEMAND_SOURCE_LINE_ID in both the tables.
4. Pick Release
Pick Release is the process of putting reservation on on-hand quantity available in the inventory and pick them for particular sales order.
Pick release can be done from 'Release Sales Order' form or 'Pick release SRS' program can be scheduled in background. In both of these cases all lines of the order gets pick released depending on the Picking rule used. If specific line/s needs to be pick release it can be done from 'Shipping Transaction form. For this case Pick Release is done from 'Release Sales Order' form with Pick Confirm=NO.
Once pick release is done these are the tables get affected:
· If step 3 is not done then MTL_RESERVATIONS gets updated now.
· WSH_NEW_DELIVERIES (one record gets inserted with SOURCE_HEADER_ID= order header ID, STATUS_CODE=OP =>open)
· WSH_DELIVERY_ASSIGNMENTS (DELIVERY_ID gets assigned which comes from WSH_NEW_DELIVERIES)
· WSH_DELIVERY_DETAILS (RELEASED_STATUS ‘S’ ‘submitted for release’)
· MTL_TXN_REQUEST_HEADERS
· MTL_TXN_REQUEST_LINES (LINE_ID goes as TXN_SOURCE_LINE_ID)
· (move order tables. Here request is generated to move item from Source (RM or FG) sub-inventory to staging sub-inventory)
· MTL_MATERIAL_TRANSACTIONS_TEMP (link to above tables through MOVE_ORDER_HEADER_ID/LINE_ID, this table holds the record temporally)
· MTL_SERIAL_NUMBERS_TEMP (if item is serial controlled at receipt then record goes in this table)
· MTL_SERIAL_NUMBERS (enter value in GROUP_MARK_ID )
*In shipping transaction form order status remains "Released to Warehouse" and all the material still remains in source sub-inventory. We need to do Move Order Transaction for this order. Till this no material transaction has been posted to MTL_MATERIAL_TRANSACTIONS
5. Pick Confirm/ Move Order Transaction
Items are transferred from source sub-inventory to staging Sub-inventory. Here material transaction occurs.
Order line status becomes 'Picked' on Sales Order and 'Staged/Pick Confirmed' on Shipping Transaction Form.
MTL_MATERIAL_TRANSACTIONS_TEMP (Record gets deleted from here and gets posted to MTL_MATERIAL_TRANSACTIONS)
OE_ORDER_LINES_ALL (FLOW_STATUS_CODE ‘PICKED’ )
MTL_MATERIAL_TRANSACTIONS (LINE_ID goes as TXN_SOURCE_LINE_ID)
MTL_TRANSACTION_ACCOUNTS
WSH_DELIVERY_DETAILS (RELEASED_STATUS becomes ‘Y’ => ‘Released’ )
WSH_DELIVERY_ASSIGNMENTS
MTL_ONHAND_QUANTITIES
MTL_SERIAL_NUMBERS_TEMP (record gets inserted after putting details for the item which are serial controlled at 'Sales order issue')
MTL_SERIAL_NUMBERS (record gets inserted after putting details for the item which are serial controlled at 'Sales order issue')
* This step can be eliminated if we set Pick Confirm=YES at the time of Pick Release
6. Ship Confirm
Here is the ship confirm interface program runs in background. Data removed from
WSH_NEW_DELIVERIES. The items on the delivery shipped to customer at this stage
OE_ORDER_LINES_ALL (FLOW_STATUS_CODE ‘shipped’)
WSH_DELIVERY_DETAILS (RELEASED_STATUS ‘C’ ‘Shipped’, SERIAL_NUMBER if quantity is ONE)
WSH_SERIAL_NUMBERS (records gets inserted with the DELIVERY_DETAIL_ID reference, only in case of shipped quantity is two or more)
MTL_TRANSACTION_INTERFACE
MTL_MATERIAL_TRANSACTIONS (linked through Transaction source header id)
MTL_TRANSACTION_ACCOUNTS
Data deleted from MTL_DEMAND, MTL_RESERVATIONS
Item deducted from MTL_ONHAND_QUANTITIES
MTL_SERIAL_NUMBERS_TEMP (records gets deleted from this table)
MTL_SERIAL_NUMBERS (Serial number stauts gets updated CURRENT_STATUS=4 , 'Issued out of store')
7. Enter Invoice
After shipping the order, order lines are eligible to transfer to RA_INTERFACE_LINES_ALL. Workflow background engine picks those records and post it to RA_INTERFACE_LINES_ALL. This is also called Receivable interface, this mean information moved to accounting area for invoicing details. Invoicing workflow activity transfers shipped item information to Oracle Receivables. At the same time records also goes in the table RA_INTERFACE_SALESCREDITS_ALL which hold details of sales credit for the particular order
RA_INTERFACE_LINES_ALL (interface table into which the data is transferred from order management) Then Autoinvoice program imports data from this table which get affected into this stage are receivables base table. At the same time records goes in
RA_CUSTOMER_TRX_ALL (CUST_TRX_ID is primary key to link it to TRX_LINES table and TRX_NUMBER is the invoice number)
RA_CUSTOMER_TRX_LINES_ALL (LINE_ATTRIBUTE_1 and LINE_ATTRIBUTE_6 are linked to order number and LINE_ID of the orders)
8. Complete Line
In this stage order line level table get updated with Flow status and open flag.
OE_ORDER_LINES_ALL (FLOW_STATUS_CODE ‘shipped’, OPEN_FLAG “N”)
9. Close Order
This is last step of Order Processing. In this stage only OE_ORDER_LINES_ALL table get updated. These are the table get affected in this step.
OE_ORDER_LINES_ALL (FLOW_STATUS_CODE ‘closed’, OPEN_FLAG “N”)
To import a routing with operations and resource
BOM_OP_ROUTINGS_INTERFACE
BOM_OP_SEQUENCES_INTERFACE
BOM_OP_RESOURCES_INTERFACE
With these three tables, you can create routing header information and assign
operation and resource details.
PROCESS_FLAG
The column PROCESS_FLAG indicates the current state of processing for a row in the interface table. All inserted rows must have the PROCESS_FLAG set to 1.
1 - Pending
2 - Assigned Succeeded
3 - Assign/Validation Failed
4 - Validation Succeeded
7 - Import Succeeded
BOM_OP_ROUTINGS_INTERFACE TABLE.
a. REQUIRED COLUMNS FOR THE BOM_OP_ROUTINGS_INTERFACE TABLE.
You must always enter values for the following required columns when
you insert rows into the BOM_OP_ROUTINGS_INTERFACE table.
PROCESS_FLAG
ASSEMBLY_ITEM_ID
ORGANIZATION_ID
ROUTING_TYPE
If you are creating an alternate routing, you must also enter a value
in the ALTERNATE_ROUTING_DESIGNATOR column.
If the routing you import references a common routing, you must enter a
value in the COMMON_ASSEMBLY_ITEM_ID or the COMMON_ROUTING_SEQUENCE_ID
columns. Routings can only reference common routings that belong to the
same organization. If the routing does not reference a common routing,
the Bill and Routing Interface program defaults the value of the
ROUTING_SEQUENCE_ID for the COMMON_ROUTING_SEQUENCE_ID.
You can specify, in the ROUTING_TYPE column, whether the routing is a
manufacturing routing or an engineering routing. If you do not include
a value for this column, Oracle Bills of Material defaults a value
of 1 (manufacturing), and creates a manufacturing routing. To create
an engineering routing, you must enter a value of 2 (engineering) for
the ROUTING_TYPE column.
For each new row you insert into the BOM_OP_ROUTINGS_INTERFACE table,
you should set the PROCESS_FLAG to 1 (Pending).
b. DERIVED/DEFAULTED VALUES FOR BOM_OP_ROUTINGS_INTERFACE.
The Bill and Routing Interface program derives or defaults most of the
data required to create a manufacturing or engineering routing.
The Bill and Routing Interface program derives or defaults the columns
using the same logic as the Define Routing form or the Define
Engineering Routing form. When you populate a column in the interface
table, the program imports the row with the data you included and does
not default a value.
If you enter a value for the ASSEMBLY_ITEM_NUMBER or COMMON_ITEM_NUMBER
column, you must insert the system item flexfield separator between each
segment of your item number.
INSERT INTO bom_op_routing_interface
(process_flag
,assembly_item_id
,organization_id
,routing_type
,transaction_type
)
VALUES (1
,&inventory_item_id
,&organization_id
,1
,'insert'
);
BOM_OP_SEQUENCES_INTERFACE TABLE.
a. REQUIRED COLUMNS FOR THE BOM_OP_SEQUENCES_INTERFACE TABLE
Each imported record must have a value for the following columns:
PROCESS_FLAG
ROUTING_SEQUENCE_ID
OPERATION_SEQ_NUM
DEPARTMENT_ID
EFFECTIVITY_DATE
You must also specify a value in the ALTERNATE_ROUTING_DESIGNATOR column
if you assign an operation to an alternate routing and have not entered
a value for the ROUTING_SEQUENCE_ID column.
When you insert rows into BOM_OP_SEQUENCES_INTERFACE, you must set the
PROCESS_FLAG to 1 (Pending) for the Bill and Routing Interface program
to process the record.
b. DERIVED/DEFAULTED COLUMN VALUES FOR BOM_OP_SEQUENCES_INTERFACE.
The Bill and Routing Interface program derives or defaults most of the
data required to assign operations to a routing. You can optionally
include a value for derived or defaulted columns, as well as data for
any of the other columns in the interface. The interface program uses
the same logic to derive or default column values in the
BOM_OP_SEQUENCES_INTERFACE table as in the BOM_OP_ROUTINGS_INTERFACE
table. When you populate a column in the interface table, the program
imports the row with the data you included and does not default a
value. However, if you do not enter data in a derived or defaulted
column, the program automatically imports the row with the derived or
defaulted value.
BOM_OP_SEQUENCES_INTERFACE Derived or Defaulted Value
OPERATION_SEQUENCE_ID Sequence BOM_OPERATIONAL_SEQUENCES_S
ROUTING_SEQUENCE_ID From BOM_OP_ROUTINGS_INTERFACE or
BOM_OPERATIONAL_ROUTINGS
LAST_UPDATE_DATE System Date
LAST_UPDATE_BY Userid
CREATION_DATE System Date
CREATED_BY Userid
STANDARD_OPERATION_ID From OPERATION_CODE
DEPARTMENT_ID From DEPARTMENT_CODE
MINIMUM_TRANSFER_QUANTITY 0
COUNT_POINT_TYPE 1
EFFECTIVITY_DATE System Date
BACKFLUSH_FLAG 1
REQUEST_ID From FND_CONCURRENT_REQUESTS
ASSEMBLY_ITEM_ID From ASSEMBLY_ITEM_NUMBER
OPTION_DEPENDENT_FLAG 2
ORGANIZATION_ID From ORGANIZATION_CODE
RESOURCE_ID1 From RESOURCE_CODE1
RESOURCE_ID2 From RESOURCE_CODE2
RESOURCE_ID3 From RESOURCE_CODE3
INSERT INTO bom_op_sequences_interface
(process_flag
,assembly_item_id
,organization_id
,operation_seq_num
,department_id
,effectivity_date
,transaction_type
)
VALUES (1
,&assembly_item_id
,&organization_id
,&operation_seq_num
,&department_id
,&effectivity_date
,'insert'
);
BOM_OP_RESOURCES_INTERFACE TABLE.
a. REQUIRED COLUMNS FOR THE BOM_OP_RESOURCES_INTERFACE TABLE.
You must always enter values for the following required columns when
you insert rows into the BOM_OP_RESOURCES_INTERFACE table:
PROCESS_FLAG
RESOURCE_SEQ_NUM
RESOURCE_ID
OPERATION_SEQUENCE_ID
You must specify a value in the ALTERNATE_ROUTING_DESIGNATOR column if
you assign resources to an alternate routing and have not entered a
value for the ROUTING_SEQUENCE_ID or the OPERATION_SEQUENCE_ID column.
When you insert a row into the BOM_OP_RESOURCES_INTERFACE table, you
must set the PROCESS_FLAG to 1 (Pending) for the Bill and Routing
Interface program to process the record.
b. DERIVED/DEFAULTED COLUMN VALUES FOR BOM_OP_RESOURCES_INTERFACE.
The Bill and Routing Interface program derives or defaults most of the
data required to assign a resource to an operation. You can optionally
include a value for derived or defaulted columns, as well as data for
any of the other columns in the interface. The interface program uses
the same logic to derive or default column values in the
BOM_OP_RESOURCES_INTERFACE table as in the BOM_OP_ROUTINGS_INTERFACE
table and BOM_OP_SEQUENCES_INTERFACE tables. When you populate a
column in the interface table, the program imports the row with the
data you included and does not default a value. However, if you do not
enter data in a derived or defaulted column, the program automatically
imports the row with the derived or defaulted value.
BOM_OP_RESOURCES_INTERFACE Derived or Defaulted Value
OPERATION_SEQUENCE_ID Sequence BOM_OP_SEQUENCES_INTERFACE or
BOM_OPERATION_SEQUENCES_S
RESOURCE_ID From RESOURCE_CODE
ACTIVITY_ID From ACTIVITY
STATDARD_RATE_FLAG From BOM_RESOURCES.STANDARD_RATE_FLAG
ASSIGNED UNITS 1
USAGE_RATE_OR_AMOUNT 1
USAGE_RATE_OR_AMOUNT_INVERSE 1
BASIS_TYPE From BOM_RESOURCES.DEFAULT_BASIS
SCHEDULE_FLAG 2
LAST_UPDATE_DATE System Date
LAST_UPDATED_BY Userid
CREATION_DATE System Date
CREATED_BY Userid
AUTOCHARGE_TYPE From BOM_RESOURCES.AUTOCHARGE_TYPE
REQUEST_ID From FND_CONCURRENT_REQUESTS
ASSEMBLY_ITEM_ID From ASSEMBLY_ITEM_NUMBER
ORGANIZATION_ID From ORGANIZATION_CODE
ROUTING_SEQUENCE_ID From BOM_OP_ROUTINGS_INTERFACE or
BOM_OPERATIONAL_ROUTINGS
INSERT INTO bom_op_resources_interface
(process_flag
,resource_seq_num
,resource_id
,assembly_item_id
,organization_id
,operation_seq_num
,effectivity_date
,transaction_type
)
VALUES (1
,&resource_seq_num
,&resource_id
,&assembly_item_id
,&organization_id
,&operation_seq_num
,&effectivity_date
,'insert'
);
This Article from Uday Somavarapu BlogSpot
Accounts Payable Suppliers Show In Release 12 Receivables Customer
FAQ: Why Do Accounts Payable Suppliers Show In Release 12 Receivables Customer Form? [ID 733801.1]
Wednesday, August 11, 2010
Items Master and Child Conflict Trouble shooting guide
Tuesday, August 10, 2010
AP Invoices conversion process
Excel Sheet -> Data file -> SQL Loader (Control file) -> Staging Tables -> Run Validation program -> Interface Tables -> Run the Payables Open Invoice Import Program -> Base Tables
Staging tables:
Create a custom staging table XX_AP_INVOICE_INTERFACE, XX_AP_INVOICE_LINES_INTERFACE which should be same as seeded interface table AP_INVOICES_INTERFACE and AP_INVOICE_LINES_INTERFACE.
Interface Tables:
1. AP_INVOICES_INTERFACE
2. AP_INVOICE_LINES_INTERFACE
Base Tables:
1. AP_INVOICES_ALL
2. AP_INVOICE_DISTRIBUTIONS_ALL
3. AP_PAYMENT_SCHEDULES_ALL
Process Flow:
-----------------
1. Excel sheet template is prepared which contains all the columns in AP_INVOICES_INTERFACE and AP_INVOICE_LINES table.
2. Convert the Excel Sheet which contains data to be interfaced given by the user into CSV file format.
3. Format the CSV file so that it contains only the relevant data separated with commas.
4. Rename the CSV into DAT file.
5. Prepare the Control File.
6. Run SQL Loader Script.
7. Check the Log file for any errors. In case of any errors rectify it and re-run the SQL Loader Script.
8. Run the PL/SQL Program to validate staging table data and load to Interface tables.
9. Run the Payables Open Invoice Import Program.
10. Check for the status in the Interface Table.
11. Query for the data in the front-end.
Monday, August 9, 2010
Script to Cancel AP Invoices
CREATE OR REPLACE PROCEDURE cancel_invoices (ip_operating_unit IN VARCHAR2)
AS
l_resp_id NUMBER;
l_appl_id NUMBER;
l_user_id NUMBER := apps.fnd_global.user_id;
l_org_id NUMBER := apps.fnd_global.org_id;
l_message_name VARCHAR2 (1000);
l_invoice_amount NUMBER;
l_base_amount NUMBER;
l_tax_amount NUMBER;
l_temp_cancelled_amount NUMBER;
l_cancelled_by VARCHAR2 (1000);
l_cancelled_amount NUMBER;
l_cancelled_date DATE;
l_last_update_date DATE;
l_original_prepayment_amount NUMBER;
l_pay_curr_invoice_amount NUMBER;
l_token VARCHAR2 (100);
l_boolean BOOLEAN;
err_msg VARCHAR2 (2000);
CURSOR invoice_cur
IS
SELECT aia.invoice_id, aia.last_updated_by, aia.last_update_login,
aia.gl_date, aia.invoice_num
FROM xx_ap_invoices_conv_stg a,
ap_invoices_all aia,
ap_invoice_lines_all aila
WHERE a.ls_inv_num = aia.invoice_num
AND a.ls_org_id = aia.org_id
AND aia.invoice_id = aila.invoice_id
AND aia.org_id = aila.org_id
AND aia.payment_status_flag = 'N'
AND NVL (aila.cancelled_flag, 'N') <> 'Y';
--- AND aia.invoice_num = '65431';
BEGIN
BEGIN
SELECT DISTINCT fr.responsibility_id, frx.application_id
INTO l_resp_id, l_appl_id
FROM apps.fnd_responsibility frx,
apps.fnd_responsibility_tl fr
WHERE fr.responsibility_id = frx.responsibility_id
AND UPPER (fr.responsibility_name) LIKE
UPPER (DECODE (ip_operating_unit,
'OU USA MA', 'Payables Manager',
'OU USA WI', 'OU USA WI_Payables Manager',
'OU Austria', 'OU AUSTRIA_Payables Manager',
'OU China', 'OU CHINA_Payables Manager'
)
);
DBMS_OUTPUT.put_line ('l_resp_id => ' || l_resp_id);
DBMS_OUTPUT.put_line ('l_appl_id => ' || l_appl_id);
EXCEPTION
WHEN OTHERS
THEN
err_msg :=
'Error Occured while Deriving responsibility id' || SQLERRM;
apps.fnd_file.put_line
(apps.fnd_file.output,
'Error Occured while Deriving responsibility id'
);
END;
mo_global.set_policy_context ('S', l_org_id);
apps.fnd_global.apps_initialize (l_user_id, l_resp_id, l_appl_id);
FOR l_inv_rec IN invoice_cur ----(l_org_id)
LOOP
DBMS_OUTPUT.put_line
( 'Calling API ap_cancel_pkg.ap_cancel_single_invoice to Cancel Invoice: '
|| l_inv_rec.invoice_num
);
DBMS_OUTPUT.put_line
('**************************************************************');
l_boolean :=
ap_cancel_pkg.ap_cancel_single_invoice
(p_invoice_id => l_inv_rec.invoice_id,
p_last_updated_by => l_inv_rec.last_updated_by,
p_last_update_login => l_inv_rec.last_update_login,
p_accounting_date => l_inv_rec.gl_date,
p_message_name => l_message_name,
p_invoice_amount => l_invoice_amount,
p_base_amount => l_base_amount,
p_temp_cancelled_amount => l_temp_cancelled_amount,
p_cancelled_by => l_cancelled_by,
p_cancelled_amount => l_cancelled_amount,
p_cancelled_date => l_cancelled_date,
p_last_update_date => l_last_update_date,
p_original_prepayment_amount => l_original_prepayment_amount,
p_pay_curr_invoice_amount => l_pay_curr_invoice_amount,
p_token => l_token,
p_calling_sequence => NULL
);
DBMS_OUTPUT.put_line ('l_message_name => ' || l_message_name);
DBMS_OUTPUT.put_line ('l_invoice_amount => ' || l_invoice_amount);
DBMS_OUTPUT.put_line ('l_base_amount => ' || l_base_amount);
DBMS_OUTPUT.put_line ('l_tax_amount => ' || l_tax_amount);
DBMS_OUTPUT.put_line ( 'l_temp_cancelled_amount => '
|| l_temp_cancelled_amount
);
DBMS_OUTPUT.put_line ('l_cancelled_by => ' || l_cancelled_by);
DBMS_OUTPUT.put_line ('l_cancelled_amount => ' || l_cancelled_amount);
DBMS_OUTPUT.put_line ('l_cancelled_date => ' || l_cancelled_date);
DBMS_OUTPUT.put_line ('P_last_update_date => ' || l_last_update_date);
DBMS_OUTPUT.put_line ( 'P_original_prepayment_amount => '
|| l_original_prepayment_amount
);
DBMS_OUTPUT.put_line ( 'l_pay_curr_invoice_amount => '
|| l_pay_curr_invoice_amount
);
IF l_boolean
THEN
DBMS_OUTPUT.put_line ( 'Successfully Cancelled the Invoice => '
|| l_inv_rec.invoice_num
);
COMMIT;
ELSE
DBMS_OUTPUT.put_line ( 'Failed to Cancel the Invoice => '
|| l_inv_rec.invoice_num
);
ROLLBACK;
END IF;
END LOOP;
END cancel_invoices;
Monday, August 2, 2010
Item Import Overview
Item Import Overview
Use the item import process to import items from your legacy system or PDM system. You can import items from any source into Oracle Inventory and Oracle Engineering. When you import items through the Item Interface, you create new items in your Item Master organization or assign existing items to additionalorganizations. You can specify values for all the item attributes, or you canspecify just a few attributes and let the remainder default or remain Null. You can also specify an item template for each item and inherit attribute values from the template. The Item Interface also lets you import revision details, including past and future revisions and effectivity dates. Validation of imported items is done using the same rules as the item definition forms, so you are insured of valid items.The Item Interface reads data from two tables for importing items and item details. You use the MTL_SYSTEMS_ITEM_INTERFACE table for new item numbers and all item attributes. This is the main item interface table, and can be the only table you choose to use. If you are importing revision details for new items, you can use the MTL_ITEM_REVISIONS_INTERFACE table. A third table, MTL_INTERFACE_ERRORS, is used for error tracking of all items that the Item Interface fails. You can import item categories using interface table called as MTL_ITEM_CATEGORIES_INTERFACE.Before you use the Item Interface, you must write and run a custom program that extracts item information from your source system and inserts it into the MTL_SYSTEM_ITEM_INTERFACE table, and (if revision detail is included) the MTL_ITEMS_REVISIONS_INTERFACE table. After you load the items into these interface tables, you run the Item Interface to import the data. The Item Interface assigns defaults, validates data you include, and then imports the new items. You may also specify an item template for each item being imported. You must import items into the Item Master organization before you import itemsinto additional organizations. You can accomplish this by specifying only your Item Master organization on first run of the Item Interface. Once this has completed, you can run the Item Interface again, this time specifying an additional or all organizations. You can also use the Item Interface to import a single item material cost and material overhead, and revision details.Below we will walk through few scenarios of item import. Scenario:
1Testing the basic item import with minimum columns populated.
First always try to populate the master organization with a sample record and test.1. How do I know my organization code and organization id ?Select organization_code , organization_id from org_organization_definitionsorder by organization_code;Sample out put is below.ORG ORGANIZATION_ID--- -------------------------------V1 204M1 207M2 209M3 606M4 1641M5 1642M6 1643M7 1644....2. How do I know which organization is master to a child organization?select a.organization_id ,a.organization_code,a.master_organization_id,b.organization_code from mtl_parameters a, org_organization_definitions bwhere a.master_organization_id = b.organization_idorder by a.organization_code;Sample out put is belowORGANIZATION_ID ORG MASTER_ORGANIZATION_ID ORG--------------------------- ------- ---------------------------------------- ------- 204 V1 204 V1 207 M1 204 V1 209 M2 204 V1 606 M3 204 V1 1641 M4 204 V1 1642 M5 204 V1 1643 M6 204 V1 1644 M7 204 V1 .....In the above example for organizations M1 to M7, V1 organization is the master organization.Populating V1 organization with one new item using just the basic columns.Please truncate all IOI interface tables before loading mtl_system_items_interface: ex. TRUNCATE TABLE
Friday, July 16, 2010
Increasing Performance in cursor
/*+PARALLEL(OL, 10) */
CURSOR cur_month_usage
IS
SELECT /*+PARALLEL(OL, 10) */
ol.sold_to_org_id,
(SELECT hc.account_number
FROM apps.hz_cust_accounts hc
WHERE 1 = 1
AND hc.cust_account_id = ol.sold_to_org_id)
Wednesday, July 14, 2010
Examples of the to_date function
to_date('10-12-06','MM-DD-YY')
to_date('jan 2007','MON YYYY')
to_date('2007/05/31','YYYY/MM/DD')
to_date('12-31-2007 12:15','MM-DD-YYYY HH:MI')
to_date('2006,091,00:00:00' , 'YYYY,DDD,HH24:MI:SS')
to_date('15-may-2006 06:00:01','dd-mon-yyyy hh24:mi:ss')
to_date('022002','mmyyyy')
to_date('12319999','MMDDYYYY')
to_date(substr( collection_started,1,12),'DD-MON-YY HH24')
to_date('2004/10/14 21', 'yyyy/mm/dd hh24')
TO_DATE(First_Load_Time, 'yyyy-mm-dd/hh24:mi:ss'))*24*60)
To see the current system date and time with time zone use CURRENT_DATE function
select sysdate, sysdate+1/24, sysdate +1/1440, sysdate + 1/86400 from dual;
select sysdate NOW, sysdate+30/(24*60*60) NOW_PLUS_30_SECS from dual;
NOW NOW_PLUS_30_SECS
-------------------- --------------------
03-JUL-2005 16:47:23 03-JUL-2005 16:47:53