Application Development 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: 

download ABAP sourcecodes

Former Member
0 Kudos

Hi all!

I want to save (and download) the ABAP sourcecodes of all self-developed (Z*) programs. Is there a possibility to do this easily and fast?

Thanks Stefan

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi Stefan,

Check this link for mass downloads of source code including function groups, text pools, and reports.

http://sap.ittoolbox.com/code/d.asp?d=1623&a=s

Hope this is useful.

13 REPLIES 13

Former Member
0 Kudos

You can create a new report that extract the source code of all self-developed (Z*) programs and store the information in a txt files.

Your new report can work with table TADIR/TRDIR and command "READ REPORT prog INTO itab".

Gianluca

0 Kudos

thanks for the hint!

I watched the 2 tables (TADIR/TRDIR), but I couldn't find the sourcecodes. In which tables are the sourcecodes stored?

Stefan

0 Kudos

Hello Stefan,

If you are interested in developing a program of your own, then you can follow these steps -

1. Query the database table D010SINF.

2. For each of the Z-program names that you get from the above table, use the READ REPORT statement. This statement will hide the complexity of retrieving the code for the program form whatever database table it may be stored in.

After the above step you have the code for the pogram in your internal table. Then you know what to do:-).

Also read the F1 Help for the READ REPORT statement.

Regards,

Anand Mandalika.

0 Kudos

You must execute the command "READ REPORT prog INTO itab" after the select to the table tadir and trdir.

select single * from trdir

where name = tadir-obj_name.

read report trdir-name into itab.

loop at itab.

...

...

Gianluca

FredericGirod
Active Contributor
0 Kudos

Hello Formular Man,

I'm using this program, it works perfectly.

http://www.members.tripod.com/abap4/Upload_and_Download_ABAP_Source_Code.html

Fred.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi Stefan,

Check this link for mass downloads of source code including function groups, text pools, and reports.

http://sap.ittoolbox.com/code/d.asp?d=1623&a=s

Hope this is useful.

Former Member
0 Kudos

Hi,

You can check the link below for the direct download of Function modules, Tables/structures, Classes, Programs, Message classes,

http://www.dalestech.com/

Rgds,

0 Kudos

If you need to do this for BSP apps too, you can check my article:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/finding your code in bsp applications.article

Former Member
0 Kudos

Use this code to download all custom create report programs to local hard disk.

REPORT ZDEVELOPMENTCLASS1.

DATA: CODE(800) OCCURS 10 ,

PATH TYPE STRING VALUE 'D:\CODE\FIRST.DOC',

PATH1 TYPE STRING,

ADDS TYPE STRING VALUE 0,

BEGIN OF ITAB OCCURS 0,

NAME LIKE TRDIR-NAME,

END OF ITAB.

SELECT NAME FROM TRDIR INTO TABLE ITAB WHERE NAME LIKE 'Z%'.

LOOP AT ITAB.

READ REPORT ITAB-NAME INTO CODE.

PERFORM FUN.

ENDLOOP.

FORM FUN.

PATH1 = PATH(13).

ADDS = ADDS + 1.

CONCATENATE PATH1 ADDS '.DOC' INTO PATH.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = PATH

tables

data_tab = CODE

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Saravanan.

Former Member
0 Kudos

You have to use ENDFORM after ENDIF statement.

Regards,

Saravanan.

0 Kudos

Guys,

I am not sure if I should do this ..

But just in case you would like to have a look at the utility that converts ABAP reports to html. With comments in blue and you can also navigate by clicking on form names & variables..

It's not perfect but I like it - May be because it's my child

http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html

Thanks,

Ram

0 Kudos

Hi Ram,

I have tested your baby ...

Well I am using 4.6c, so I have done some workarround.

Your Idea is great, but when i open the html-file

using the explorer, the result looks a little bit

confusing to me. (almost everything is colored red)

I suppose Your source code is corrupted.

I found many spaces ( for example <_> sys-subrc and so on)

Could You be so kind a sent me a correct coding?

As I told You, the idea is great!

BR

Michael

m.bauer@ids-scheer.at

0 Kudos

Hi Michale,

Thanks for your feedback on it.

I know a few statement like REPLACE ignoring case( the one that is used ) does not work on 4.6C. But I did download a few from 4.6C using ( similar logic )this and it was not that bad.

Ok, I got it ..you actually copied my code from HTML display. That will not work.

Please download the code from text file on the right side.( Above feedback form ).

Thanks,

Ram

Message was edited by: Ram Manohar Tiwari