0% found this document useful (0 votes)
582 views2 pages

Program To Download All Sap Programs Present in A Package

This program downloads all ABAP reports from a specified development class in the SAP system to a local folder on the desktop. It retrieves report programs from the specified package using TADIR, reads each report object into an internal table, and calls a function module to download the table contents as individual text files to the designated folder location. After downloading all programs, a confirmation message is displayed.

Uploaded by

alisnowkiss6570
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
582 views2 pages

Program To Download All Sap Programs Present in A Package

This program downloads all ABAP reports from a specified development class in the SAP system to a local folder on the desktop. It retrieves report programs from the specified package using TADIR, reads each report object into an internal table, and calls a function module to download the table contents as individual text files to the designated folder location. After downloading all programs, a confirmation message is displayed.

Uploaded by

alisnowkiss6570
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

*&--------------------------------------------------------------------*

*& Program To Download All The Programs Present In A Package (Dev. Class) To Des
ktop
*&--------------------------------------------------------------------*
REPORT z_downloadall_to_desktop.
***********************************************************************
*
Table declaration
*
***********************************************************************
TABLES: tadir.
***********************************************************************
*
Data declaration
*
***********************************************************************
TYPES: abapline(255) TYPE c.
TYPES: BEGIN OF ty_reposit,
pgmid
TYPE tadir-pgmid,
object TYPE tadir-object,
obj_name TYPE tadir-obj_name,
devclass TYPE tadir-devclass,
END OF ty_reposit.
DATA: it_reposit TYPE STANDARD TABLE OF ty_reposit,
wa_reposit TYPE ty_reposit.
DATA: it_repsrc TYPE STANDARD TABLE OF abapline,
wa_repsrc TYPE abapline.
DATA: prog(60)
TYPE c,
mc_filename TYPE rlgrap-filename,
filename
TYPE string.
***********************************************************************
*
Selection Screen
*
***********************************************************************
PARAMETERS: p_dev TYPE tadir-devclass.
"Package Name
*****Program Logic
SELECT pgmid
object
obj_name
devclass
FROM tadir
INTO TABLE it_reposit
WHERE pgmid
= 'R3TR' AND
object = 'PROG' AND
devclass = p_dev.
IF sy-subrc NE 0.
MESSAGE s001(00) WITH 'No programs available in the given package'.
EXIT.
ENDIF.
LOOP AT it_reposit INTO wa_reposit.
prog = wa_reposit-obj_name.
READ REPORT prog INTO it_repsrc.
CONCATENATE 'C:\Documents and Settings\Administrator\Desktop\My ABAP Programs\
Report'
prog
'.txt'
INTO mc_filename.
filename = mc_filename.
*****Function module for download files into local system
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename
= filename
TABLES
data_tab
= it_repsrc
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 <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR prog.
CLEAR wa_repsrc.
ENDLOOP.
*****After download all the programs to intimate user.
MESSAGE s001(00) WITH 'Check your folder for the Programs downloaded'.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy