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: 

Execute code from a text file ...

Former Member
0 Kudos

Hello , Would like to know whether it is possible to have my ABAP code in a text file in desktop and then execute the code by reading it into an ITAB in another ABAP program .

Note : Pl. dont suggest how to upload and create a new program . I dont want to create a new program after uploading into ITAB using INSERT or function modules . I want to execute the code as part of the uploading program only . So that once the execution is complete the uploaded code will not be available in the SAP system.

Thanks in advance ,

Jee.R

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Yes you can, you can either generate a subroutine dynamically or use the ABAP statement INSERT REPORT. Once you have executed the report you then use DELETE REPORT to remove it.

See the function module RFC_ABAP_INSTALL_AND_RUN for an example.

Darren

4 REPLIES 4

Former Member
0 Kudos

Hi,

Yes you can, you can either generate a subroutine dynamically or use the ABAP statement INSERT REPORT. Once you have executed the report you then use DELETE REPORT to remove it.

See the function module RFC_ABAP_INSTALL_AND_RUN for an example.

Darren

matt
Active Contributor
0 Kudos

>

> Note : Pl. dont suggest how to upload and create a new program . I dont want to create a new program after uploading into ITAB using INSERT or function modules . I want to execute the code as part of the uploading program only . So that once the execution is complete the uploaded code will not be available in the SAP system.

Oh dear. The only solution to your requirement is, sadly, to upload and create a new program, and then one further step. There is no other way. So it looks like you'll have to do without.

matt

Former Member
0 Kudos

From both an operations and a security standpoint I would say this is a really bad idea. It would allow someone to run untested, unapproved code. I can just imagine what an auditor would think, or a security consultant.

Former Member
0 Kudos

Darren - Thankx . Dynamic subroutine did work for me . Your points are awarded.

Michael - Thankx for remainding me the Quality and audit . The background scenario is different and its not part of any delivery .