Infolinks

Monday, 24 September 2012

Import an Order with its customer account and address using Order Import Process

Import an Order with its customer account and address using Order Import Process


Import an order, the customer account, and the customer address using Order Import process

In this example, the address is categorized as Bill_To and Ship_To address.

1. Populate the order import interface tables.
INSERT INTO oe_headers_iface_all (order_source_id,
                                  orig_sys_document_ref,
                                  operation_code,
                                  ordered_date,

                                  order_type_id,
                                  price_list_id,
                                  orig_sys_customer_ref,
                                  orig_bill_address_ref,
                                  created_by,
                                  creation_date,
                                  last_updated_by,
                                  last_update_date)
     VALUES (1046,                                          -- order_source_id
             'IL070524-01',                           -- orig_sys_document_ref
             'INSERT',                                       -- operation_code
             SYSDATE,                                          -- ordered_date
             1430,                                            -- order_type_id
             1000,                                            -- price_list_id
             'IL CUST ACT 01',                        -- orig_sys_customer_ref
             'IL CUST ADD 01',                        -- orig_bill_address_ref
             1007880,                                            -- created_by
             SYSDATE,                                         -- creation_date
             1007880,                                       -- last_updated_by
             SYSDATE                                       -- last_update_date
                    );

INSERT INTO OE_CUSTOMER_INFO_IFACE_ALL (CREATED_BY,
                                        CREATION_DATE,
                                        CUSTOMER_INFO_REF,
                                        CUSTOMER_INFO_TYPE_CODE,
                                        CUSTOMER_NUMBER,
                                        CUSTOMER_TYPE,
                                        LAST_UPDATE_DATE,
                                        LAST_UPDATED_BY,
                                        ORGANIZATION_NAME,
                                        EMAIL_ADDRESS)
     VALUES (1007880,                                            -- created_by
             SYSDATE,                                         -- creation_date
             'IL CUST ACT 01',                            -- customer_info_ref
             'ACCOUNT',                             -- customer_info_type_code
             'IL CUST 001',                                 -- customer_number
             'ORGANIZATION',                                  -- customer_type
             SYSDATE,                                      -- last_update_date
             1007880,                                       -- last_updated_by
             'IL NEW ORG 01',                             -- organization_name
             'one@one.com'                                    -- email_address
                          );

INSERT INTO OE_CUSTOMER_INFO_IFACE_ALL (ADDRESS1,
                                        ADDRESS2,
                                        ADDRESS3,
                                        ADDRESS4,
                                        CITY,
                                        COUNTRY,
                                        CREATED_BY,
                                        CREATION_DATE,
                                        CUSTOMER_INFO_REF,
                                        CUSTOMER_INFO_TYPE_CODE,
                                        IS_BILL_TO_ADDRESS,
                                        IS_SHIP_TO_ADDRESS,
                                        LAST_UPDATE_DATE,
                                        LAST_UPDATED_BY,
                                        PARENT_CUSTOMER_REF,
                                        POSTAL_CODE,
                                        STATE)
     VALUES ('III rd Floorb',                                      -- address1
             '200 Rhode Island',                                   -- address2
             'San Francisco',                                      -- address3
             'CA 94103',                                           -- address4
             'San Francisco',                                          -- city
             'US',                                                  -- country
             1007880,                                            -- created_by
             SYSDATE,                                         -- creation_date
             'IL CUST ADD 01',                            -- customer_info_ref
             'ADDRESS',                             -- customer_info_type_code
             'Y',                                        -- is_bill_to_address
             'Y',                                        -- is_ship_to_address
             SYSDATE,                                      -- last_update_date
             1007880,                                       -- last_updated_by
             'IL CUST ACT 01',                          -- parent_customer_ref
             '94103',                                           -- postal_code
             'CA'                                                     -- state
                 );
Note:
You only need to have one record with customer_info_type_code = 'ADDRESS' in OE_CUSTOMER_INFO_IFACE_ALL if the address has Ship-To and Bill-To Business Purpose.
2. Run Order Import process
It should import new order and new customer account, customer address.

No comments:

Post a Comment