0% found this document useful (0 votes)
8 views

SAP ABAP - Interview Questions?

The document outlines best practices for writing efficient and maintainable SAP ABAP code, including modular coding, optimized database access, and effective error handling. It also covers various SAP ABAP concepts such as report types, BAPIs, OData services, and enhancements, providing detailed explanations and differences between them. Additionally, it addresses performance improvement techniques and tools for debugging and transporting OData services.

Uploaded by

himanshusudra09
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

SAP ABAP - Interview Questions?

The document outlines best practices for writing efficient and maintainable SAP ABAP code, including modular coding, optimized database access, and effective error handling. It also covers various SAP ABAP concepts such as report types, BAPIs, OData services, and enhancements, providing detailed explanations and differences between them. Additionally, it addresses performance improvement techniques and tools for debugging and transporting OData services.

Uploaded by

himanshusudra09
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SAP ABAP – MOST ASKED

INTERVIEW QUESTIONS
1. What are some best practices for writing efficient, maintainable, and scalable code in
SAP ABAP?

Answer:

Adhering to best practices in SAP ABAP development ensures that your code remains robust,
maintainable, and performs optimally. Here are key guidelines:

• Follow Standard Naming Conventions:

Use clear, descriptive, and consistent naming conventions for variables, classes, methods, and
other identifiers. This improves code readability and eases future maintenance.

• Modular and Reusable Code:

Break your code into modular components using function modules, methods, or classes. This
follows the DRY (Don’t Repeat Yourself) principle and allows code reuse across different
projects.

• Optimize Database Access:

• Avoid using SELECT * queries. Instead, specify only the fields you need.

• Prevent SELECT statements inside loops to minimize database calls.

• Use proper joins and indexes to enhance performance when retrieving data.

• Leverage Object-Oriented Programming:

Utilize ABAP Objects for new developments. Object-oriented design improves


encapsulation, abstraction, and reusability, making it easier to manage complex business
logic.

• Effective Error Handling and Logging:

Implement robust error handling (using exception classes, messages, or custom error
handlers) and log important events. This aids in diagnosing issues quickly and ensures
smoother runtime behavior.

• Code Documentation and Comments:


Write clear inline comments and maintain external documentation. Explain complex logic or
unusual implementations so that others (or you, in the future) can understand the reasoning
behind the code.

• Performance Analysis:

Use SAP tools like SAT, ST05, or Code Inspector to analyze and optimize performance.
Refactor code sections identified as bottlenecks to ensure efficient execution.

• Adopt SAP Enhancement Frameworks:

Instead of modifying standard code, use SAP’s enhancement frameworks (user exits, BADIs,
enhancement spots) to implement custom logic. This minimizes upgrade risks and maintains
system integrity.

• Version Control and Code Reviews:

Use version control systems for tracking changes and ensure regular peer code reviews. This
helps in early detection of issues and enforces adherence to coding standards.

Implementing these practices not only improves the quality and maintainability of your code
but also contributes to overall system performance and long-term project success.

2. What are the types of Reports in SAP ABAP?

Answer:

• Classical Reports: Simple output using WRITE statements.

• Interactive Reports: Drill-down reports allowing user interaction.

• ALV Reports: Advanced reports using the ABAP List Viewer (ALV) with features like
sorting, filtering, and exporting.

3. Explain the ALV report types and their differences.

Answer:

• ALV Grid (CL_GUI_ALV_GRID): Provides advanced UI features.

• ALV List (REUSE_ALV_LIST_DISPLAY): Simple list output with basic functionalities.

• ALV Hierarchical (REUSE_ALV_HIERSEQ_LIST_DISPLAY): Used for displaying


hierarchical data.
4. What is the difference between BDC and LSMW?

Answer:

• BDC (Batch Data Communication):

• Requires custom ABAP programs.

• Supports both Session and Call Transaction methods.

• LSMW (Legacy System Migration Workbench):

• Predefined tool with minimal coding.

• Supports multiple methods like BAPI, Direct Input, and IDocs.

5. What are the different types of BAPIs?

Answer:

• Standard BAPIs: Delivered by SAP for common operations.

• Custom BAPIs: Created for specific business requirements.

• Transaction BAPIs: Perform commit/rollback.

• Query BAPIs: Fetch data without modifying it.

6. Explain the difference between User Exits, BADI, and Enhancement Spots.

