Video Lesson 9.7: Screen Pushbuttons

Learn ABAP

Video Lesson 9.7: Screen Pushbuttons

In this lesson you will learn how to create and work with buttons in your screen.

Pushbuttons

Implement Pushbuttons

Different pushbuttons and the program are to be implemented in such a way that the appropriate processing for the user action is executed:

  • If the user chooses the Back pushbutton, he or she returns to the basic list without writing any changes to the database table. The message “You left the screen without saving” is displayed in the status bar of the basic list.
  • If the Save button is chosen, the changes are executed in the database and the user returns to the basic list with a corresponding message in the status bar.
  • If the Enter button is chosen, the screen is displayed again.

Flow for Choosing a Pushbutton

  • If the user chooses a pushbutton, the runtime system copies the assigned function code to a special screen field (of the OK type). This screen field is typically called the ok_code.




Video Lesson 9.6: Screen

Learn ABAP

Video Lesson 9.6: Screen

In this lesson you will learn how to design and program simple screens with
input/output fields and pushbuttons.

Features of Screens

A screen not only consists of its layout with input/output fields, pushbuttons and other screen elements, but also a processing logic.

 (source code excerpts that are processed as the pre-/postprocessing of the screen display).

The layout can be designed very flexibly, with:

  • input fields,
  • output fields,
  • radio buttons,
  • check fields and,
  • most importantly, pushbuttons with which the corresponding functions of the program can be executed.

Screen Sequence

  • You start a screen sequence by calling up the first screen from the processing block of your program.
  • After a screen is processed, the statically or dynamically defined screen sequence is processed.
  • You call a screen in your program using the ABAP statementCALL SCREEN <screen number>”



Video Lesson 9.3: Generating A Details List – AT LINE SELECTION

In this lesson you will be able to react to the user double-click on the
basic list with the display of a details list that contains detailed information on the
clicked line (interactive list).

Generating a Details List

  • When the user selects a basic list by means of double-click of function key F2, the ABAP event AT LINE-SELECTION is triggered.
  • You must implement this in your program in the form of a corresponding processing block.
  • You can read the data requested by the user and out put them with the WRITE statement.
  • Hint: If an AT LINE-SELECTION block is implemented in the program, a push button with the magnifying glass symbol also appears above the list.
  • Marking the list row and then choosing this button has the same effect as double-clicking the list row.

Generating Several Details Lists

  • The row selection on the detail list also triggers the AT LINE-SELECTION event.
  • You must be able to determine within this block on which list the current row selection was made so that you can react adequately.
  • You can use the sy-lsind system field for this. This field shows the current list level: 0 for the basic list, 1 for the first details list, and so on.
  • The value of sy-lsind should be used to control processing in the AT LINE-SELECTION block.

Video Lesson 9.2: ABAP Text Symbols

Learn ABAP

Video Lesson 9.2: ABAP Text Symbols

In this lesson you will learn to create and use Text Symbols in your programs to control and maintain the language displayed for dialog messages, error messages and screen outputs.

Multilingual Capabilities of lists

  • Text elements of a program - this also includes headings - can be translated into various languages.
  • When a user executes a program, relevant text elements are always automatically displayed in the log on language of the user (automatic language)
  • To translate the text elements of your program, use the menu path GO to- Translation from within the ABAP editor.
  • To design texts in the list core in several languages and be able to use the language functions, so called text symbols are implemented.
  • A text symbol consists of a three-digit alphanumeric ID xxx as well as a tranlateble text and, like the headers, belongs to the text elements of a program




Video Lesson 9.1: ABAP Lists

Learn ABAP

Video Lesson 9.1: ABAP Lists

You will learn about the benefits and different functions of the ABAP list. In addition, you will be able to react to the user double-click on the basic list with the display of a details list that contains detailed information on the clicked line (interactive list).

Features of Lists

The main purpose of a list is to display data with a minimum of programming efforts.

Lists also take the special requirements of business data into account:

  • Lists can de designed as multi-language units: Texts and headings appear in the log on language, provided an appropriate translation is available.
  • Lists can display monetary values in the appropriate currency.

