Monday, 6 January 2014

Creating a Program in SAP ABAP

Creating a Program in SAP ABAP

To begin creating a program, access the ABAP Editor either via transaction code SE38, or by navigating the SAP menu tree to Tools à ABAP Workbench à Development, in which the ABAP Editor is found. Double-click to execute.
A note to begin: it is advisable to keep the programs created as simple as possible. Do not make them any more complicated than is necessary. This way, when a program is passed on to another developer to work with, fix bugs and so on, it will be far easier for them to understand. Add as many comments as possible to the code, to make it simpler for anyone who comes to it later to understand what a program is doing, and the flow of the logic as it is executed.
The program name must adhere to the customer naming conventions, meaning that here it must begin with the letter Z. In continuation of the example from the previous chapter, in this instance the program will be titled ‘Z_Employee_List_01’, which should be typed into the ‘Program’ field on the initial screen of the ABAP Editor. Ensure that the ‘Source code’ button is checked, and then click ‘Create’
             

Creating a Program in ABAP
Creating a Program in ABAP
              
Note that the * must be in the first column on the left. If it appears in the second column or beyond, the text will cease to be a comment.
 A comment can also be written within a line itself, by using a “. Where this is used, everything to the right again becomes a comment. This means that it is possible to add comments to each line of a program, or at least a few lines of comments for each section
\
Creating a Program in ABAP

          
The next line of code, visible above, begins with the word REPORT. This is called a STATEMENT, and the REPORT statement will always be the first line of any executable program created. The statement is followed by the program name which was created previously. The line is then terminated with a full stop (visible to the left of the comment).
Every statement in ABAP must be followed by a full stop, or period. This allows the statement to take up as many lines in the editor as it needs, so for example, the REPORT statement here could look like this
Creating a Program in ABAP

                      
As long as the period appears at the end of the statement, no problems will arise. It is this period which marks where the statement finishes.

If you require help with a statement, place the cursor within the statement and choose the ‘Help on...’ button in the top toolbar
Creating a Program in ABAP

24 comments:

  1. Thank you sir,It is nice and more informative. We are providing online training on & for more info: sap sd online training it gives the career plan. It is in simple language and understandable to every freshers.

    ReplyDelete
  2. Thank you sir,It is nice and more informative. We are providing online training on & for more info: sap wm online training it gives the career plan. It is in simple language and understandable to all freshers.

    ReplyDelete