Answer:

• User Exits: Old, function module-based, limited.

• BADIs (Business Add-Ins): Object-oriented, more flexible.

• Enhancement Spots: Modern framework, uses implicit/explicit enhancement points.


7. What is an OData service in SAP ABAP?

Answer:

OData (Open Data Protocol) is a REST-based protocol for creating and consuming SAP data.
It supports CRUD operations and works via HTTP/S with JSON or XML.

8. How do you create an OData service in SAP?

Answer:

1. Go to SEGW (Gateway Service Builder).

2. Create a new project.

3. Define the Entity Types and Sets.

4. Implement CRUD methods in the DPC_EXT class.

5. Register and activate the service in /IWFND/MAINT_SERVICE.

9. What is a CDS view and how is it different from a normal SAP view?

Answer:

• CDS View:

• Advanced, optimized for SAP HANA.

• Supports annotations and better performance.

• Used for analytical and transactional data.

• SAP View: Traditional database view with basic functionality.

10. Explain the types of Enhancements in SAP.

Answer:

• Implicit Enhancements: SAP-provided enhancement points.

• Explicit Enhancements: Custom enhancement points added by SAP.

• BADI: Object-oriented enhancements.


• User Exits: Function module-based.

• Field Exits: Validate specific screen fields.

11. What is an SAP Proxy and how is it used?

Answer:

SAP Proxy interfaces enable synchronous and asynchronous communication between SAP
and external systems. They use SOA Manager for configuration.

12. How do you handle errors in BDC?

Answer:

• Use BDCMSGCOLL structure for error messages.

• Log and analyze session data in transaction SM35.

13. Explain the difference between Smart Forms and Adobe Forms.

Answer:

• Smart Forms: SAP GUI-based, easier scripting.

• Adobe Forms: More flexible, supports interactive forms, PDF-based.

14. What is the use of the FM ‘REUSE_ALV_GRID_DISPLAY’?

Answer: Displays ALV report with grid functionality like sorting, filtering, and exporting.

15. Explain the importance of OData $expand and $filter.

Answer:

• $expand: Fetches related entity sets.

• $filter: Applies conditions on entity data retrieval.


16. How do you debug an OData service?

Answer:

• Set a breakpoint in DPC_EXT methods.

• Use /IWFND/TRACES for tracing OData calls.

17. What is SAP RAP and how is it related to OData?

Answer:

SAP RAP (RESTful Application Programming) is used to build OData-based Fiori apps
using ABAP on SAP BTP or S/4 HANA.

18. Explain PAI and PBO in SAP module pools.

Answer:

• PBO (Process Before Output): Prepares screen data.

• PAI (Process After Input): Handles user actions.

19. What are the different types of internal tables in ABAP?

Answer:

• Standard Table: Linear search, non-unique keys.

• Sorted Table: Binary search, sorted keys.

• Hashed Table: Unique keys, fast access.

20. Explain the use of SAP WRAP in OData services.

Answer:

SAP WRAP simplifies RAP implementation for building transactional OData services with
less coding.
21. What is the use of $metadata in OData?

Answer: Fetches the service definition and structure.

22. How do you call an OData service from SAP ABAP?

Answer: Use CL_HTTP_CLIENT or /IWFND/CLIENT for testing.

23. What is a Secondary Index in SAP?

Answer: An additional index to improve SELECT query performance.

24. How do you create a CDS view with parameters?

Answer: Use the @parameters annotation in the CDS definition.

25. Explain the difference between SAP BTP and SAP Gateway.

Answer:

• SAP BTP: Cloud platform for development and integration.

• SAP Gateway: Middleware for OData service creation.

26. What are the types of joins in CDS views?

Answer:

• Inner Join

• Left Outer Join

• Association (Preferred)
27. Explain the $batch operation in OData.

Answer: Processes multiple operations in a single HTTP request.

28. How do you transport an OData service?

Answer: Include SEGW project in a transport request and move it to the target system.

29. What is the difference between GET_ENTITY and GET_ENTITYSET in OData?

Answer:

• GET_ENTITY: Fetches a single record.

• GET_ENTITYSET: Fetches multiple records.

30. How do you improve performance in an ABAP report?

Answer:

• Use CDS views and AMDP.

• Avoid SELECT inside loops.

• Use JOINs and FOR ALL ENTRIES efficiently.

You might also like