Tuesday, September 29, 2015

Query to find Full Address of Legal Entity

SELECT (xlep.name || '(' || xlep.LEGAL_ENTITY_IDENTIFIER || ')'
           || CHR (10) ||hl.address_line_1
           || CASE WHEN hl.address_line_2 IS NOT NULL THEN CHR (10) || hl.address_line_2 END
           || CASE WHEN hl.address_line_3 IS NOT NULL THEN CHR (10) || hl.address_line_3 END
           || DECODE (
                 NVL (NVL (hl.town_or_city, hrlkp.meaning), hl.postal_code),
                 NULL,
                 NULL,
                 CHR (10)
              )
           || DECODE (hl.town_or_city, NULL, NULL, hl.town_or_city || ', ')
           || DECODE (hrlkp.meaning, NULL, NULL, hrlkp.meaning || ' ')
           || DECODE (hl.postal_code, NULL, NULL, hl.postal_code)
           || DECODE (ftt.territory_short_name, NULL, NULL, CHR (10))
           || ftt.territory_short_name
           || DECODE (hl.telephone_number_1, NULL, NULL, CHR (10))
           || DECODE (hl.telephone_number_1,
                      NULL, NULL,
                      'Tel: ' || hl.telephone_number_1)
           || DECODE (hl.telephone_number_2, NULL, NULL, CHR (10))
           || DECODE (hl.telephone_number_2,
                      NULL, NULL,
                      'Fax: ' || hl.telephone_number_2)
           || DECODE (hl.attribute1, NULL, NULL, CHR (10))
           || DECODE (hl.attribute1, NULL, NULL, 'Email: ' || hl.attribute1))
     FROM xle_entity_profiles xlep,
          xle_registrations xlr,
          hr_locations hl,
          fnd_territories_tl ftt,
          hr_lookups hrlkp
    WHERE 1 = 1
      AND xlep.legal_entity_id = xlr.source_id
      AND xlr.source_table = 'XLE_ENTITY_PROFILES'
      AND xlr.location_id = hl.location_id
      AND hl.country = ftt.territory_code
      AND hl.region_2 = hrlkp.lookup_code(+)
      AND hrlkp.lookup_type(+) = 'US_STATE'
     AND xlep.legal_entity_id = 29275--------Legal Entity Id

1 comment:

  1. We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. Legal Entity Identifier Number

    ReplyDelete

Clear BNE Cache for WebADI Changes

It Sometime happens that WebAdi Changes doesn't reflect once migrated in controlled instances. Here are the quick steps(Generally perfor...