Variables


When you declare a variable in an ABAP program, what are the key points you should consider?

The variables are always declared at the beginning of the program or subroutine or include. Below are the some of rules to follow while declaring variables -

  • They must begin with a letter.
  • Can be a maximum size of 30 characters.
  • Cannot include + , : or ( ) in the name.
  • Cannot use a reserved word.

Name a few system global variables you can use in ABAP programs?

SY-SUBRC, SY-DBCNT, SY-LILLI, SY-DATUM, SY-UZEIT, SY-UCOMM, SY-TABIX.

In what way are Get and SET different?

GET PARAMETER ID FIELD: The value placed in ID is moved in the variable by the statement, if a value is not found in SAP memory, the system configures SY-SUBRC to 4, otherwise is 0.
SET PARAMETER ID FIELD: The field contents from ID are stored in SAP memory in a code with up to 20 characters in length. If a value is found there already it gets overwritten. If there is no ID, we should make a new parameter object by double-clicking the ABAP Editor.

How the values will be passed to RFC Function module Pass by Value or Pass by reference?

Always Pass by Value.
RFC is Remote Function call cannot access the values with Pass by reference.

What are field symbols in SAP ABAP?

Field symbols can point to any data object in ABAP/4 and to structures defined in ABAP/4 dictionary. All operations we have programmed with the field symbol are carried out with the assigned field.

What are the system fields? Explain?
What is System Variable in ABAP?

The ABAP system fields are active in all ABAP programs. They are filled by the runtime environment, and we can query their values in a program to find out states of the system. Although they are variables, we should not assign our own values to them, since this may overwrite information that is important for the normal running of the program. However, there are some isolated cases in which we may need to overwrite a system variable. For example, by assigning a new value to the field SY-LSIND, we can control navigation within details lists.

What is a multiple line field?

A multiple line field that allows the user to enter multiple lines of data into it.

How do you populate data into a multiple line field?

To populate data into a multiple line field, an index (Line index) is added to the field name to indicate which line is to be populated by the BDC session.