‎2008 Feb 18 1:36 PM
How can we download our programs from ABAP R/3 ? is there any way we can download all of our programs from a package all at a time?
‎2008 Feb 18 1:40 PM
Hi
there is a option called save to local disk in tool bar...by selecting that u can save u r programs .
‎2008 Feb 18 1:42 PM
hi,
First check in tadir that the given package is valid
SELECT SINGLE devclass FROM tadir INTO ws_devclass WHERE devclass = p_devcls.
Select all the records from TADIR table where OBJECT = 'FUGR' and PGMID = 'R3TR '.
In this way u can get all the FUnction group for that package.
For getting the function module under the function module use the FM RS_FUNCTION_POOL_CONTENTS to get all the function module under the Function group.
Usign the table tfdir get the program name of the Function module.
Using the FM 'GET_INCLUDETAB' get all the includes
for that PRogram name.
Loop at the internal table which you got from the function module.
Use the READ REPORT prog INTO itab.
Download the contents to the place where you want.
regards,
theja
‎2008 Feb 18 1:44 PM
Hello,
This is what you wanted.
REPORT ZV_DOWNLOAD_PROGRAM .
*&---------------------------------------------------------------------*
*& Report ZDOWNLOADSY *
*
*&---------------------------------------------------------------------*
*& Author : Gowrishankar
*
*& Descripton : The main aim of this program is used to download *
*& all the programs come under one particular package. *
*&---------------------------------------------------------------------*
*REPORT ZDOWNLOADSY.
*table decleration
TABLES : TADIR.
*data decleration
TYPES: ABAPLINE(255).
DATA: I_REPSRC TYPE STANDARD TABLE OF ABAPLINE WITH HEADER LINE.
DATA: BEGIN OF ITAB OCCURS 0,
PGMID TYPE TADIR-PGMID,
OBJECT TYPE TADIR-OBJECT,
OBJ_NAME TYPE TADIR-OBJ_NAME,
DEVCLASS TYPE TADIR-DEVCLASS,
END OF ITAB.
DATA: PROG(60) .
DATA : MC_FILENAME LIKE RLGRAP-FILENAME.
DATA : FILENAME TYPE STRING.
PARAMETERS: P_DEV TYPE TADIR-DEVCLASS.
*select statement.
SELECT PGMID OBJECT OBJ_NAME DEVCLASS FROM TADIR INTO TABLE ITAB
WHERE PGMID = 'R3TR' AND
OBJECT = 'PROG' AND
DEVCLASS = P_DEV.
LOOP AT ITAB.
PROG = ITAB-OBJ_NAME.
READ REPORT PROG INTO I_REPSRC.
CONCATENATE 'C:\temp\'
PROG
'.txt'
INTO MC_FILENAME.
FILENAME = MC_FILENAME.
*function module for download files into local system
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = FILENAME
* FILETYPE = 'ASC'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = I_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 I_REPSRC.
ENDLOOP.
MESSAGE S001(00) WITH 'Check your folder for the Programs downloaded'.
Cheers,
Vasanth
‎2008 Feb 18 1:48 PM
hi
good
i dont think there is any procedure to download all the report form sap r/3 to any excel sheet, you have to search the report as per your requment wise and you can save them one by one.
thanks
mrutyun^
‎2008 Feb 18 2:25 PM
C'mon Guys it's 2008 so don't write 1970's type code even if it does work.
Think OO and the solution is quite easy.
OO is simple and can be used for loads of stuff -- forget the "Old fashioned" non OO ABAP way.
For those not too familiar with OO Grids I've put some break points here -- but the functionality allows you to double click, select all rows, de-select all rows, enter data etc etc.
Use it as a model to add your own stuff.
Get program names into a Grid, select what you want and download.
You can also download the program list to a spreadsheet as well - just click on the EXPORT standard Grid button when the initial grid is displayed.
This program also has a nice feature --if you double click on the program name it will enter SE38. On Exit it returns to the list.
The standard SE38 functionality just loses the list if you display a list and chose a program.
First however you have to create a screen ( SE51) with just a single element on it custom control called CCONTAINER1 and a standard GUI status (SE41) 001 with 3 standard buttons on it CANCEL, BACK, EXIT.
Create also text for selectopn element s_prog Program name(s).
Copy code and run it.
When you get the Grid just click on the EXPORT button and it will download the list to an excel spreadsheet / text file or whatever.
You can also add some code into the form select_all _rows and add your download code there to automate the whole process. Click on the button SELECT ENTIRE GRID
(It's quite easy really).
PROGRAM zzjimbozzzz1.
INCLUDE <icon>.
DATA grid1 TYPE REF TO cl_gui_alv_grid.
DATA: es_row_no TYPE lvc_s_roid,
ls_row_id TYPE lvc_s_row,
ls_col_id TYPE lvc_s_col,
ls_row TYPE i,
ls_value TYPE c,
ls_col TYPE i,
ls_row_no TYPE lvc_s_roid.
types: row_table type table of lvc_s_roid.
data t_rows type row_table.
data: begin of wa_rows,
ROW_ID type int4,
SUB_ROW_ID type int4,
end of wa_rows.
data: t_index type int4.
data: t_size type int4.
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no,
**Double Click Handler
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no,
** Toolbar handler.
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
* button press
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm,
* data changed
handle_data_changed
for event data_changed of cl_gui_alv_grid
importing er_data_changed,
*data changed finished
handle_data_changed_finished
for event data_changed of cl_gui_alv_grid.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION.
*Handle Hotspot Click
METHOD handle_hotspot_click .
PERFORM mouse_click
USING e_row_id
e_column_id.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ls_row
e_value = ls_value
e_col = ls_col
es_row_id = ls_row_id
es_col_id = ls_col_id
es_row_no = es_row_no.
CALL METHOD grid1->refresh_table_display.
CALL METHOD grid1->set_current_cell_via_id
EXPORTING
is_column_id = e_column_id
is_row_no = es_row_no.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD handle_double_click.
PERFORM double_click
USING e_row
e_column.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ls_row
e_value = ls_value
e_col = ls_col
es_row_id = ls_row_id
es_col_id = ls_col_id
es_row_no = es_row_no.
CALL METHOD grid1->refresh_table_display.
CALL METHOD grid1->set_current_cell_via_id
EXPORTING
is_column_id = ls_col_id
is_row_no = es_row_no.
ENDMETHOD.
METHOD handle_toolbar.
DATA: ls_toolbar TYPE stb_button.
* append a separator to normal toolbar
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
* append an icon for your function
CLEAR ls_toolbar.
MOVE 'FUNC' TO ls_toolbar-function.
MOVE icon_railway TO ls_toolbar-icon.
MOVE 'Your Function' TO ls_toolbar-quickinfo.
MOVE 'Your user function' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
* Select All Rows
Move 'SELE' to ls_toolbar-function.
move icon_select_all to ls_toolbar-icon.
move 'Select all' to ls_toolbar-quickinfo.
MOVE 'Select entire Grid' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
* Deselect all Rows.
Move 'DSEL' to ls_toolbar-function.
move icon_deselect_all to ls_toolbar-icon.
move 'Deselect all' to ls_toolbar-quickinfo.
MOVE 'Deselect entire Grid' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
BREAK-POINT 1.
CASE e_ucomm.
WHEN 'FUNC'. "Your button
* Perform what you need to do.
When 'SELE'.
perform select_all_rows.
When 'DSEL'.
perform deselect_all_rows.
WHEN OTHERS.
ENDCASE.
ENDMETHOD.
method handle_data_changed.
perform data_changed using er_data_changed.
endmethod. "data_changed
method handle_data_changed_finished.
perform data_changed_finished.
endmethod. "data_changed_finished
ENDCLASS.
tables: trdirt.
* Define any structure
types: begin of s_elements,
name type trdirt-name,
text type trdirt-text,
END OF s_elements.
* end of your structure
data: progname type trdirt-name.
data: wa_elements type s_elements.
selection-screen begin of block one with frame title text-t01.
select-options: s_prog for trdirt-name obligatory.
selection-screen end of block one.
DATA lr_rtti_struc TYPE REF TO cl_abap_structdescr .
DATA:
zog LIKE LINE OF lr_rtti_struc->components .
DATA:
zogt LIKE TABLE OF zog,
wa_it_fldcat TYPE lvc_s_fcat,
it_fldcat TYPE lvc_t_fcat ,
dy_line TYPE REF TO data,
dy_table TYPE REF TO data.
DATA: dref TYPE REF TO data.
FIELD-SYMBOLS: <fs> TYPE ANY,
<dyn_table> TYPE STANDARD TABLE,
<dyn_wa>.
DATA grid_container1 TYPE REF TO cl_gui_custom_container .
DATA grid_container2 type ref to cl_gui_custom_container.
DATA: g_handler TYPE REF TO lcl_event_handler. "handler
DATA: ok_code TYPE sy-ucomm.
DATA: struct_grid_lset TYPE lvc_s_layo.
START-OF-SELECTION.
*now I want to build a field catalog
* First get your data structure into a field symbol
CREATE DATA dref TYPE s_elements.
ASSIGN dref->* TO <fs>.
lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( <fs> ).
* Now get the structure details into a table.
* table zogt[] contains the structure details
* From which we can build the field catalog
zogt[] = lr_rtti_struc->components.
LOOP AT zogt INTO zog.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = zog-name .
wa_it_fldcat-datatype = zog-type_kind.
wa_it_fldcat-inttype = zog-type_kind.
wa_it_fldcat-intlen = zog-length.
wa_it_fldcat-decimals = zog-decimals.
wa_it_fldcat-coltext = zog-name.
wa_it_fldcat-lowercase = 'X'.
IF wa_it_fldcat-fieldname = 'VBELN'.
wa_it_fldcat-hotspot = 'X'.
ENDIF.
APPEND wa_it_fldcat TO it_fldcat.
ENDLOOP.
*
* You can perform any modifications / additions to your field catalog
* here such as your own column names etc.
* Now using the field catalog created above we can
* build a dynamic table
* and populate it
* First build the dynamic table
* the table will contain entries for
* our structure defined at the start of the program
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fldcat
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
* Now fill our table with data
select *
from trdirt
into corresponding fields of table <dyn_table>
where name in s_prog
and sprsl eq sy-langu.
* Call the screen to display the grid
CALL SCREEN 100.
form select_all_rows.
describe table <dyn_table> lines t_size.
t_index = 1.
while t_index le t_size.
clear wa_rows.
wa_rows-row_id = t_index.
append wa_rows to t_rows.
t_index = t_index + 1.
endwhile.
call method grid1->set_selected_rows
exporting
it_row_no = t_rows.
endform.
form deselect_all_rows.
describe table <dyn_table> lines t_size.
t_index = 1.
refresh t_rows.
clear wa_rows.
wa_rows-row_id = t_index.
append wa_rows to t_rows.
call method grid1->set_selected_rows
exporting
it_row_no = t_rows.
endform.
FORM double_click
USING e_row TYPE lvc_s_row
e_column TYPE lvc_s_col.
READ TABLE <dyn_table> INDEX e_row INTO wa_elements.
progname = wa_elements-name.
set parameter id 'RID' field progname.
call transaction 'SE38'.
ENDFORM.
FORM mouse_click
USING e_row TYPE lvc_s_row
e_column_id TYPE lvc_s_col.
READ TABLE <dyn_table> INDEX e_row INTO wa_elements.
ENDFORM.
form data_changed
using er_data_changed.
break-point 1.
endform.
form data_changed_finished.
break-point 1.
endform.
form instantiate_grid
using grid_container type REF TO cl_gui_custom_container
class_object type ref to cl_gui_alv_grid
container_name type SCRFNAME.
CREATE OBJECT grid_container
EXPORTING
container_name = container_name.
CREATE OBJECT class_object
EXPORTING
i_parent = grid_container.
struct_grid_lset-sel_mode = 'D'.
CREATE OBJECT g_handler.
SET HANDLER g_handler->handle_double_click FOR class_object.
SET HANDLER g_handler->handle_hotspot_click FOR class_object.
SET HANDLER g_handler->handle_toolbar FOR class_object.
SET HANDLER g_handler->handle_user_command FOR class_object.
SET HANDLER g_handler->handle_data_changed FOR class_object.
SET HANDLER g_handler->handle_data_changed_finished FOR class_object.
CALL METHOD class_object->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD class_object->set_table_for_first_display
EXPORTING is_layout = struct_grid_lset
CHANGING
it_outtab = <dyn_table>
it_fieldcatalog = it_fldcat.
endform.
* PBO module
MODULE status_0100 OUTPUT.
IF grid_container1 IS INITIAL.
perform instantiate_grid
using grid_container1
grid1
'CCONTAINER1'.
endif.
SET PF-STATUS '001'.
SET TITLEBAR '000'.
ENDMODULE.
* PAI module
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'RETURN'.
LEAVE PROGRAM.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
cheers
jimbo
‎2008 Feb 18 1:53 PM
Hi ,
Use Standard Report "REPTRAN".
It will be very useful.
Hope this helps.
<REMOVED BY MODERATOR>
Regards,
SureshP.
Edited by: Alvaro Tejada Galindo on Feb 18, 2008 12:24 PM
‎2008 Feb 18 2:02 PM
&----
*& Report Z10_SE38_DOWNLOAD *
*& Program Name :Z10_SE38_DOWNLOAD
*& Purpose :To create a parameter as PROGRAM
NAME where Z10* needs
to be entered and all the programs beginning * with this name needs to be displayed on
pressing button EXECUTE.Checkbox needs * to be provided for the same.The checked
box then needs to be downloaded to the flat * file
&----
report z10_se38_download
no standard page heading
line-count 40
message-id z11.
MESSAGE-ID z10akd.
*&----
T Y P E - D E C L A R A T I O N
*&----
&
types: begin of t_program,
progname type progname, "ABAP program name
subc type subc, "Program type
cnam type cnam, "Author
cdat type rdir_cdate, "Created on
name type programm, "ABAP Program Name
text type repti, "Report title
end of t_program.
types: begin of t_download,
lines(1500), "No.of line of source code
end of t_download.
*&----
&
D A T A - D E C L A R A T I O N *
*&----
&
*&--Work Area Declartion
data:wa_program type t_program,
wa_download type t_download.
*&--Internal table declarations
data: it_program type standard table of t_program,
it_download type standard table of t_download.
*&--Other data declarations
data: n type i, "counter for checkbox
d_checkbox type c, "checkbox
path type string, "to provide location in drive
counter type i value 0.
*DATA : color_no TYPE i VALUE 1.
*&----
&
S E L E C T I O N- S C R E E N
*&----
&
selection-screen begin of block b1 with frame title text-010.
parameters: p_prog(40) type c obligatory.
selection-screen end of block b1.
*&----
&
I N I T I A L I Z A T I O N
*&----
&
initialization.
clear :wa_program,
wa_download.
refresh :it_program,
it_download.
*&----
&
*& S T A R T- O F- S E L E C T I O N *
*&----
&
start-of-selection.
*&--Creating menu for execute and download
set pf-status 'MENU1'.
*&--for program name
concatenate p_prog '%' into p_prog.
*&--select data from table reposrc.
select progname
subc
cnam
cdat into corresponding fields of table it_program
from reposrc
where progname like p_prog.
if sy-subrc <> 0.
message i037.
endif.
*&----
&
E N D- O F- S E L E C T I O N
*&----
&
end-of-selection.
sort it_program by progname.
write:/3 'SELECT' color 7 inverse on,
20 'PROGRAM NAME' color 7 inverse on,
65 'DISCRIPTION' color 7 inverse on.
uline.
loop at it_program into wa_program.
select single name
text into (wa_program-name,
wa_program-text)
from trdirt
where name = wa_program-progname.
write:/5 d_checkbox as checkbox,
12 wa_program-progname,
65 wa_program-text.
hide: wa_program-progname.
endloop.
*&----
&
A T U S E R - C O M M A N D
*&----
&
at user-command.
case sy-ucomm.
when 'DOWNLOAD'.
n = 1.
do.
read line n field value d_checkbox wa_program-progname.
if sy-subrc <> 0.
exit.
endif.
if d_checkbox = 'X'.
**&--Function to read program
call function 'RPY_PROGRAM_READ'
exporting
language = sy-langu
program_name = wa_program-progname
tables
source_extended = it_download
exceptions
cancelled = 1
not_found = 2
permission_error = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
concatenate 'd:\AMRUTA\DOWNLOADED PROGRAMS\' wa_program-progname '.TXT' into path.
*&--fUNCTION TO DOWNLOAD INTO FLAT FILE.
call function 'GUI_DOWNLOAD'
exporting
filename = path
filetype = 'ASC'
tables
data_tab = it_download
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.
counter = counter + 1 .
endif.
endif.
n = n + 1.
enddo.
endcase.
counter = counter / 2.
if counter > 0.
message i038 with counter.
endif.
*&----
&
T O P- O F- P A G E
*&----
&
top-of-page.
format inverse on.
write:/ 'Author : ' color 7,wa_program-cnam color 7.
write:/ 'Date : ' color 7,sy-datum color 7.
skip 2.
uline.
‎2008 Feb 18 2:03 PM
Hope this program will help you download the program code.
&----
*& Report Z10_SE38_DOWNLOAD *
*& Program Name :Z10_SE38_DOWNLOAD
*& Purpose :To create a parameter as PROGRAM
NAME where Z10* needs
to be entered and all the programs beginning * with this name needs to be displayed on
pressing button EXECUTE.Checkbox needs * to be provided for the same.The checked
box then needs to be downloaded to the flat * file
&----
report z10_se38_download
no standard page heading
line-count 40
message-id z11.
MESSAGE-ID z10akd.
*&----
T Y P E - D E C L A R A T I O N
*&----
&
types: begin of t_program,
progname type progname, "ABAP program name
subc type subc, "Program type
cnam type cnam, "Author
cdat type rdir_cdate, "Created on
name type programm, "ABAP Program Name
text type repti, "Report title
end of t_program.
types: begin of t_download,
lines(1500), "No.of line of source code
end of t_download.
*&----
&
D A T A - D E C L A R A T I O N *
*&----
&
*&--Work Area Declartion
data:wa_program type t_program,
wa_download type t_download.
*&--Internal table declarations
data: it_program type standard table of t_program,
it_download type standard table of t_download.
*&--Other data declarations
data: n type i, "counter for checkbox
d_checkbox type c, "checkbox
path type string, "to provide location in drive
counter type i value 0.
*DATA : color_no TYPE i VALUE 1.
*&----
&
S E L E C T I O N- S C R E E N
*&----
&
selection-screen begin of block b1 with frame title text-010.
parameters: p_prog(40) type c obligatory.
selection-screen end of block b1.
*&----
&
I N I T I A L I Z A T I O N
*&----
&
initialization.
clear :wa_program,
wa_download.
refresh :it_program,
it_download.
*&----
&
*& S T A R T- O F- S E L E C T I O N *
*&----
&
start-of-selection.
*&--Creating menu for execute and download
set pf-status 'MENU1'.
*&--for program name
concatenate p_prog '%' into p_prog.
*&--select data from table reposrc.
select progname
subc
cnam
cdat into corresponding fields of table it_program
from reposrc
where progname like p_prog.
if sy-subrc <> 0.
message i037.
endif.
*&----
&
E N D- O F- S E L E C T I O N
*&----
&
end-of-selection.
sort it_program by progname.
write:/3 'SELECT' color 7 inverse on,
20 'PROGRAM NAME' color 7 inverse on,
65 'DISCRIPTION' color 7 inverse on.
uline.
loop at it_program into wa_program.
select single name
text into (wa_program-name,
wa_program-text)
from trdirt
where name = wa_program-progname.
write:/5 d_checkbox as checkbox,
12 wa_program-progname,
65 wa_program-text.
hide: wa_program-progname.
endloop.
*&----
&
A T U S E R - C O M M A N D
*&----
&
at user-command.
case sy-ucomm.
when 'DOWNLOAD'.
n = 1.
do.
read line n field value d_checkbox wa_program-progname.
if sy-subrc <> 0.
exit.
endif.
if d_checkbox = 'X'.
**&--Function to read program
call function 'RPY_PROGRAM_READ'
exporting
language = sy-langu
program_name = wa_program-progname
tables
source_extended = it_download
exceptions
cancelled = 1
not_found = 2
permission_error = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
concatenate 'd:\AMRUTA\DOWNLOADED PROGRAMS\' wa_program-progname '.TXT' into path.
*&--fUNCTION TO DOWNLOAD INTO FLAT FILE.
call function 'GUI_DOWNLOAD'
exporting
filename = path
filetype = 'ASC'
tables
data_tab = it_download
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.
counter = counter + 1 .
endif.
endif.
n = n + 1.
enddo.
endcase.
counter = counter / 2.
if counter > 0.
message i038 with counter.
endif.
*&----
&
T O P- O F- P A G E
*&----
&
top-of-page.
format inverse on.
write:/ 'Author : ' color 7,wa_program-cnam color 7.
write:/ 'Date : ' color 7,sy-datum color 7.
skip 2.
uline.
‎2008 Feb 18 2:47 PM
Hi,
You can download the ABAP programs using download / upload option. Go to SE38 there is an option in the Menu Utilities -> More Utilities -> Upload / Download option you can try this.
Thanks
‎2014 Apr 08 3:32 PM