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

Export Source Code

Former Member
0 Likes
5,829

Hi,

I'm new in ABAP development. What is the fastest way to save the ABAP program source code?? Most of my program has dependency with other. I don't want to export it one by one in ABAP editor. Any suggestion??

Regards,

Kit

3 REPLIES 3
Read only

Former Member
0 Likes
2,609

Try running this utility :

report zaRs

no standard page heading

line-size 95 .

perform f_get_pgm.

if not i_include[] is initial.

clear v_index.

loop at i_include into wa_include

clear : i_pgm.

refresh : i_pgm.

read report wa_include-txt into i_pgm.

if sy-subrc eq 0.

v_date = sy-datum.

v_time = sy-uzeit.

concatenate 'C:\Backup_' v_date '_' v_time into v_file.

call function 'WS_DOWNLOAD'

exporting

filename = v_file

filetype = 'ASC'

mode = 'A'

tables

data_tab = i_pgm.

endif.

endloop.

endif.

form f_get_pgm.

call function 'RFC_READ_REPORT'

exporting

program = p_rname

tables

qtab = i_pgm.

describe table i_pgm lines v_lines1.

wa_include-txt = p_rname.

append wa_include to i_include.

if not i_pgm[] is initial.

clear v_index.

loop at i_pgm into wa_pgm.

v_index = sy-tabix.

translate wa_pgm to upper case.

split wa_pgm-txt at '"' into wa_pgm-txt v_comment.

if wa_pgm-txt(1) ne '*' and

wa_pgm-txt cs 'INCLUDE'.

replace '.' with space into wa_pgm-txt.

condense wa_pgm-txt .

split wa_pgm-txt at space into v_comment v_comment1.

move v_comment1 to wa_include.

append wa_include to i_include.

endif.

endloop.

else.

message i001 with text-001.

endif.

clear v_index.

if not i_include[] is initial.

loop at i_include into wa_include.

v_index = sy-tabix.

select obj_name from tadir

into tadir-obj_name

up to 1 rows

where obj_name eq wa_include-txt

and pgmid eq 'R3TR'

and object eq 'PROG'.

endselect.

if sy-subrc ne 0.

delete i_include index v_index.

endif.

endloop.

endif.

endform. " f_get_pgm

Regards

Tushar

Read only

Former Member
0 Likes
2,609

I guess ABAP standard report RSINCL00 fits your needs. Just enter the name of your main program and mark all check boxes including the check box entitles with "Output Source" and execute it. As a result you will see the complete source code of nearly every part of ABAP source included and used in the main program.

Reward points, if helpful

Read only

Former Member
0 Likes
2,609

saving it in a package will ensure that you have a backup if something happens to the program

however if something happens to the server, then both the copies will be lost

a more complete approach would be to save it in a request, release the request and take the generated files with you (keep it on your personal PC for example)

1. go to tcode se80 and create a package

2. when it prompts to save create a new request and save this number

3. enter description and click on save and then ok

4. now go to se38 and create your program (or use the one you wish to backup) and assign the package created above and put the same request number

5. if the program already exists and is assigned to a local object/different package, then follow the path “goto-> object directory entry” and put the above created package and request number

6. go to tcode se09 and make sure that “modifiable and released” are checked and click on display

7. Do the syntax check and consistency checks on the requests and release

8. go to tcode cg3y and download the data and CO files to your local pc from the following paths.

--> Data: E:\usr\sap\trans\data\R903789.IEC

--> CO: E:\usr\sap\trans\cofiles\K903789.IEC

Ensure that your request is not a local request

ie: when the request is filled, the 'Target' field should be filled

If the search help does not return any results, you will need to contact your Basis team to allow you to create such a request

Also, the name I gave in the previous post was just an example

the format is...

Data file -> R<request number>.<system id>

Co file -> K<request number>.<system id>

This is for importing

9. Go to the Sever in which the request is to be imported

10. Go to transaction CG3Z and upload the data and co files to the respective folders on that server

11. Go to transaction STMS

12. Go to Overview -> Imports

13. Double click on the system (eg: CE6) <-- your sysid

14. Go to Extras -> Other Requests -> Add

15. Choose the request number (which will be the same as the one you created in the old server) and click on Ok

16. If a similar message is displayed as follows, click on ‘Yes’

‘Transport request IECK903 attach to import queue CE6’

17. Your request number will get added to the list

18. Select it and go to Request -> Import

19. Choose your client (same as client on the current server) (you can fiddle with other options in the Options tab

20. Click on Ok and if a similar message is shown as follows, click on Yes

The import is being executed with the following options

Asynchronous:

Leave transport request in queue

Import transport request IECK903789 into system CE6

client 100?

21. A ‘Truck’ symbol will be shown in the Status column

22. Click on Refresh till the truck changes to a yellow triangle

23. Right click on the request and click on logs to view any errors or messages

24. If no errors then transport is successful

Regards,

Chandru