Tuesday 9 July 2013

JULY 9


Introduction to Source Code editor , its functionality and familiarization to tools of the editor.

The Source Code Editor

We use two types of screens :
  • ABAP/4 Editor: Initial Screen
  • ABAP/4 Editor: Edit Program screen

The ABAP/4 Editor: Initial screen is shown as below-


From there, we can display or change all program components. For example, to change the source code component, we can choose the Source Code radio button and then press the Change button. Or, to display the attributes component, choose the Attributes radio button and then press the Display button.
Pressing the Change button displays the selected component in change mode, which enables you to change the component.

NOTE:
In above figure,  the Object Components group box encloses radio buttons, the Display button, and the Change button. When we see a group box enclosing both radio buttons and push-buttons, the radio buttons deter-mine the component acted upon by the enclosed push-buttons. The effect of the radio buttons is limited by the group box; they have no effect on push-buttons outside the box.

Functionality of the Source Code Editor

From the ABAP/4 Editor: Initial Screen, choose the Source Code radio button and press the Change button. The ABAP/4 Editor: Edit Program screen is shown, as in Figure below.





The Standard Toolbar

The Standard toolbar controls and the Application toolbar controls are shown in Figure below.


The Standard toolbar controls in order, are:
    • Enter: Pressing the Enter button has the same effect as pressing the Enter key. It is also the split line function. To split a line of code, position the cursor at the point where we want to split the line and press Enter.
    • Command Field: This accepts transaction codes and various other commands.
    • Back and Exit: Both return  to the ABAP/4 Editor: Initial Screen. If we have unsaved changes, we will be prompted to save them.
    • Cancel: Returns  to the ABAP/4 Editor: Initial Screen without saving our changes. If we have unsaved changes, we will be prompted to save them.
    • Print: This will print the source code of our program. When we press it, the Print Parameters screen is displayed. To receive the output,the Print Immed. check box is checked.
    • Find: Provides search and replace functionality. When we press it, the Search/Replace screen is shown. 
    • Find Next: This is a handy shortcut for finding the next occurrence of a string.
    • First Page, Previous Page, Next Page, and Last Page: These enable us to page up and down through the source code.
    • Help: Displays a dialog box from which we can obtain help about the editor and ABAP/4 syntax, among other things. Position the cursor on an ABAP/4 keyword or a blank line before pressing the Help button. 

    The Application toolbar controls, in the order they appear on the toolbar, are as follows:
    • Display <-> Change: Changes the screen from display mode to change mode. Press it again to change it back to display mode.
    • Check: Checks the syntax of the current program.
    • Where-Used List: When we press this button while our cursor is on any variable name, it will display all the lines of code that use it.
    • Stack: Displays the contents of the current navigation stack.
    • Cut: Deletes the line containing the cursor and places it in the buffer.
    • Copy To Buffer: Copies the contents of the line containing the cursor to the buffer.
    • Insert From Buffer: Inserts the contents of the buffer to a new line above the current cursor position.
    • Insert Line: Inserts a blank line above the current cursor position.
    • Select: Selects a single line or a block of lines for moving, cutting, and pasting. Place the cursor on the first line of the block and press Select. Place the cursor on the last line of the block and press Select again. The lines contained in the block will turn red. We can now cut, copy, or duplicate the block of code the same way we did for a single line. To deselect the selected lines, choose the menu pathEdit->Deselect.
    • Undo: Reverses your last change. Only one level of undo is available.
    • ABAP/4 Help: Provides help about the editor and about ABAP/4 in general.
    • Pattern: Enables to insert an automatically generated ABAP/4 statement. 
    • Concatenate: Joins two lines together. To use it, place the cursor at the end of a line and press the Concatenate button to concatenate the next one to it. To split a line, position the cursor where we want the split to occur and press the Enter key.
    • Duplicate Line: Duplicates a single line or an entire block of code if one is selected .
    • Move Line: Moves lines left and right. To move a line, put the cursor at the target position and press the Move Line button. To move a whole block of code, mark the block and place the cursor on the first line of the block at the position to which it should be moved, and then press the Move Line button. To move it to the left, place the cursor to the left of the beginning of the line and press the Move Line button.
    • Mark Line: Places a bookmark on a line. We can display all marked lines with the menu path Goto -> Markers.