Você está na página 1de 2

ABAP Exercises

Part I - Data Types


1. Declare an integer.
2. Declare a variable of type character with 10 positions and give it Hello ABAP as an initial value.
3. Declare a variable of numeric type with 4 positions and initial value 1234.
4. Declare a variable of type integer with initial value 42.
5. Declare a variable of type integer with initial value 12.72.
6. Declare a variable of type date and give it Halloween day.
7. Declare a packed number variable with 7 decimal places.
8. Declare a variable of type S_CARR_ID.
9. Declare a variable of the same type of field carrid from table SPFLI
10. Declare a variable of the same type of field FLDATE table SFLIGHT.
11. Declare a structure of the same type of SBOOK.
12. Declare an internal table with all table fields from table SCARR.
13. Declare a constant which contains your name.
14. Declare two constants which contain the values 'X' (true) and ' ' (false).
15. Declare a constant which contains the 5 first decimals of Pi.

Part II - Imperative Logic


1. Write an executable program that performs the following calculation: 2 + 3 * 5
2. Write an executable program that get two integers inside variables and perform the addition,
subtraction, multiplication, and division between them.
3. Write an executable program that get two integers inside parameters and perform the addition,
subtraction, multiplication and division between them.
4. Write an executable program that concatenates two words and write the result.
5. Write an executable program that concatenates two words and the current month, separating
each part by a "-" and write the result.
6. Write an executable program that reads the current system date and write it in your language in
text format.
7. Write an executable program that counts a string length and if it's bigger than 20 characters,
write 'Too big'. If not, write the string length.
1. Sa se declare 3 variabile de tip caracter, continand prenumele vostru, judetul si orasul in care v-
ati nascut si o a patra variabila de tip data care sa contina data de nastere.
Sa se afiseze din cate caractere este format prenumele, judetul si orasul plus suma acestora.
Sa se concateneze cele 4 variabile si sa se afiseze lasand un spatiu intre ele.

2. Sa se declare o variabila de 25 de caractere care sa aiba valoarea initiala unu doi trei patru.
Sa se afiseze din cate caractere este format acest sir.
Sa se condenseze sirul.
Sa se afiseze din nou din cate caractere este format noul sir.
Sa se condenseze din nou sirul fara a lasa spatii intre cuvinte.
Sa se afiseze din nou din cate caractere este format noul sir.

Você também pode gostar