Requirement: We need to fetch cancelled sale order line return reason query.
Navigation: Order Management Responsibility > Sales Order > Action > Additional Information > Quantity Hitrory.
SQL Query:
(select LISTAGG( FLV.MEANING, ',') WITHIN GROUP (ORDER BY FLV.MEANING)
from
OE_REASONS OER,
fnd_lookup_values_vl FLV
where
FLV.LOOKUP_TYPE=OER.REASON_TYPE
AND FLV.LOOKUP_CODE=OER.REASON_CODE
AND OER.HEADER_ID=OOHA.HEADER_ID --Need to pass order header Id
AND OER.ENTITY_ID=OOLA.LINE_ID -- Need to pass order line Id
) return_reason_code