Thursday, December 5, 2013

SAP ABAP Interview Questions and Answers - 5

MODULARIZATION
1. Does every ABAP/4 have a modular structure?
Yes.
2. What is Modularization and its benefits?
If the program contains the same or similar blocks of statements or it is required to process the
same function several times, we can avoid redundancy by using modularization techniques. By
modularizing the ABAP/4 programs we make them easy to read and improve their structure.
Modularized programs are also easier to maintain and to update.
3. Name the ABAP/4 Modularization techniques.
• Source code module.
• Subroutines.
• Functions.
4. How can we create callable modules of program code within one ABAP/4 program?
• By defining Macros.
• By creating include programs in the library.
5. M is the attribute type of the module program.
6. Is it possible to pass data to and from include programs explicitly?
No. If it is required to pass data to and from modules it is required to use subroutines or function
modules.
7. What are subroutines?
Subroutines are program modules, which can be called from other ABAP/4 programs or within
the same program.
8. What are the types of Subroutines?
• Internal Subroutines: The source code of the internal subroutines will be in the same ABAP/4
program as the calling procedure (internal call).
• External Subroutines: The source code of the external subroutines will be in an ABAP/4
program other than the calling procedure.
9. It is not possible to create an ABAP/4 program, which contains only Subroutines (T/F).
False.
10. A subroutine can contain nested form and endform blocks. (T/F)
False.
11. Data can be passed between calling programs and the subroutines using Parameters.
12. What are the different types of parameters?
Formal Parameters: Parameters, which are defined during the definition of subroutine with the
FORM statement.
Actual Parameters: Parameters which are specified during the call of a subroutine with the
PERFORM statement.
13. How can one distinguish between different kinds of parameters?
• Input parameters are used to pass data to subroutines.
• Output parameters are used to pass data from subroutines.
14. What are the different methods of passing data?
• Calling by reference: During a subroutine call, only the address of the actual parameter is
transferred to the formal parameters. The formal parameter has no memory of its own, and we
work with the field of the calling program within the subroutine. If we change the formal
parameter, the field contents in the calling program also changes.
• Calling by value: During a subroutine call, the formal parameters are created as copies of the
actual parameters. The formal parameters have memory of their own. Changes to the formal
parameters have no effect on the actual parameters.
• Calling by value and result: During a subroutine call, the formal parameters are created as
copies of the actual parameters. The formal parameters have their own memory space. Changes
to the formal parameters are copied to the actual parameters at the end of the subroutine.
15. The method by which internal tables are passed is By Reference.
16. How can an internal table with Header line and one without header line be
distinguished when passed to a subroutine?
Itab[] is used in the form and endform if the internal table is passed with a header line.
17. What should be declared explicitly in the corresponding ABAP/4 Statements to access
internal tables without header lines & why?
Work Area. This is required as the Work Area is the interface for transferring data to and from
the table.
18. A subroutine can be terminated unconditionally using EXIT. (T/F)
True.
19. A subroutine can be terminated upon a condition using CHECK Statement.
20. Function Modules are also external Subroutines. (T/F).
True.

No comments:

Post a Comment