0% found this document useful (0 votes)
11 views9 pages

SAP ABAP Internal Tables Guide

Uploaded by

snehasebi97
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

SAP ABAP Internal Tables Guide

Uploaded by

snehasebi97
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAP ABAP

Internal Tables in SAP ABAP

Perfect — Internal Tables are one of the most asked topics in SAP ABAP interviews, because they’re
used in almost every program. Recruiters test both basic concepts and prac cal usage.

Here are the major recruiter-style ques ons on SAP ABAP Internal Tables with sample answers:

1. What is an Internal Table in SAP ABAP?

Answer:
An internal table is a temporary, run me memory object used to hold mul ple rows of data of the same
structure, similar to an array in other languages.

2. What are the different types of Internal Tables?

Answer:

 Standard Table → Data stored in the order of inser on, searched linearly.

 Sorted Table → Data automa cally sorted by key, faster access.

 Hashed Table → Data accessed by unique key, very fast (like a hash map).

3. What is the difference between Standard, Sorted, and Hashed Tables?

Answer:

 Standard → Sequen al search (O(n) me).

 Sorted → Binary search possible (O(log n)).

 Hashed → Key-based access (O(1) on average).

4. What is the difference between Header Line and Internal Table without Header Line?

Answer:

 With Header Line → Table + Work area in one object (old approach, not recommended now).

 Without Header Line → Work area must be declared separately. (Preferred modern prac ce).

5. What are the key opera ons with Internal Tables?

Answer:

 INSERT / APPEND → Add rows.

 MODIFY → Update row.

 DELETE → Remove rows.


 READ TABLE → Fetch row into a work area.

 LOOP AT … ENDLOOP → Iterate rows.

6. What is the difference between APPEND and INSERT in Internal Tables?

Answer:

 APPEND → Adds a row at the end of the internal table.

 INSERT → Adds a row at a specific posi on or by key.

7. What is the difference between COLLECT and APPEND?

Answer:

 APPEND → Always adds a new entry.

 COLLECT → Adds a new entry if unique; if duplicate (based on key), it sums numeric fields.

8. How do you read a specific entry from an Internal Table?

Answer:
Using:

READ TABLE itab WITH KEY field = value INTO wa.

IF sy-subrc = 0.

" record found

ENDIF.

9. What is SY-TABIX?

Answer:
SY-TABIX holds the current row index of an internal table during a loop or a er a READ TABLE.

10. What is the difference between LOOP AT and READ TABLE?

Answer:

 LOOP AT → Reads all rows one by one.

 READ TABLE → Reads only a single row based on index or key.

11. What is the difference between LINEAR SEARCH and BINARY SEARCH in Internal Tables?
Answer:

 LINEAR SEARCH → Default for standard tables, slower for large tables.

 BINARY SEARCH → Faster, but internal table must be sorted first.

Example:

READ TABLE itab WITH KEY field = value BINARY SEARCH.

12. What is INITIAL SIZE in Internal Tables?

Answer:
It defines the ini al allocated memory for an internal table when created. Example:

DATA: itab TYPE STANDARD TABLE OF mara INITIAL SIZE 10.

13. How do you copy one internal table to another?

Answer:

itab2[] = itab1[]. "Copy all entries

14. What is the difference between CLEAR, FREE, and REFRESH in Internal Tables?

Answer:

 CLEAR itab → Clears work area / header line.

 REFRESH itab → Deletes all rows but keeps memory.

 FREE itab → Deletes all rows and releases memory.

15. What is a Work Area in ABAP?

Answer:
A work area is a single row structure used to read or write one record at a me from an internal table.

PARAMETER

Great — PARAMETERS are very important in ABAP interviews, especially for selec on screens.
Recruiters test whether you know how users provide input to ABAP programs and how PARAMETERS differ
from other declara ons like DATA or SELECT-OPTIONS.

1. What is PARAMETERS in ABAP?

Answer:
PARAMETERS is used to declare an input field on a selec on screen of a report program. It lets the user
enter a single value at run me.
2. How do you declare a parameter in ABAP?

Answer:

PARAMETERS: p_matnr TYPE matnr,

p_date TYPE sy-datum.

3. What is the difference between PARAMETERS and DATA?

Answer:

 DATA → Declares variables inside the program (no selec on screen).

 PARAMETERS → Declares variables that appear as input fields on the selec on screen.

4. What is the difference between PARAMETERS and SELECT-OPTIONS?

Answer:

 PARAMETERS → Accepts a single value.

 SELECT-OPTIONS → Accepts a range of values (from–to, mul ple entries).

Example:

