TAW_11 Chapter 2, statements, functions and expressions Flashcards
Type I truncates values?
False, Integers are ROUNDED, not truncated
The type I value range is from what to what?
-2,147,483,648 to 2,147,483,647
There are 7 basic calculations. What are they
+,-,*,/,DIV (rounded down),MOD,**
Type F is extremely accurate
No, only use for approximations as the decimals are often unpredictable
when would a type F be needed?
There are special aggregations of the SELECT statement that require it
What is the maximum number of decimals in a type P
14
What is the requirement for number of digits to the left
of the decimal in type P?
At least one digit to the left of the decimal must be present
Which can hold larger numbers, type F or DECFLOAT
The DECFLOAT are larger and more accurate than type F
If a arithmetic expression contains a type P, is the internal calc based on type P?
Yes, all is converted to type P unless a type F is also present
The system will use DECFLOAT as the interim if what is true
If at least one field is of type DECFLOAT and no type P or F fields exist
There are 9 statements for processing character type data. What are they
CONCATENATE SHIFT OVERLAY SPLIT FIND TRANSLATE REPLACE CONDENSE WRITE..TO..
What did the FIND command replace?
The SEARCH command
Two of the character type statements cannot be used with type X fields. What are they?
CONDENSE and OVERLAY
What must be added to the 7 processing statements for character processing to use them with type X fields?
add IN BYTE MODE
Name the 8 logical operators
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 can the 8 logical operators be used with type X
Just add BYTE- to the operator
SAP date calculations use Julian date?
No, they use a start date of 01-01-0001
What is the concatenation symbol for string templates?
&&
In a string expression functions can be used provided…
The result is character type or convertible to a string
Name some of the string template formatting options
width date time currency align pad case sign exponent decimals zero style number timestamp timezone country
what do predicate functions return?
True or False boolean
What do descriptive functions return?
Numeric results
What do processing functions return?
Character type results
Name the 6 descriptive sting functions
STRLEN NUMOFCHAR FIND FIND_ANY_OF COUNT COUNT_ANY_OF
why doesn’t find_any_of have a “case” parameter?
Because it is always case sensitive
What does the following do? And what does it return? FIND( VAL = 'abapABAP' SUB = 'A' OCC = 2 CASE = 'X' )
Finds the second occurrence of ‘A’ from the left. It returns the value of 6. (remember the count starts at position 0.
What would OCC = -2 mean?
Find the second occurrence from the right
What are the 18 processing functions in character type data
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
What are the available PREDICATE functions
CONTAINS, CONTAINS_ANY_OF, MATCHES
What does MATCHES require?
A REGEX
There are 10 regular expression operators. Good luck naming them!
. = 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
There are 6 special character combinations to describe a single character
. = 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
Which string expressions support the use of regular expressions
COUNT COUNT_ CONTAINS FIND FIND_ MATCH MATCHES REPLACE SUBSTRING SUBSTRING_
Regex replacements start with what?
$