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

Automatically add code to a Z_ABAP Source

Former Member
0 Likes
944

Hi Gurus

I'd like to know, if there is any possibility to add some ABAP statements to the source code of some customer programs?

I want to add in every Z-Program after the START-OF-SELECTION part a Function, that read some Information about the Using of the program into an Z-Table automatically.

Is there a concept for this issue? Somthing like snote, it also maintain the source code automatically, but I think this transaction just overwrite the old source with the new one.

Or can I get the source code of the ABAP programs out of an table and insert there the new statements?

Thank you very much for your help.

Kind Regards

Boris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
843

Hello,

SNOTE doesn't overwrite the old code with the new one.

When you create a note, the difference between the new and the one is calculated and that is what is in the note: ie when you implement a note, SNOTE only tries to apply the difference to the code in the customer system.

Regards,

Walter

4 REPLIES 4
Read only

Former Member
0 Likes
844

Hello,

SNOTE doesn't overwrite the old code with the new one.

When you create a note, the difference between the new and the one is calculated and that is what is in the note: ie when you implement a note, SNOTE only tries to apply the difference to the code in the customer system.

Regards,

Walter

Read only

Former Member
0 Likes
843

Take a look at the ABAP statements READ REPORT and INSERT REPORT - they let you read and change source code from a program. There is also SYTAX CHECK.

You could read program names from table TRDIR, and process them. You would need to activate any you change.

However - read the help / documentation - there are a number of side effects such as changes not being included in transport request. Probably not a good way to change programs for a production system.

Andrew

Read only

0 Likes
843

Thank you Andrew.

That could be a possible solution for my issue.

I have an additional question:

Do you know, if the sap-programs can also be processed without any proofs?

Normally you need an Sap key to open this objects for changes. Is Read Report and Insert Report checked on sap programs? Or isn't this included in the security concept of Sap.

Greetings

Boris

Read only

0 Likes
843

I have never tried it - but I assume SAP would not leave a "Hole" like this in security.

Perhaps a key would be needed when you try and activate the code, or when you try and add it to a transport request?

Andrew