Saturday, April 21, 2012

SAP Internal Table Questions for Interviews

Dear ABAPers, This post gives the list of Interview questions on SAP ABAP. The list includes the real time interview questions asked by the top MNC companies in their interviews. For more details refer this post. SAP Interview Questions 12.






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. 

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.

A subroutine can be terminated unconditionally using EXIT. (T/F)
True. 

A subroutine can be terminated upon a condition using CHECK Statement.
  
Function Modules are also external Subroutines. (T/F).
      True. 


What is the difference between the function module and a normal ABAP/4 subroutine?

In contrast to normal subroutines function modules have uniquely defined interface.  

Declaring data as common parts is not possible for function modules.  Function modules are stored in a central library. 


What is a function group?

A function group is a collection of logically related modules that share global data with each other.  All the modules in the group are included in the same main program.  When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at runtime.  Every function module belongs to a function group. 


What is the disadvantage of a call by reference?

During a call by reference damage or loss of data is not restricted to the subroutine, but will instantly lead to changes to the original data objects. 

A function module can be called from a transaction screen outside an ABAP/4 program. (T/F).
True. 


What is an update task?

It is an SAP provided procedure for updating a database. 


What happens if a function module runs in an update task?

The system performs the module processing asynchronously.  Instead of carrying out the call immediately, the system waits until the next database update is triggered with the ‘COMMIT WORK’ command. 

The function modules are created and stored in the Function Library.


When a function module is activated syntax checking is performed automatically. (Y/N)
True. 


What is the use of the RAISING exception?

The raising exception determines whether the calling program will handle the exception itself or leave the exception to the system. 


What is the difference between internal tables and extract datasets?

·The lines of an internal table always have the same structure. By using extract datasets, you can handle groups of data with different structure and get statistical figures from the grouped data.

·You have to define the structure of the internal table at the beginning. You need not define the structure of the extract dataset.

· In contrast to internal tables, the system partly compresses exact datasets when storing them. This reduces the storage space required.

·Internal tables require special work area for interface whereas extract datasets do not need a special work area for interface. 


It is possible to assign a local data object defined in a subroutine or function module to a field group. (T/F).
False.


What is the difference between field-group header and other field groups?


The header field group is a special field group for the sort criteria.  
The system automatically prefixes any other field groups with the header field group.

Can a filed occur in several field groups.
Yes.  But it leads to unnecessary data redundancy.


When sorting the extract dataset the fields used as default sort key lie in the Header field group.

What does the insert statement in extract datasets do?
      It defines the fields of a field group.


What does the extract statement do in extract datasets?

The data is written to virtual memory by extract commands.

A field-groups statement or an insert statement reverses storage space and transfers values. (T/F).
False.


While using extract datasets it is required to have a special workarea for interface (T/F)
False.


The LOOP-ENDLOOP on extract datasets can be used without any kind of errors (T/F)
False.  It causes runtime errors.


The Maximum no of key fields that can be used in a header is 50.

While sorting field groups we cannot use more than one key field (T/F).
False.


While sorting, if the main storage available is not enough, the system writes data to an external help file.  The SAP profile parameter, which determines this help file, is DIR_SORTTMP.


43.  The extract statements in field groups can be used before or after processing the sort statements. (T/F)
       FALSE.


REPORT GENERATION – FORMATTING


The alignment of a type ‘c’ field in a report is left Aligned.

In the statement
Write:/15(10) Ofal-lifnr. what do the number 15 and 10 stand for
      15 stand for the offset on the screen and 10 stands for the field length displayed.


3.      Specify the default alignment for the following field types:
‘D’ – Left, ‘F’-Right, ‘N’-Left, ‘I’-Right, ‘T’-Left.


If  s_time has the value ‘123456’ how would you get an output of 12:34:56 with a single ‘Write:’ statement.
Write:s_time using edit mask’--:--:--‘.


In order to suppress the leading zeroes of a number field the keywords used are NO-ZERO.
The total no of date formats that can be used to display a date during output is MM/DD/YY, DD/MM/YY, DD/MM/YYYY, MM/DD/YYYY, MMDDYY, DDMMYY, YYMMDD.


