‎2007 Feb 02 8:29 AM
Hello!
I would like to know if its possible to export ABAP code as Java code using some tool.
I am trying to first export ABAP code to a temporary file (like a text file perhaps) and then run it through a tool which generates the same logic in Java.
We have particular custom ABAP programs on the SAP system which acts on the data from the SAP database. We are trying to implement the same logic in the Java side now. It would be however easier to simply export the code of these ABAP programs and convert it to Java.
Is it possible and does a tool already exist for such an operation?
Thanks,
Sameer
‎2007 Feb 02 8:33 AM
Hi Sameer,
I doubt if such a tool is really available. Java and ABAP are so very different as programming languages, that it is almost impossible to convert the logic in one language to the another.
Agreed it may be possible beween two OOPS oriented languages, but not between an event oriented Businesss language like ABAP and a completely object oriented JAVA.
Regards,
Ravi
‎2007 Feb 02 9:05 AM
Hallo Ravi,
Thanks for your opinion...I dont think its impossible to implement the same logic in two different languages even if they are a third generation and a fourth generation language
In fact I found a thread where web dynpro ABAP could be converted to HTML content (not completely but was good enough) so I think ABAP to Java might be very much possible.
In any case, do you (or anyone else) know how I can export ABAP code out of the SAP System? Even in a plain text file will do.
Sameer
‎2007 Feb 02 9:08 AM
Yes, that is possible though.
In se38 (ABAP EDITOR) there is an option to download the code.(Look on the toolbar just above the code section).
Regards,
Ravi
‎2007 Feb 02 9:16 AM
Hi Ravi,
That helped. Next step - do you have any idea how the program code can be exported programmatically?
I am trying to find out how I can write Java code to import the ABAP code from our programs (there are a number of them). If anyone knows how I can export the code from multiple programs using an ABAP program, that would also be helpful.
Thanks!
Sameer
‎2007 Feb 02 9:19 AM
HI Sameer,
Do this:
data: itab type TYPE standard table of ABAPTEXT occurs 0 with header line.
read report <report name> into itab.
call function 'GUI_DOWNLOAD'
exporting
filename = 'c:\temp\source.txt'
tables
data_tab = itab
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
others = 19 .
Regards,
Ravi
YOu can extend this logic by having a selection screen to select multiple programs and then downloading each of the programs.
‎2007 Feb 02 9:49 AM
Hi Ravi,
Thanks again, it worked with a little changes.
Now back to the original point of the question...does anyone know of any tool to convert ABAP code into Java?
Sameer
‎2007 Feb 02 10:54 AM
Hello!
Any ideas about converting ABAP code into Java? I tried searching for tools or any other methods on various search engines but no luck yet..
Sameer