Wednesday, July 29, 2020

Query to find ship_to and bill_to site Id for Sales order Import Oracle Cloud 20a (Oracle Fusion Sales order Import )

SELECT  hzp.party_name
        ||
        ' '
        ||
        hzp.party_number                                   ,
        hzp.party_id                                       ,
        HZA.account_number                                 ,
        HZA.Account_name                                   ,
        hza.CUST_ACCOUNT_ID                                ,
        HZA.status "Account Status"                        ,
        hzp.status "Party Status"                          ,
        hzps.status "Party Site Status"                    ,
        hzps.party_site_id "PARTY SITE ID - for SHIP_TO"   ,
        hzcasa.status "Account Site Status"                ,
        hzcsua.site_use_id "Account Site ID - for BILL_TO" ,
        hzcasa.start_Date                                  ,
        hzcasa.end_Date                                    ,
        hzcsua.SITE_USE_CODE                               ,
        hzcasa.BILL_TO_FLAG                                ,
        hzcasa.SHIP_TO_FLAG                                ,
        hzcsua.PRIMARY_FLAG                                ,
        hzcsua.STATUS "Account Site USE Status"            ,
        hzcsua.LOCATION                                    ,
        hzl.ADDRESS1                                       ,
        hzl.ADDRESS2                                       ,
        hzl.ADDRESS3                                       ,
        hzl.ADDRESS4                                       ,
        hzl.CITY                                           ,
        hzl.POSTAL_CODE                                    ,
        hzl.STATE                                          ,
        hzl.COUNTRY                                        ,
        hzl.LOCATION_ID
FROM    fusion.HZ_PARTIES HZP               ,
        fusion.HZ_PARTY_SITES hzps          ,
        fusion.HZ_CUST_ACCOUNTS HZA         ,
        fusion.HZ_CUST_ACCT_SITES_ALL hzcasa,
        fusion.HZ_CUST_SITE_USES_ALL hzcsua ,
        fusion.hz_locations HZL
WHERE   hzP.party_id                 = HZA.party_id (+)
        AND hza.CUST_ACCOUNT_ID      = hzcasa.CUST_ACCOUNT_ID (+)
        AND hzcasa.party_site_id     = hzps.party_site_id (+)
        AND hzcasa.cust_acct_site_id = hzcsua.cust_acct_site_id (+)
        AND hzps.location_id         = hzl.location_id (+)
        --         and       (
        --                      hzcasa.start_Date    <= sysdate
        --                        OR hzcasa.start_Date IS NULL
        --                )
        --                AND
        --                (
        --                        hzcasa.end_date    >= sysdate
        --                        OR hzcasa.end_date IS NULL
        --                )
        AND upper(hzP.party_name) LIKE upper('%&CUSTOMER_NAME%')
ORDER BY hzp.party_number ,
        hza.account_number,
        hzl.LOCATION_ID;

----------------------------------------------------------------
Refer Oracle not : 2474011.1  for more details.

No comments:

Post a Comment

SOAP Payload to get Sales Order Details Oracle cloud 20a (Oracle Fusion Sales order details)

Use SOAP UI --------------------------------------------------------------------------------------------------- Service WSDL URL:  https://X...