How to create a sale order using open interfaces R12


Create header records in sale orders open interface tables

  • Order sources can be through Telesales, Online channel, iStores, Siebel CRM or any custom sources (Check OE_ORDER_SOURCES table)
  • original system document reference should be used to create sale order
  • Org id indicates operating unit for which sale order to be booked
  • Price list for sales order
  • Payment terms to be assigned to sale order
  • currency
  • bill to, ship to org id indicates site use id of customer accounts
  • sold from and sold to org id indicates operating units
  • ship from org id indicates sub-inventory org id
  • invoice to org id indicates bill to -site use id of customer accounts
  • customer id indicates customer account id
  • booked flag = 'Yes'
  • operation code = 'Insert' mode for new sale orders


INSERT
INTO apps.oe_headers_iface_all
  ( order_source_id ,
    orig_sys_document_ref ,
    org_id ,
    ordered_date ,
    order_type_id ,
    price_list_id ,
    transactional_curr_code ,
    salesrep_id ,
    payment_term_id ,
    sold_from_org_id ,
    sold_to_org_id ,
    ship_from_org_id ,
    ship_to_org_id ,
    invoice_to_org_id ,
    customer_id ,
    created_by ,
    creation_date ,
    last_updated_by ,
    last_update_date ,
    request_date ,
    booked_flag ,
    closed_flag ,
    operation_code ,
    change_sequence )
  VALUES
  ( 1001 ,
    v_orig_sys_doc_ref ,
    v_org_id ,
    TRUNC(p_date) ,
    v_order_type ,
    v_price_list_id ,
    'AED' ,
    v_salesrep_id ,
    v_payment_term ,
    v_sold_from_org ,
    v_sold_to_org ,
    v_ship_from_org ,
    v_ship_to_org ,
    v_invoice_to_org ,
    v_cust_id ,
    fnd_global.user_id ,
    TRUNC(p_date) ,
    fnd_global.user_id ,
    TRUNC(p_date) ,
    TRUNC(p_date) ,
    'Y' ,
    'N' ,
    'INSERT' ,
    NULL );

Create sale order lines in standard open interface tables

INSERT
INTO apps.oe_lines_iface_all
  ( order_source_id ,
    orig_sys_document_ref ,
    orig_sys_line_ref ,
    org_id ,
    line_type_id ,
    line_number ,
    inventory_item_id ,
    calculate_price_flag ,
    schedule_ship_date ,
    ordered_quantity ,
    order_quantity_uom ,
    sold_from_org_id ,
    sold_to_org_id ,
    ship_from_org_id ,
    ship_to_org_id ,
    invoice_to_org_id ,
    price_list_id ,
    unit_list_price ,
    unit_selling_price ,
    payment_term_id ,
    salesrep_id ,
    created_by ,
    creation_date ,
    last_updated_by ,
    last_update_date ,
    request_date ,
    subinventory ,
    change_sequence ,
    operation_code )
  VALUES
  ( 1001 ,
    v_orig_sys_doc_ref ,
    v_line_ref ,
    v_org_id ,
    1226 ,
    v_slno ,
    rec_lns.item_id,
    'N' ,
    TRUNC(p_date) ,
    rec_lns.qty ,
    rec_lns.uom ,
    v_sold_from_org ,
    v_sold_to_org ,
    v_ship_from_org ,
    v_ship_to_org ,
    v_invoice_to_org ,
    rec_lns.price_list_id ,
    rec_lns.unit_price ,
    rec_lns.unit_price ,
    v_payment_term ,
    v_salesrep_id ,
    fnd_global.user_id ,
    TRUNC(p_date) ,
    fnd_global.user_id ,
    TRUNC(p_date) ,
    TRUNC(p_date) ,
    rec_lns.route ,
    NULL ,
    'INSERT' );

Comments

Popular posts from this blog

Query to get FSG report details with row/column set

How to use lexical parameters in Data template (XML document) R12

Sub Inventory Transfer API.