Shipping Networks Query R12


SELECT
    MP1.ORGANIZATION_CODE FROM_ORGANIZATION_CODE ,
    HOU1.NAME FROM_ORGANIZATION_NAME ,
    MP1.INTERORG_TRNSFR_CHARGE_PERCENT FROM_CHARGE_PERCENT_DUMMY ,
    MP2.ORGANIZATION_CODE TO_ORGANIZATION_CODE ,
    HOU2.NAME TO_ORGANIZATION_NAME ,
    NET.FROM_ORGANIZATION_ID ,
    NET.TO_ORGANIZATION_ID ,
    --NET.INTRANSIT_INV_ACCOUNT ,
    (select GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5||'-'||GCC.SEGMENT6
       ||'-'||GCC.SEGMENT7||'-'||GCC.SEGMENT8 "ACCOUNT COMBINATION" from GL_CODE_COMBINATIONS GCC where GCC.CODE_COMBINATION_ID = NET.INTRANSIT_INV_ACCOUNT )INTRANSIT_INV_ACCOUNT,
    --NET.INTERORG_TRANSFER_CR_ACCOUNT ,
     (select GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5||'-'||GCC.SEGMENT6
       ||'-'||GCC.SEGMENT7||'-'||GCC.SEGMENT8 "ACCOUNT COMBINATION" from GL_CODE_COMBINATIONS GCC where GCC.CODE_COMBINATION_ID = NET.INTERORG_TRANSFER_CR_ACCOUNT  )INTERORG_TRANSFER_CR_ACCOUNT ,
    --NET.INTERORG_RECEIVABLES_ACCOUNT ,
     (select GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5||'-'||GCC.SEGMENT6
       ||'-'||GCC.SEGMENT7||'-'||GCC.SEGMENT8 "ACCOUNT COMBINATION" from GL_CODE_COMBINATIONS GCC where GCC.CODE_COMBINATION_ID = NET.INTERORG_RECEIVABLES_ACCOUNT )INTERORG_RECEIVABLES_ACCOUNT,
     
   -- NET.INTERORG_PAYABLES_ACCOUNT ,
    (select GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5||'-'||GCC.SEGMENT6
       ||'-'||GCC.SEGMENT7||'-'||GCC.SEGMENT8 "ACCOUNT COMBINATION" from GL_CODE_COMBINATIONS GCC where GCC.CODE_COMBINATION_ID = NET.INTERORG_PAYABLES_ACCOUNT )INTERORG_PAYABLES_ACCOUN,
   -- NET.INTERORG_PRICE_VAR_ACCOUNT
    (select GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5||'-'||GCC.SEGMENT6
       ||'-'||GCC.SEGMENT7||'-'||GCC.SEGMENT8 "ACCOUNT COMBINATION" from GL_CODE_COMBINATIONS GCC where GCC.CODE_COMBINATION_ID = NET.INTERORG_PRICE_VAR_ACCOUNT )INTERORG_PRICE_VAR_ACCOUNT
    FROM MTL_PARAMETERS MP1,
    MTL_PARAMETERS MP2,
    HR_ORGANIZATION_UNITS HOU1,
    HR_ORGANIZATION_UNITS HOU2,
    MTL_INTERORG_PARAMETERS NET
  WHERE MP1.ORGANIZATION_ID = NET.FROM_ORGANIZATION_ID
  AND MP2.ORGANIZATION_ID   = NET.TO_ORGANIZATION_ID
  and HOU1.ORGANIZATION_ID  = MP1.ORGANIZATION_ID
  and HOU2.ORGANIZATION_ID  = MP2.ORGANIZATION_ID;

Post a Comment