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
Q

What are the three types of secondary tables that can be defined for an internal table?

A
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
Q

What is the maximum number of secondary keys on an internal table

A

15

27
Q

How is a secondary accessed

A
READ/MODIFY/DELETE   INDEX # USING KEY.
or 
READ TABLE  WITH KEY  COMPONENTS...
or
READ/MODIFY/DELETE TABLE  from  USING KEY
28
Q

Secondary keys are always immediately updated

A

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
Q

Replace the following with a new table expression

READ TABLE INDEX idx INTO

A

= [ idx ]

30
Q

Replace the following with a new table expression

READ TABLE INDEX idx USING INTO

A

= [ KEY INDEX idx ]

31
Q

READ TABLE WITH KEY =
=
into

A

= [ = = ]

32
Q

READ TABLE WITH TABLE KEY
COMPONENTS
=
=
into

A
= [ KEY  
                         COMPONENTS
                                = 
                                =  ]
or
 = [ KEY  
                                = 
                                =  ]
33
Q

How would you use the VALUE statement to add info to an internal table with columns col1, col2, col3?

A

= VALUE #(
( col1 =
col2 =
col3 = )
( col1 = ) )

34
Q

What does the keyword BASE do?

A

Existing content of the table is kept.
e.g.
= VALUE #( BASE =
< col1> = ) )

35
Q

What would the following statement do?
= VALUE #( FOR IN
WHERE ( = )
( = )

A

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
Q

What do LINE_EXISTS and LINE_INDEX do

A

LINE_EXISTS returns the Boolean value (predicate)

LINE_INDEX returns the index number (descriptive)

37
Q

do all data references need to be dereferenced?

A

No, if the referenced object is a structure the components can be addressed directly using the -> syntax. e.g. dataref->col1

38
Q

How can a generic reference (type data for example)

A

The reference must be assigned to a field symbol in order to be able to access the content

39
Q

How is a data object assigned to a data reference?

A

GET REFERENCE OF fld INTO ref
or
ref = REF #( fld )

40
Q

How can I tell if a reference has been bound?

A

ref IS BOUND
or
ref IS NOT BOUND

41
Q

Technically what is a field symbol?

A

A dereferenced pointer

42
Q

How is a field symbol assigned and unassigned

A

ASSIGN fld to

UNASSIGN

43
Q

Unlike a standard table, when accessing a sorted or hashed table and assigning to a field symbol, what can not be done?

A

The contents of the field symbol cannot be changed

44
Q

What happens if I reassign or unassign a field symbol used as the target of a lopp?

A

runtime error

45
Q

Can the SUM statement be used if the loop is assigning a field symbol?

A

no

46
Q

Can field symbols be used with INSERT, COLLECT, MODIFY?

A

Yep