The following options are available when programming a list:

  • Screen: You can add colors and icons
  • Printers
  • Internet and Intranet: Automatic conversion to HTML takes place for this.
  • Save: This is possible both within tha SAP System as well as outside of it (for further processing-for example, through table calculation programs).
  • You create lists using the WRITE statement.
  • You can create simple lists and complex lists with events.
  • Using the ULINE statement, you draw a horizontal line in the screen.

To format the output of a list you can use the following ABAP STATEMENTS:

  • COLOR<color> : Adds color to the background of the text
  • LEFT JUSTIFIED: Aligns your text to the left
  • RIGHT JUSTIFIED: Aligns your text to the right.
  • CENTER: Aligns your text to the center

Video Lesson 8.1: ABAP Events

Learn ABAP

Video Lesson 8.1: ABAP Events

In this lesson, you will find out how an executable ABAP program is processed in an event-controlled manner. You will learn about the most important basic events as well as their purposes and you will be able to use them in your programs.

Purpose and Usage of ABAP events

  • When you start an ABAP program, all global data objects of  the programs are first created in the working memory (memory allocation).
  • After that, the run time system triggers various events in succession.
  • If a processing block exists for a triggered event in the program, the statements of this block are executed in sequence.

Purpose of ABAP Events

  • If values are assigned to the PARAMETERS variables in the INITIALIZATION block, these are displayed as (changeable) default values in the input fields when the selection screen is displayed subsequently.
  • You can use the described value assignment in the INITIALIZATION block to assign another default value (dynamic prepopulation of the selection screen).




Video Lesson 7.5: ABAP Include Programs

Learn ABAP

Video Lesson 7.5: ABAP Include Programs

This lesson will show you how to create INCLUDES in your ABAP programs so you can reference other subroutines and organize your programs in a more efficient way.

  • Include programs are global R/3 Repository objects.
  • They are solely for modularizing source code, and have no parameter interface.
  • They have the following functions:
  • Library: Include programs allow you to use the same source code in different programs.
  • Order: Include programs allow you to manage complex programs in an orderly way.
  • Function groups and module pools use include programs to store parts of the program that belong together.
  • A special include is the TOP include of a program.

Creating Your Own Include Programs

  • If you create an include program yourself, you must assign it the type I in its program attributes.
  • You can also create or change an include program by double-clicking on the name of the program after the INCLUDE statement in your ABAP program.
  • If the program exists, the ABAP Workbench navigates to it.
  • If it does not exist, the system creates it for you.
  • An include program cannot run independently, but must be built into other programs.
    Include programs can contain other includes.




Video Lesson 7.4: SAP Implementing A Subroutine Call

Learn ABAP

Video Lesson 7.4: SAP Implementing A Subroutine Call

This lesson will show you how to implement a subroutine call in your ABAP program.

  • You can have the PERFORM statement for calling a subroutine generated into your source code.
  • First, define the subroutine and then save your main program.
  • The newly-defined subroutine appears in the navigation area.
  • Move it to the required call point in your program by means of drag & drop.
  • Alternatively, the call generation can also be implemented using the “Pattern” pushbutton in the ABAP editor.

 




Video Lesson 7.3: ABAP Table Types

Learn ABAP

Video Lesson 7.3: ABAP Table Types

You will learn how to create a table type object in the ABAP dictionary, this can be re-used in different programs to declare table type variables.

Table Types

  • Table types are construction blueprints for internal tables that are stored in the ABAP Dictionary.
  • When you create a table type in the ABAP Dictionary, you specify the line type, access type, and key.
  • The line type can be any data type from the ABAP Dictionary, that is, a data element, a structure, a table type, or the type of a database table
  • In an ABAP program, you can use the TYPE addition to refer directly to a table type. ->

Visibility of Global and Local Data Objects

  • Variables defined in the main program are global data objects.
  • They are visible (can be addressed) in the entire main program in every subroutine called.
  • Variables defined within a subroutine are called local, as they only exist in the relevant subroutine - just like the formal parameters.
  • The formal parameters and local data objects of a subroutine can not have the same names.