PARAMETERS p_matnr TYPE matnr. " Single value

SELECT-OPTIONS s_matnr FOR mara-matnr. " Mul ple/range

5. What are the different op ons you can use with PARAMETERS?

Answer:

 DEFAULT → Set default value

 OBLIGATORY → Must be entered

 LOWER CASE → Accept lowercase input

 AS CHECKBOX → Display as checkbox

 AS LISTBOX → Display as dropdown

Example:

PARAMETERS: p_cust TYPE kunnr OBLIGATORY,

p_flag AS CHECKBOX,

p_type TYPE c AS LISTBOX VISIBLE LENGTH 10.


6. Can you assign a default value to PARAMETERS?

Answer:
Yes, using DEFAULT.

PARAMETERS p_date TYPE sy-datum DEFAULT sy-datum.

7. What is the difference between OBLIGATORY and REQUIRED in PARAMETERS?

Answer:

 OBLIGATORY → User must enter a value; otherwise, error message appears.

 REQUIRED → Not used in ABAP PARAMETERS (only OBLIGATORY is valid).

8. Can PARAMETERS be declared as internal tables?

Answer:
No. PARAMETERS can only hold a single value, not mul ple rows. For mul ple values, use SELECT-
OPTIONS.

9. How do you hide a parameter on the selec on screen?

Answer:
By using NO-DISPLAY.

PARAMETERS p_secret TYPE string NO-DISPLAY.

10. What is the difference between PARAMETERS and CONSTANTS?

Answer:

 PARAMETERS → User input field, value can change at run me.

 CONSTANTS → Fixed value, cannot be changed.

11. Where are PARAMETERS mostly used in projects?

Answer:

 To filter database records (e.g., Sales Order by date).

 To get user-specific inputs for reports.

 To control report execu on behavior (e.g., with checkboxes, radio bu ons).


Debugging

Great — Debugging is one of the most prac cal topics in SAP ABAP interviews. Recruiters o en ask
about it because every ABAP consultant must know how to analyze issues, trace program flow, and fix
bugs in real me.

1. What is Debugging in SAP ABAP?

Answer:
Debugging is the process of analyzing and troubleshoo ng ABAP programs step by step using the ABAP
Debugger, to find errors in logic, data handling, or performance.

2. How do you start the Debugger in SAP?

Answer:

 Place a breakpoint in the program (/h in command field or via ABAP Editor).

 Execute the program → Debugger starts automa cally.

3. What are the different types of breakpoints in ABAP?

Answer:

 Sta c Breakpoint → Set in code with BREAK-POINT statement.

 Dynamic Breakpoint → Set at run me in the debugger or SE38 editor.

 External Breakpoint → Works for user sessions in SAP GUI, Web Dynpro, RFC, etc.

 Session Breakpoint → Valid for your current SAP session only.

4. What is the difference between BREAK and BREAK-POINT statements?

Answer:

 BREAK username → Triggers debugger only if that specific user runs the program.

 BREAK-POINT → Triggers debugger for anyone running the program.

5. What are the main features of the ABAP Debugger?

Answer:

 Step through code (F5 Single Step, F6 Execute, F7 Return, F8 Con nue).

 Watch variable values (Variable Fast Display).

 Change variable values at run me for tes ng.

 Analyze internal tables, work areas, field symbols, references.


 Debug background jobs and updates.

6. What is the difference between Classic Debugger and New Debugger?

Answer:

 Classic Debugger → Old version, runs inside same session.

 New Debugger → Default, runs in separate session with modern UI, more tools (system areas,
memory analysis).

7. How do you debug a background job?

Answer:

 Set a breakpoint in program.

 Use transac on SM37 → Select job → Menu → Job → Debugging.

8. Can you change variable values while debugging?

Answer:
Yes, in the New Debugger, you can modify values of variables and internal tables during run me (for
tes ng).

9. What is Watchpoint in Debugging?

Answer:
A Watchpoint stops program execu on when a specific variable or condi on changes value. Example: Stop
only when lv_count > 100.

10. What is the difference between Step In, Step Over, and Step Out?

Answer:

 Step In (F5) → Goes inside a subrou ne or method.

 Step Over (F6) → Executes the call but doesn’t go inside.

 Step Out (F7) → Exits current rou ne/method and returns.

11. How do you debug update func on modules?

Answer:
Set an update debug in SE37 or ac vate update debugging in the debugger.
12. What are common errors found during debugging?

 Unassigned field symbols

 Null references

 Incorrect loop logic

 Wrong SELECT statements (no data fetched)

 Performance issues in internal tables

You might also like