<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Program to download programs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001245#M956029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code will download many programs into the text format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZKRIS_DOWNLOAD_MANY_PROGRAMS
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Author  : Kris Donald
*&amp;amp; Purpose : Download many programs for backup (wildcard based)
*&amp;amp;---------------------------------------------------------------------*

REPORT ZKRIS_DOWNLOAD_MANY_PROGRAMS.

TABLES tadir.

TYPES: BEGIN OF t_type,
  line(256),
  END OF t_type.

DATA rep_table TYPE STANDARD TABLE OF t_type WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 500.

DATA: file TYPE string,"RLGRAP-FILENAME.
path TYPE string.

selection-screen begin of block b1 with frame title frttl.

PARAMETER: obj_name LIKE tadir-obj_name DEFAULT 'Z%'.

SELECT-OPTIONS: object FOR tadir-object DEFAULT 'PROG',
author FOR tadir-author DEFAULT sy-uname,
devclass FOR tadir-devclass.

selection-screen end of block b1.

initialization.
  frttl = 'Choose your options'.

START-OF-SELECTION.

DATA: BEGIN OF it_table OCCURS 0,
  obj_name LIKE tadir-obj_name,
  END OF it_table.

DATA: BEGIN OF wa_table,
  obj_name LIKE tadir-obj_name,
  END OF wa_table.

DATA: message_text TYPE string.

  IF devclass-high &amp;lt;&amp;gt; ''.
    CONCATENATE 'C:\BACKUP-' sy-datum+6(2) '.' sy-datum+4(2) '.'
    sy-datum+0(4) '-' sy-sysid '-' devclass-low
    '-' devclass-high '\'
    INTO path.
  ELSE.
    CONCATENATE 'C:\BACKUP-' sy-datum+6(2) '.' sy-datum+4(2) '.'
    sy-datum+0(4) '-' sy-sysid '-' devclass-low
    '\'
    INTO path.
  ENDIF.
  CONDENSE path NO-GAPS.

  SELECT obj_name INTO TABLE it_table FROM tadir
    WHERE obj_name LIKE obj_name AND
    object IN object AND
    author IN author AND
    devclass IN devclass.

  SORT it_table BY obj_name.
  LOOP AT it_table INTO wa_table.

    READ REPORT wa_table-obj_name INTO rep_table.
    IF wa_table-obj_name CS '\'.
    ELSE.
      CLEAR file.
      CONCATENATE path wa_table-obj_name '.TXT' INTO file.
      IF sy-subrc = 0.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'ASC'
          TABLES
            data_tab                = rep_table
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            OTHERS                  = 22.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          WRITE :/ 'File download error,Message code:',sy-subrc,
          ' creating file ',file.
        ENDIF.
      ELSE.
        WRITE: / 'Error Occured'.
      ENDIF.
    ENDIF.
  ENDLOOP.
  message_text = 'FILE(S) CREATED IN FOLDER'.
  CONCATENATE message_text path INTO message_text SEPARATED BY space.
  MESSAGE message_text TYPE 'I'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jun 2008 04:20:55 GMT</pubDate>
    <dc:creator>former_member189059</dc:creator>
    <dc:date>2008-06-20T04:20:55Z</dc:date>
    <item>
      <title>Program to download programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001242#M956026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been using a Z- program naming ZASDOWNLOAD which was used for downloading the programs, packages from system to HTML format... unfortunately that program has been deleted from my system during upgrade.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone please provide me with that or give me the name of website to download it from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;Prateek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 03:47:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001242#M956026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T03:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Program to download programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001243#M956027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prateek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check this link&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="405455"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 03:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001243#M956027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T03:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Program to download programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001244#M956028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sap has provided the utility called 'save as local file'.... why dont u use that.... i feel u need the code of the program, right?? then save as local file is the best option..... its next to the code checker button on the panel as pretty printer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 04:04:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001244#M956028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T04:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Program to download programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001245#M956029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code will download many programs into the text format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZKRIS_DOWNLOAD_MANY_PROGRAMS
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Author  : Kris Donald
*&amp;amp; Purpose : Download many programs for backup (wildcard based)
*&amp;amp;---------------------------------------------------------------------*

REPORT ZKRIS_DOWNLOAD_MANY_PROGRAMS.

TABLES tadir.

TYPES: BEGIN OF t_type,
  line(256),
  END OF t_type.

DATA rep_table TYPE STANDARD TABLE OF t_type WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 500.

DATA: file TYPE string,"RLGRAP-FILENAME.
path TYPE string.

selection-screen begin of block b1 with frame title frttl.

PARAMETER: obj_name LIKE tadir-obj_name DEFAULT 'Z%'.

SELECT-OPTIONS: object FOR tadir-object DEFAULT 'PROG',
author FOR tadir-author DEFAULT sy-uname,
devclass FOR tadir-devclass.

selection-screen end of block b1.

initialization.
  frttl = 'Choose your options'.

START-OF-SELECTION.

DATA: BEGIN OF it_table OCCURS 0,
  obj_name LIKE tadir-obj_name,
  END OF it_table.

DATA: BEGIN OF wa_table,
  obj_name LIKE tadir-obj_name,
  END OF wa_table.

DATA: message_text TYPE string.

  IF devclass-high &amp;lt;&amp;gt; ''.
    CONCATENATE 'C:\BACKUP-' sy-datum+6(2) '.' sy-datum+4(2) '.'
    sy-datum+0(4) '-' sy-sysid '-' devclass-low
    '-' devclass-high '\'
    INTO path.
  ELSE.
    CONCATENATE 'C:\BACKUP-' sy-datum+6(2) '.' sy-datum+4(2) '.'
    sy-datum+0(4) '-' sy-sysid '-' devclass-low
    '\'
    INTO path.
  ENDIF.
  CONDENSE path NO-GAPS.

  SELECT obj_name INTO TABLE it_table FROM tadir
    WHERE obj_name LIKE obj_name AND
    object IN object AND
    author IN author AND
    devclass IN devclass.

  SORT it_table BY obj_name.
  LOOP AT it_table INTO wa_table.

    READ REPORT wa_table-obj_name INTO rep_table.
    IF wa_table-obj_name CS '\'.
    ELSE.
      CLEAR file.
      CONCATENATE path wa_table-obj_name '.TXT' INTO file.
      IF sy-subrc = 0.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'ASC'
          TABLES
            data_tab                = rep_table
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            OTHERS                  = 22.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          WRITE :/ 'File download error,Message code:',sy-subrc,
          ' creating file ',file.
        ENDIF.
      ELSE.
        WRITE: / 'Error Occured'.
      ENDIF.
    ENDIF.
  ENDLOOP.
  message_text = 'FILE(S) CREATED IN FOLDER'.
  CONCATENATE message_text path INTO message_text SEPARATED BY space.
  MESSAGE message_text TYPE 'I'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 04:20:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001245#M956029</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2008-06-20T04:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Program to download programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001246#M956030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;closed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Dec 2010 03:44:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-download-programs/m-p/4001246#M956030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-14T03:44:57Z</dc:date>
    </item>
  </channel>
</rss>

