*
* This program downloads the custom developed abap programs
* to a UNIX text file.
*
REPORT ZABAPSAV.

DATA: BEGIN OF ITAB OCCURS 500,
      C(72),
END OF ITAB.
PARAMETERS: OUTFILE(50) DEFAULT '/tmp/abaps' LOWER CASE..
DATA: HEADER(72), SPC(72) VALUE ' '.
TABLES: TRDIR.
OPEN DATASET OUTFILE IN TEXT MODE FOR OUTPUT.

SELECT * FROM TRDIR WHERE NAME LIKE 'Z%' OR NAME LIKE 'Y%'.
  HEADER = '#@$%&*************  '.
  HEADER+20 = TRDIR-NAME.
  HEADER+30 = TRDIR-CNAM.
  HEADER+40 = TRDIR-UDAT.
  HEADER+54 = '******************'.
  TRANSFER SPC TO OUTFILE.
  TRANSFER HEADER TO OUTFILE.
  TRANSFER SPC TO OUTFILE.
  CLEAR ITAB. REFRESH ITAB.
  READ REPORT TRDIR-NAME INTO ITAB.
  LOOP AT ITAB.
    TRANSFER ITAB TO OUTFILE.
  ENDLOOP.
ENDSELECT.
CLOSE DATASET OUTFILE.