1) you need to reference C_cursor in the loop (not r_cursor) - typo?

2) since it's PL/SQL, I'd do a "SELECT INTO myvar" before the INSERT and use myvar in the DECODE
otherwise try:
select decode(l_date_flag, 'Y', last_day(add_months(sysdate, -1)),'E', requested_current, sysdate)
from so_headers_all where header_id= r_cursor.HEADER_ID