TAW_11 Chapter 3, Internal tables Flashcards

1
Q

Its okay to resort sorted tables?

A

NEVER!!!

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

You can append a sorted table?

A

Only if the appended line will be in the correct order.

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

All reads of a sorted table are binary by default?

A

Correct

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

Can a hash table be sorted?

A

Yes, and this is appropriate if the hash table is to be used in a loop/endloop

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

What is the safest way to add a row to a sorted table?

A

insert with key

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

three operations might cause issues with a sort table violation.

A

INSERT, APPEND, MODIFY by index

It is best to INSERT using key and Modify using key. Best to avoid APPEND altogether

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

What is implicit specification with table operations?

A

using FROM where <> is a populated object with the a line of the table lne

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

What are the 4 ways of reading a table

A

By index (index)
by table key (with table key)
by any key (with key)
by implicit key (from)

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

What two keywords are mutually exclusive when writing table statements?

A

INDEX and TABLE will never occur together

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

By default does the insert use the table key?

A

Yes

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

Hashed tables cannot use index access?

A

This is true

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

Can I use MODIFY with table key to change key fields?

A

No, MODIFY by index will allow key fields to be changed. Do not use this with sorted tables and cannot be used with hashed tables

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

What table access commands can use implicit keys?

A

DELETE, MODIFY,INSERT, READ

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

MODIFY by key and INSERT by KEY can only use what type of key

A

Implicit

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

When performing INSERT, MODIFY, DELETE with in a table loop, what part of the syntax can be left out?

A

INDEX. The index will default to sy-tabix so
INSERT INTO
implies INSERT into INDEX

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

Can the abbreviated syntax (no index specified) be used outside of a loop?

A

No, It will not cause a syntax error but will cause a runtime error

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

Can MODIFY be used with a WHERE clause?

A

Yes, but you must specify TRANSPORTING

Also, WHERE can only be used with MODIFY, not MODIFY TABLE

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

Can DELETE be used with a where clause?

A

Yes, but only with DELETE, not with DELETE TABLE

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

Cn WHERE be used with HASHED tables?

A

Yes, within a loop only

20
Q

What happens when you attempt to add a line to a sorted table with a unique key and the record already exists?

A

Just a sy-subrc 4. no dump

21
Q

Can MOVE-CORRESPONDING be used with internl tables?

A

Yes, move-corresponding to works fine as long as no unique key violations exist in as a result of the move

22
Q

What if I want to move entries from to but I want to keep the records already in ?

A

Use KEEPING TARGET LINES addition

23
Q

DELETE ADJACENT DUPLICATES can be used with a HASED table?

A

It appears so but I need to check. It could only be on secondary key comparisons correct?

24
Q

Which table types can be used with the collect statement?

A

All three, but SAP says that COLLECT is best suited for HASHED tables

25
What are the three types of secondary tables that can be defined for an internal table?
``` Unique standard WITH UNIQUE KEY COMPONENTS Non-unique sorted WITH NON-UNIQUE KEY COMPONENTS Unique hashed WITH UNIQUE HASHED KEY COMPONENTS All table types can have these keys ```
26
What is the maximum number of secondary keys on an internal table
15
27
How is a secondary accessed
``` READ/MODIFY/DELETE INDEX # USING KEY. or READ TABLE WITH KEY COMPONENTS... or READ/MODIFY/DELETE TABLE from USING KEY ```
28
Secondary keys are always immediately updated
No, they are lazy updates that are only updated when first used or used after an update the exception is unique keys which are updated immediately to check for uniqueness violation
29
Replace the following with a new table expression | READ TABLE INDEX idx INTO
= [ idx ]
30
Replace the following with a new table expression | READ TABLE INDEX idx USING INTO
= [ KEY INDEX idx ]
31
READ TABLE WITH KEY = = into
= [ = = ]
32
READ TABLE WITH TABLE KEY COMPONENTS = = into
``` = [ KEY COMPONENTS = = ] or = [ KEY = = ] ```
33
How would you use the VALUE statement to add info to an internal table with columns col1, col2, col3?
= VALUE #( ( col1 = col2 = col3 = ) ( col1 = ) )
34
What does the keyword BASE do?
Existing content of the table is kept. e.g. = VALUE #( BASE = < col1> = ) )
35
What would the following statement do? = VALUE #( FOR IN WHERE ( = ) ( = )
A new entry in table will be created for every row in where col1 = val1. The new line in tab1 will have a value of val2 in col2 Not we did not save current values in tab1 by using and BASE. Also, the WHERE clause must be in parentheses
36
What do LINE_EXISTS and LINE_INDEX do
LINE_EXISTS returns the Boolean value (predicate) | LINE_INDEX returns the index number (descriptive)
37
do all data references need to be dereferenced?
No, if the referenced object is a structure the components can be addressed directly using the -> syntax. e.g. dataref->col1
38
How can a generic reference (type data for example)
The reference must be assigned to a field symbol in order to be able to access the content
39
How is a data object assigned to a data reference?
GET REFERENCE OF fld INTO ref or ref = REF #( fld )
40
How can I tell if a reference has been bound?
ref IS BOUND or ref IS NOT BOUND
41
Technically what is a field symbol?
A dereferenced pointer
42
How is a field symbol assigned and unassigned
ASSIGN fld to | UNASSIGN
43
Unlike a standard table, when accessing a sorted or hashed table and assigning to a field symbol, what can not be done?
The contents of the field symbol cannot be changed
44
What happens if I reassign or unassign a field symbol used as the target of a lopp?
runtime error
45
Can the SUM statement be used if the loop is assigning a field symbol?
no
46
Can field symbols be used with INSERT, COLLECT, MODIFY?
Yep