Copying ABAP Programs Guidelines

By | September 3, 2013 | Guidelines | 4,618 | 6

Few guidelines you want to follow whenever you need to copy a standard program to meet the needs.

Initial Checks

Many times, we get a request from Clients to “enhance” the standard program. From business point of view this Enhance would be to add more functionality in the standard report. To translate that requirement in Technical terms, you may not find suitable enhancements and want to go for the Copy of the standard program – Copy the code into the Custom program and Add the additional logic to meet the new requirements

Before deciding to copy the standard program to a Custom version, you want to follow these checklist:

  • Enhancements – Check if SAP has provided std User Exit, Customer Exit, BADI or Explicit Enhancements in the Standard program. If you find the hit, make sure you do all the research on making use of them.
  • Implicit Enhancements – If you don’t find the explicit points or enhancements, see if you can implement the implicit enhancements. Majority of time, this should be able to meet the requirement.
  • Use of Std FM in a Custom program – Check if the std program is designed in such a way that you would be able to call the unit – FM or Method – in your custom program. Add your custom logic after you get the necessary data from the FM. Many programs are not designed this way in Std SAP. To be able to have a flexibility the program needs to be designed using Model View Controller (MVC).

Maintenance of Copied Program

After you exhausted all the option above and now you want to create the Copy of the standard program. When you do so, you want to also know the future risks for doing so. The biggest drawback would be maintenance of the Copied version of the program.

You need to follow few guidelines in order to make future maintenance as smooth as possible:

  • Changes added to the Copied version has to be highlighted properly
  • Changes also needs to be documented in the Technical Specification document
  • During Upgrade, if SAP delivers a newer version, you would need to analyze the standard program in order to determine if you would need to update your copied code as well. Figure out if the changes are technical – for example, replacing obsolete FM with newer method calls or is it a functionality change – e.g. a new column addition. If a new functionality is introduced, you would want to get together with business to decide if you would need to include those in your copied version or not

If you are keep on updating the System with a Support Pack or an Upgrade frequently, you would need to follow the last point all the time. Thus, increased maintenance!

Guideline to Ease the Maintenance

By the time, you would now be thinking what I can do to make things easier. The answer is – Generate the Version of the original Program. You must always release the task where you have copied program. This will provide you few benefits:

  • You can utilize the version management tool to compare the changes you have implemented. It would clearly show you the Delta of changes.
  • You would be able to know if the new changes coming in standard program is affecting your copied version of the program or not

Along with generating the version, You should also:

  • Highlight that you have introduced a new logic by using the markers like BEGIN / END OF CHANGE. It would be helpful while debugging to know if the issue is coming from your code vs Std SAP code
  • Wrap your code in a FM or Method and implement it outside of the copied version. This would enable you to copy the newer version of the program again and to plug your custom code rather than have to rewrite it again.

Do you follow any other guidelines when it comes to copying the program?

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{273 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 273 articles.

Load comments


  • Steve Oldner

    Only extra item we do here is re-evaluate the need for it after each LCP/Enhancement Pack.

    Good post for a discussion!

  • Leandro

    You didn’t mention modify the original program.
    I think many times this is better than copying, because you can use transaction SPAU.
    What are your thoughts about this? Thank you.

  • Hello Steve,

    I agree with you – re-evaluation is necessary to check if SAP has delivered the same functionality in a new SP or not. But when the initial enhancement to the std program was for the Entire custom purpose (e.g. reading a ztable), I guess, this step wont be needed.

    Naimesh Patel

  • Hello Leandro,

    I don’t recommend to change the standard program to any of my clients. The main reason behind that is you lose the base to compare when you change the standard.

    SPAU would be very painful when you need to incorporate many of the changes in the original program after SP. Imagine if the original program is part of the “newer” area where SAP is still streamlining the process and releasing notes often – your work in SPAU would be increased drastically.

    Naimesh Patel

  • Leandro

    I disagree with you.
    “you lose the base to compare when you change the standard.”
    No, you don’t. Because with the version management you can compare with the old original or with the modified code.
    “SPAU would be very painful when you need to incorporate many of the changes in the original program after SP.”
    Copied programs are no better here.
    ” Imagine if the original program is part of the “newer” area where SAP is still streamlining the process and releasing notes often – your work in SPAU would be increased drastically.”
    The chances to happen in the same area is low, but even if it’s high, it’s an excellent opportunity to analyse if the code you modified is obsolete for example.

    For me the main benefit is that with modified programs, you are FORCED to analyse. With copied programs (clones), someone would need to pay very close attention to check all the clones with updates.

  • Hello Leandro,

    I was referring to compare the Output of standard report vs custom report. I guess I didn’t mention that in my earlier comment.

    I agree with you that the Copied program would have similar effect when working with the SPAU. Majority of times, I have noticed that business/SME would not approve the new functionality to be added to the Copied Custom program as the copied custom works as expected after many rounds of fine tuning.

    Probably you would are right in imposing the check when you have modified version of the program. But I believe that leaving standard as-is provides a benefit of comparing the std. This is very similar to the fact that many of the clients – as SAP suggests – go for Order Type ZOR instead of OR, Pricing condition ZPR0 instead of PR00, etc.

    Naimesh Patel

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.