ABAP rules to consider before creating a bespoke abap report or program

Here a few rules to follow when developing ABAP code:

Rule 1: Why?
You probably know that ABAP stands for Advanced Business Application Programming but maybe it should stand for A Better Alternative Possible? because this is what you should consider every time you are asked to create a new ABAP report. "Our old system used to do this� or "We don't want to use the SAP equivalent component� are some of the reasons why a custom programs are asked for but you need to understand the business benefits and consider the alternatives.

Bespoke code will need to be developed, tested and supported through system upgrades. Yes the finished product may be easier and quicker to use but if the development and support time adds more time than it saves, it may be more efficient to use Standard SAP reports if available.

What are the alternatives for reporting or data transfer?
• Existing SAP reports
• SAP (ABAP) Query
• Report Writer
• LIS
• BW
• SAP Transfer Workbench
• LSMW

Rule 2: Is the data being accessed in the most efficient way
Things you need to consider to ensure you get the optimum performance from your code are as follows:
• Is the design is correct in the first place
• Are the correct tables being used
• How is the code affected when the amount of data increases.

Rule 3: How are any errors handled

Rule 4: What are the security issues with this ABAP report

See here for further information on Security specific ABAP code

Rule 5: Is there validation on the selection screen

Rule 6: Does the code contain any hard coded values
If possible try not to use hard coded values as this can cause support issues further down the line. i.e. if the value you have hard coded changes you need to update the program with the new value, test it and then transport it through the SAP landscape. This is ok if it's just one program but if there are multiple programs then this job can become time consuming.

Just imagine if you had written numerous programs which retrieved data based on company code and you had hard coded this value. Then your company needs to use a second company code on the same SAP system, you would then need to modify every program where you had hard coded company code.

Rule 7: Is the ABAP going to be used international
Does the code need to display text in multiple languages, use multiple currencies or even handle different company codes if a different one is used for each country?

See here for further information on Country specific ABAP code

Rule 8: Have you commented your code

Rule 9: Is the ABAP report/program documented

Rule 10: Will it transport ok
Is everything activated and ready to go, also are all components transportable or do you need to create some of them manually in each system?


Related Articles

Beginners Guide to learning SAP development starting with logging into SAP
ABAP Programming EVENTS in SAP
ABAP Function Module basics in SAP
DATA and @DATA Inline ABAP declarations available from release 7.40 to help make your code cleaner and more readable
ABAP Workbench Programming Techniques - BC402
ABAP Subroutine basics in SAP
Get access to an SAP system for individual needs
SAP Base 64 encoding and decoding using ABAP code
Call web URl from ABAP report or SAP help documentation
Direct download, downloading sap objects
SAP Icons
SAP icons and some ABAP code to display them
SAP icons list and their associated codes
Internal Program Environment diplays all internal/external objects and operations used by an SAP program
minisap installation on your local pc to allow ABAP development, your own local SE80
SAP minisap installation on your local pc to allow ABAP development for free
SAP module based information such FI, HR, MM, PM, BW etc
Need an SAP ABAP program created?
SAP repository objects - List of useful standard and bespoke SAP repository objects
Retrieve SAP objects using transport entry in SE10 to restore objects that have been deleted
SAP Help for all areas for SAP ABAP Development inc ABAP, ALV, Web dynpro, bsp, HR, BW
ABAP tutorial - Logging into an SAP system for the first time
Manage and delete SAP sessions using ABAP code
SAP module areas
Increase & Decrease size of SAP editor text
ABAP development information and code examples for producing be-spoke SAP functionality
ABAP Development Info - Example code and information on various areas of ABAP development
SAP command field entries - box in top left corner
Force new page when printing abap source code
ABAP FIELD SYMBOL - Techniques for manupulating data using the FIELD-SYMBOL statement
Hiding ABAP Source Code so that it can not be viewed by anyone
ABAP Internal table declaration - Various methods of creating internal data structures and tables
Parameter ID - ABAP code to demonstrate how to set and get a parameter ID
RANGE statement - Example ABAP code to demonstrate the RANGE command
Change SAP logo in top right hand corner of SAP client
ABAP SELECT statement within SAP - Example ABAP code to demonstrate the SELECT command
Create desktop Shortcut to SAP function
SAP Note assistant - Using transaction SNOTE to read and apply OSS note fix
VARYING command - Example ABAP code to demonstrate the VARYING command
Creating your first helloworld ABAP report in SAP