The UNDER Command allows for vertical alignment of fields one below the other.


In order to concatenate strings only for output purposes the command NO-GAP can be used in conjunction with the ‘Write’ statement.


The no of decimal places for output can be defines within a write statement. (T/F).
TRUE.  Write:/<F> decimals 2.


Data can be moved from one field to another using a ‘Write:’ Statement and stored in the desired format. (T/F).

TRUE. Write: Date_1 to Date_2 format DD/MM/YY.

In the statement Write:/15(10) lfa1-lifnr. The values 15 and 11 can also be defined by variables (T/F). False.

Differentiate between the following two statements if any.
ULINE.
Write: sy-uline.
No-difference.  Except that uline is used outside the ‘Write’ Statement.


In order to skip a single line the number of lines need not be given as an assignment (T/F)
TRUE.


The “SKIP TO LINE line number” is dependent on the LINE-COUNT  statement included in the report statement of the program.
In order to skip columns the command used is POSITION <n>.
In order to have boldfaced text as output the command used is Write:<f>INTENSIFIED.


Background and foreground colors can be interchanged using the command Format Inverse.
In order to restore the system defaults for all changes made with the format statement is Format Reset.



 Like ULINE the statement VLINE is used to insert vertical lines. (T/F).
False.


20. Suppressing the number signs (+/-) is carried out using the addition NO-SIGNS to the Write statement. (T/F).    False.


If SY-UZEIT has the value 6:34:45 it can be displayed as 063445 using No Edit Mask.


If the variable “Text” has the value ‘ABCDEF’ the output for the statement “Write:/Text+2(3)” will be “CDE”


The fields specified by select-options and parameters statement cannot be grouped together in the selection screen. (T/F).  False.


When calling an external report the parameters or select-options specified in the external report cannot be called. (T/F)
FALSE.


Selection Texts  in the text elements of the program helps in changing the displayed names of variables in the parameters statement.


 Type F  datatype cannot be used to define parameters.

27. Rounding off of values can be carried out using the write statement. (T/F). TRUE


How would you define the exponents for a type ‘f’ field?
Exponent <e>.


How would you format the output as left, centered or right-justified using the write statement.
Left-justified, Centered, Right-justified.


If the same formatting options were used for a WRITE statement that follows the FORMAT statement, which settings would take precedence.



The settings in the Write Statement.


For each new event, the system resets all formatting options to their default values (T/F)
TRUE.


All formatting options have the default value OFF. (T/F).
TRUE.


How would you set the formatting options statically and dynamically within a report? Statically: FORMAT <option1>[ON|OFF]….

Dynamically: FORMAT <option1> = <var1><option2>=<var2>….

The page footer is defined using the statement END-OF-PAGE.

The processing block following END-OF-PAGE is processed only if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement. (T/F)
TRUE.

To execute a page break under the condition that less than a certain number of lines is left on a page is achieved by RESERVE n lines.

The RESERVE statement only takes effect if output is written to the subsequent page.  No blank pages are created and it defines a block of lines that must be output as a whole. (T/F). TRUE.
To set the next output line to the first line of a block of lines defined with the RESERVE statement the statement BACK  is used.


What is the limit for the length of a page if the page length is not specified in the report statement. 60,000 lines.


How would you start the printing process from within the program while creating a list?
NEW-PAGE PRINT ON.


You can change the width of pages within list levels triggered by page breaks. (T/F).
FALSE.


Hotspots are special areas of an output list used to trigger events. (T/F) TRUE.


To designate fields as hotspots at runtime, use FORMAT HOTSPOT = <h>.
Horizontal lines created with ULINE and blank lines created with SKIP can be formatted as hotspots. (T/F). FALSE.


How would you suppress the display of a parameter on the selection screen?
Parameters <p> ………..No-Display.


Can you assign a matchcode object to a parameter? If so how?
Yes.  PARAMETERS <p>……..MATCHCODE OBJECT <obj>……..
For each SELECT-OPTIONS statement, the system creates a selection table. (T/F)
TRUE.


