it cannot display the parameter value for the TABLE_B.VAL1 AS VAL1 in your query because we are doing a outer join on table_A and hence it can only get values for those columns which are found in table_A.
SELECT
SUBQ.VAL,
nvl(SUBQ.VAL1,'GRP2'), --> hard code your parameter value here so that it can return.
SUBQ.VAL2,
SUBQ.DATE_b,
date_a
FROM
(SELECT
TABLE_A.VAL AS VAL,
TABLE_B.VAL1 AS VAL1,
TABLE_B.VAL2 AS VAL2,
TABLE_B.DATE_b AS DATE_b,
table_a.date_a as date_a
FROM
TABLE_B RIGHT OUTER JOIN TABLE_A ON TABLE_B.ID = TABLE_A.ID
AND TABLE_A.VAL = 'ABC'
AND TABLE_B.VAL1 = 'GRP2' --> this is another place the parameter value needs to be changed.
AND TABLE_B.DATE_b < TABLE_A.DATE_a
ORDER BY
TABLE_B.DATE_b DESC)SUBQ;
i am not sure but you can try with FULL OUTER JOIN if you want the column values from table_B as well to appear there.
Thanks