TAW_11 Chapter 2, statements, functions and expressions Flashcards

1
Q

Type I truncates values?

A

False, Integers are ROUNDED, not truncated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The type I value range is from what to what?

A

-2,147,483,648 to 2,147,483,647

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

There are 7 basic calculations. What are they

A

+,-,*,/,DIV (rounded down),MOD,**

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Type F is extremely accurate

A

No, only use for approximations as the decimals are often unpredictable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

when would a type F be needed?

A

There are special aggregations of the SELECT statement that require it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the maximum number of decimals in a type P

A

14

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the requirement for number of digits to the left

of the decimal in type P?

A

At least one digit to the left of the decimal must be present

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which can hold larger numbers, type F or DECFLOAT

A

The DECFLOAT are larger and more accurate than type F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

If a arithmetic expression contains a type P, is the internal calc based on type P?

A

Yes, all is converted to type P unless a type F is also present

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The system will use DECFLOAT as the interim if what is true

A

If at least one field is of type DECFLOAT and no type P or F fields exist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

There are 9 statements for processing character type data. What are they

A
CONCATENATE
SHIFT
OVERLAY
SPLIT
FIND
TRANSLATE
REPLACE
CONDENSE
WRITE..TO..
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What did the FIND command replace?

A

The SEARCH command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Two of the character type statements cannot be used with type X fields. What are they?

A

CONDENSE and OVERLAY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What must be added to the 7 processing statements for character processing to use them with type X fields?

A

add IN BYTE MODE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Name the 8 logical operators

A
CA - contains any
NA - not any
CO - contains only
CP - contains pattern
NP - not pattern
CN - contains no
CS - contains string
NS - no string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can the 8 logical operators be used with type X

A

Just add BYTE- to the operator

17
Q

SAP date calculations use Julian date?

A

No, they use a start date of 01-01-0001

18
Q

What is the concatenation symbol for string templates?

A

&&

19
Q

In a string expression functions can be used provided…

A

The result is character type or convertible to a string

20
Q

Name some of the string template formatting options

A
width
date
time
currency
align
pad
case
sign
exponent
decimals
zero
style
number
timestamp
timezone
country
21
Q

what do predicate functions return?

A

True or False boolean

22
Q

What do descriptive functions return?

A

Numeric results

23
Q

What do processing functions return?

A

Character type results

24
Q

Name the 6 descriptive sting functions

A
STRLEN
NUMOFCHAR
FIND
FIND_ANY_OF
COUNT
COUNT_ANY_OF
25
Q

why doesn’t find_any_of have a “case” parameter?

A

Because it is always case sensitive

26
Q
What does the following do? And what does it return?
FIND( VAL = 'abapABAP'
           SUB = 'A'
           OCC = 2
           CASE = 'X' )
A

Finds the second occurrence of ‘A’ from the left. It returns the value of 6. (remember the count starts at position 0.

27
Q

What would OCC = -2 mean?

A

Find the second occurrence from the right

28
Q

What are the 18 processing functions in character type data

A
SHIFT_LEFT - SHIFT_RIGHT
TO_UPPER - TO_LOWER 
TO_MIXED - FROM_MIXED
CMAX - CMIN
ESCAPE
CONCAT_LINES_OF
MATCH
REPEAT
REVERSE
TRANSLATE
CONDENSE
REPLACE
INSERT
SUBSTRING
29
Q

What are the available PREDICATE functions

A

CONTAINS, CONTAINS_ANY_OF, MATCHES

30
Q

What does MATCHES require?

A

A REGEX

31
Q

There are 10 regular expression operators. Good luck naming them!

A
. = any character
r* = 0 or more occurrences
r+ = 1 or more occurrences
r{m,n} = min,max occurrences of 
r{m} = exactly occurrences of
r? = 0 or 1 occurrences of 
r|s = r or s
( ) = subgroup
^ $ = Start/end of line
\< \> = Start/end of word
32
Q

There are 6 special character combinations to describe a single character

A
. = placeholder
\ = placeholder for group of characters
[] = value set for single character [ABC]
[^] = Negation of a character set [^ABC]
[-] = value range for single character [A-D]
[[::]] = description upper/digital
33
Q

Which string expressions support the use of regular expressions

A
COUNT
COUNT_
CONTAINS
FIND
FIND_
MATCH
MATCHES
REPLACE
SUBSTRING
SUBSTRING_
34
Q

Regex replacements start with what?

A

$