To position a set of parameters or comments on a single line on the selection screen, you must declare the elements in a block enclosed by
SELECTION-SCREEN BEGIN OF LINE.
……..
SELECTION-SCREEN END OF LINE.


How can Symbols or R/3 icons be output on the screen?
     WRITE <symbol-name>AS SYMBOL.
     WRITE <icon-name> AS ICON.


In the standard setting, you cannot create empty lines with the WRITE statement alone. (T/F).  TRUE.


REPORTING – GENERAL


The system field, which indicates success or failure of a SQL operation, is SY-SUBRC.


What is the syntax for specifying database table name at runtime in SELECT statement.
NAME = ‘SPFL1’.
SELECT * FROM (NAME).
……………….
……………….
ENDSELECT.



How do you read selected lines of database table into an internal table in packages of predefined size.

SELECT * FROM <SPFLI>INTO TABLE <ITAB>PACKAGE SIZE<N>.
Where n is variable.


Name the WILDCARD characters which are used for comparisons with character strings & numeric strings. ‘%’ and ‘-‘.


In SELECT statements can you specify a variable in WHERE condition or a part of the condition, if so what is the syntax.


SELECT * FROM <table>WHERE <var1><condition><var or const>.
Name the ABAP/4 key words, which are used to change the contents of database table.
UPDATE or MODIFY.


7. How to specify a client for database table processing.
TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED WHERE MANDT BETWEEN ‘001’ AND ‘003’.
……..
ENDSELECT.


How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the same from memory to program.

EXPORT <f1>[FROM <g1>]<f2>[FROM <g2>]…. TO MEMORY ID <key>.
The ID <key>, which can be up to 32 characters long, identifies the data in memory.


What are DATA CLUSTERS?
You can group any complex internal data objects of an ABAP/4 program together in data clusters and store them temporarily in ABAP/4 memory or for longer periods in databases.  You can store data clusters in special databases of the ABAP/4 Dictionary.  These databases are known as ABAP/4 cluster databases and have a predefined structure.  Storing a data cluster is specific to ABAP/4.  Although you can also access cluster databases using SQL statements, only ABAP/4 statements are able to decode the structure of the stored data cluster.




Statements used to delete data objects in ABAP/4 memory FREE MEMORY [ID <key>].
How will you create a file on application server.
Open dataset <dsn> for output.

ABAP/4 statement for opening a file on application server for reading Open dataset <dsn> for input.


How will you transfer data into a file in application server?
Data fname(60) value ‘mYFILE’.
Data num type i.
Open dataset fname for output.
Do 10 times.
  Num = Num +1.
  Transfer num to fname.
Enddo.
       …….etc.


Name the function modules to write data from an Internal Table to the Presentation Server.
DOWNLOAD and WS_DOWNLOAD.

Name the function module that can be used to give information about files on Presentation Server and about its Operating System.
WS_QUERY.


Name the ABAP/4 key word, which is used to clear the Headerline of an Internal Table.
CLEAR<itab>.


Name the function modules to read data from Presentation Server into an Internal Table.
UPLOAD and WS_UPLOAD.


Name the ABAP/4 keywords to initialize an Internal Table with and without headerline.
REFRESH <itab>.


How to determine the attributes of an internal table?
DESCRIBE TABLE <itab>[LINES <lin>] [OCCURS <occ>].


Name the ABAP/4 key word for searching a string in an Internal Table.
SEARCH <itab> FOR <str><options>.


The different options (<options>) for the search in an internal table are:

ABBREVIATED

Searches table<itab>for a word containing the character string specified in <str>, where other characters might separate the characters. The first letter of the word and the string <str> must be the same.


STARTING AT<lin1>

Searches table<itab> for <str>, starting at line <line1>. <\lin1> can be a variable.

ENDING AT<n2>

Searches table <itab>for <str>upto line<lin2>. <lin2>can be a variable.


AND MARK

If the search string is found, all the characters in the search string (and all the characters in between when using ABBREVIATED) are converted to upper case. 


What are the different attributes that can be assigned to a variant?
The different attributes that can be assigned to a variant are….

