Hi,
You can try the following:
PROCESS BEFORE OUTPUT.
LOOP WITH CONTROL table_pp_cr.
MODULE show_data_(your internal table).
ENDLOOP.
MODULE show_data_(your internal table) OUTPUT.
READ TABLE (your internal table) INDEX table_pp_cr-current_line.
IF sy-subrc = 0.
(transfer your internal table field values to screen field here)
ELSE.
CLEAR your internal table.
ENDIF.
ENDMODULE.
Module PAI
MODULE modify_(your internal table) INPUT.
(transfer screen values to internal table)
MODIFY (your internal table) INDEX table_pp_cr-current_line.
IF sy-subrc <> 0.
CHECK (your internal table field) <> ' '.
APPEND (your internal table).
ENDIF.
ENDMODULE.
Hope this will help you to solve the issue. Please let us know.
Regards,
Anubhab