Skip to Content
avatar image
Former Member

Automatically add code to a Z_ABAP Source

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 17, 2007 at 12:43 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 02:11 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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