Description
Enter a short, meaningful description of the variant.  This may be upto 30 characters long.
Background only
Specify whether you want to use the variant in background processing only, or in online environment as well.
Protected variant.
Mark the field if you want to protect your variant against being changed by other users.
Do not display variant.
Mark this field if you want the variant name to be displayed in the catalog only, but not in the F4 value list. 
For the selections you cover in a variant, you can enter the following attributes:
Type
The system displays whether the field is a parameter or a select option.
Protected
Mark this field for each field on the selection screen you want to protect from being overwritten.  Values that you mark this way are displayed to the users, but they cannot change them, that are they are not ready to accept input.
Invisible
If you mark this column, the system will not display the corresponding field on the selection screen the user sees when starting the report program.
Variable
Mark this column if you want to set the value for this field at runtime. 


Is it possible to create new dynamic programs during runtime of an ABAP/4 program? If so how?
To create new dynamic programs during the runtime of an ABAP/4 program, you must use an internal table.  For this purpose, you should create this internal table with one character type column and a line width of 72.  You can use any method you like from Filling Internal Tables to write the code of your new program into the internal table.  Especially, you can use internal fields in which contents are dependent on the flow of the program that you use to create a new one, to influence the coding of the new program dynamically.  The following example shows how to proceed in principal:
DATA CODE (72) OCCURS 10.
APPEND ‘REPORT ZDYN1.’
TO CODE.
APPEND ‘WRITE/”Hello, I am dynamically created!”.’
TO CODE.

Two lines of a very simple program are written into the internal table CODE. 
In the next step you have to put the new module, in the above example it is a report, into the library.  For this purpose you can use the following statement: 

Syntax 
INSERT REPORT <prog>FROM <itab>. 
The program <prog> is inserted in your present development class in the R/3 Repository. 

If a program with this name does not already exists, it is newly created with the following attributes:

Title: none,
Type: 1 (Reporting),
Application: S (Basis).
You can specify the name of the program <prog> explicitly within single quotation marks or you can write the name of a character field, which contains the program name.  The name of the program must not necessarily be the same as given in the coding, but it is recommended to do so.  <itab> is the internal table containing the source code.  For the above example you could write:
INSERT REPORT ‘ZDYN1’ FROM CODE.
Or
DATA REP (8).
REP = ‘ZDYN1’
INSERT REPORT REP FROM CODE. 


Data types can be elementary or structured (T/F).
TRUE.

The amount of memory associated with a data type is ZERO.


Data objects are the physical units a program uses at runtime. (T/F).
TRUE.


The data object does not occupy any space in memory. (T/F)
FALSE.


What are the three hierarchical levels of data types and objects?


Program-independent data, defined in the ABAP/4 Dictionary.


Internal data used globally in one program.


Data used locally in a procedure (subroutine, function module) 


How would you find the attributes of a data type or data object?


DESCRIBE FIELD <f> [LENGTH <l.] [TYPE <t> [COMPONENTS <n>]]
             [OUTPUT-LENGTH <o>] [DECIMALS <d>]
             [EDIT MASK <m>].


The components of a field string cannot have different data types. (T/F).
FALSE.


Field strings are also called as Record or Structures.

If a field string is aligned (Left, centered, right justified etc.), the filler fields are also added to the length of the type C field. (T/F).
TRUE.


You cannot assign a local data object defined in a subroutine or function module to a field group. (T/F)
TRUE.


Field group reserves storage space for the fields, and does not contain pointers to existing fields (T/F).
False.


Defining a field group as ‘HEADER’ is optional (T/F)
FALSE.


How would you define a field symbol?
FIELD-SYMBOLS<FS>.


Which function module would you use to check the user’s authorization to access files before opening a file?
AUTHORITY_CHECK_DATASET


37.  Name the function module used to convert logical file names to physical file names in ABAP/4 programs.
FILE_GET_NAME.


Parameters, which are defined during the definition of a subroutine with the FORM statement, are called Formal Parameters.


Parameters which are specified during the call of a subroutine with the PERFORM statement are called Actual Parameters.


