Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP PROGRAM SOURCE CODE.

Former Member
0 Likes
3,509

i've to download se38 program source code into a flat file or text file.

in which table and in which field the source code gets saved and what is the function to download source code of abap program into text file.

regards,

deepti headu.

9 REPLIES 9
Read only

Former Member
0 Likes
2,044

Goto Se38

1.Give the report name and goto disply mode,

2. in application tool bar u can see one arrow like button (Downlode) Button. click that button. it will ask the file name and directory, give all things and save.

regards

Justin

Read only

0 Likes
2,044

i've to create a program to download abap source code into a text file.

which is the table n field name where abap program source code gets saved.

what is the sap function to download the abap program source code into a text file.

regards,

nilesh.

Read only

0 Likes
2,044

Please check on my post for the logic...!!

Read only

Former Member
0 Likes
2,044

If you wish to do it via a program...follow the below logic.

1. you can validate the existence of the report in table TRDIR.

2. If successful, read the report into internal table.

READ REPORT lrep INTO ITAB.

3. Download the internal table to text file, using GUI_DOWNLOAD.

Read only

Former Member
0 Likes
2,044

U can also do like this ..

Utlitlies->More Utilities-> Upload/Download and give the path

Read only

Former Member
0 Likes
2,044

Here we Go :

SE38-> Enter Programme Name->Utlitlies->More Utilities-> Download -> Enter File Name.txt .

Cheers.

Read only

Former Member
0 Likes
2,044

Hi nitesh,

*

you can do it as above mentioned.

I prefer to use cut and paste when i will

use only one report to put it on a local drive.

Regards, Dieter

Read only

former_member583456
Active Participant
0 Likes
2,044

Hi,

the source code can be found in the table REPOSRC; however, the code is compressed in that table. In order to read the source code as clear text use the ABAP command "READ REPORT" like this:

READ REPORT gv_RepName INTO gt_SrcCode.

where gv_RepName contains the report name (include name) and gt_SrcCode is an internal table of line type text.

To download the source code you can use the function module "GUI_DOWNLOAD".

Best regards

Thomas

Read only

Former Member
0 Likes
2,044

Hi nilesh,

1. in which table and in which field the source code gets

Table = REPOSRC

(But the source code is stored in RAW / Encoded format,

and we cannot read directly)

2. For reading we have to use READ REPORT syntax

3. Just copy paste

(it will read the report, and download)

(U can change the program name and filename)

4.

REPORT ABC.

DATA : BEGIN OF ITAB OCCURS 0,

F(72) TYPE C,

END OF ITAB.

READ REPORT 'ZAM_TEMP00' INTO ITAB.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'D:\PRG.TXT'

TABLES

DATA_TAB = ITAB

.

regards,

amit m.