In subroutines internal tables that are passed by TABLES, are always called by value and result. (T/F)

FALSE.  They are called by reference.


For More Real Time Interview Questions See Below Posts













"You found the information helpful and want to say thanks? Your donation is enough to inspire us to do more. Thanks a bunch!"

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Categories

ABAP (1) ABAP Interview Questions (112) ABAP Open SQL Statements (1) ABAP Syntax Rules (6) ABAP WORKBENCH (2) ABAP-Interview-Questions (52) ALE IDOC (6) ALE IDOC Interview Questions (6) ale-idoc (6) ALE-IDOC-Interview-Questions (19) ALV Interview Questions (5) ALV-Interview-Questions (22) BADI (2) BAPI (1) BAPI Interview Questions (1) BAPI-Interview-Questions (14) BDC (6) BDC Interview Questions (6) BDC-Interview-Questions (9) big data (2) big data interview questions (1) Classical Reports Interview Question (3) Classical-Reports-Interview-Questions (22) Conditional Statements (1) Cross Applications (3) Cross-Applications (14) Data Dictionary (22) Data Type Questins (1) Data types (1) Data-Dictionary (48) Data-Type-Questins (6) Dialog programming (5) Dialog Programming Interview Questions (4) Dialog-Programming (30) DOMAIN Interview Questions (1) Domain-Interview-Questions (8) Function Module (2) hadoop (2) hadoop interview questions (2) hdfs (1) IDoc Tutorials (6) Interactive Report Interview Questions (4) Interactive-Reports-Interview-Questions (22) Internal Tables (1) interview questions (1) Lock Object Interview Questions (1) Lock-Objects-Interview-Questions (10) Logical Database (1) Modularization Interview Questions (4) Modularization-Interview-Questions (25) Module Pool Programming (5) Module-Pool-Programming (39) modules in sap (1) Object Oriented ABAP (19) Object Oriented ABAP Interview Questions (15) object-oriented-abap (2) Object-Oriented-ABAP-Interview-Questions (34) OOABAP (9) Reports (14) Reports Interview Questions (9) Reports-Interview-Questions (19) RFC (1) RFC Interview Questions (1) RFC-Interview-Questions (14) RICEF (1) RICEF Objects (1) SAP (4) SAP ABAP (4) SAP ABAP Interview Questions (42) SAP ABAP Introduction (46) SAP ABAP Message Types (2) SAP BADI Interview Questions (2) SAP Basics (71) SAP Books (2) SAP Certification (1) SAP CONSULTANTS (5) SAP CRM (1) SAP ENHANCEMENTS (3) SAP EXITS (2) SAP EXITS ( SAP ENHANCEMENTS ) Interview Questions (1) SAP Free Books (1) SAP HR (2) SAP Lock Object (1) sap modules (2) SAP Open SQL Statements (1) SAP R/3 Architecture (4) SAP Search help (1) SAP Smartforms (1) SAP Smartforms Interview Questions (2) SAP Tables (5) SAP Tcodes (10) SAP Views (1) SAP Webdynpro ABAP (12) SAP Work Processors (2) SAP Workflow (3) SAP-BADI-Interview-Questions (11) SAP-Enhancements (39) SAP-Exits (39) SAP-Exits-Enhancements-Interview Questions (3) SAP-HANA (1) SAP-HANA-Interview-Questions (1) SAP-Smartforms-Interview-Questions (2) SAP-Workflow (3) Scripts (3) Scripts Interview Questions (2) Scripts-Interview-Questions (32) Search Help Interview Questions (1) Search-Help-Interview-Questions (9) Smartforms (1) Table Maintenance Generator (1) Table-Maintenance-Generator (4) Tables in SAP (2) Tables Interview Questions (3) Tables-Interview-Questions (3) Type Group Interview Questions (1) Type-Group-Interview-Questions (7) Variable Declaration (1) Views Interview Questions (1) Views-Interview-Questions (5) Webdynpro (12) what is big data (1)

Protected Blog

 
This blog is not affiliated to SAP AG |SAP is trademark of SAP AG |The information collected from various sources use information with your own risk.