Wednesday, May 14, 2008

IBM abap interview Questions phase - d

How do you limit the data retrieved by a SELECT statement?

Ans :- WHERE clause.

Where and where do you use a goto command?

Ans :- NEVER.

Are the following logical expressions true or false?

T a) value1 LT value3

T b) value3 > value1

T c) value2 between value1 and value 3

F d) value2 LE value1

T e) value3 <> value1

F f) value3 CS '+5'

T g) value2 CA '0A9GB'

**NOTE wildcards +,*, # only work with CP

What is the output of the following:

Given TABA:

Country City

A NewYorkNews

A Johannesville

A MartinMarietta

A Rockville

B Littleton

B Sr.Charles

Ans :- PROGRAM Program

TABLES: TABA.

SELECT * FROM TABA.
ON CHANGE OF TABA-COUNTRY.

WRITE: /TABA-COUNTRY, TABA_CITY.

ENDON.

ENDSELECT.

B Littleton.

What do CHECK, EXITS do in a program?

- CHECK terminates the current loop or subroutine if logical expression is not fulfilled;Outside of a loop structure , subsequent statements in the current processing block are not executed (Syntax CHECK FLAG NE SPACE)

- EXIT-terminates the current loop or subroutine; outside of a loop structure, subsequent statements in the current processing block are not executed.

What is the difference between a field string and an internal table?

Ans :- The declaration of an internal table includes an OCCURS parameter

(the number of entries in the main storage roll area)

field string-corresponds to one record

internal table-corresponds to many records

T or F: Move corresponding is an effective way to move fields with like names from a DB table record to an internal table header line?

Ans :- T.

T or F: An append will add a record to a database table?

Ans :- (F).You can only append to an internal table.

What is the effect of an include structure statement?

Ans :- Allows you to quickly declare field strings and /or internal tables that are similar in structure to R/3 Repository Tables defined in the Data Dictionary.

T or F:The COLLECT statement will total up all P,I,F fields in database table

Ans :- If non-numeric entries in the header line match those in the internal table, COLLECT will add all numeric entries in the internal table header line to table entries where match was found. When no match is found the contents of the header line is added to the end of the table as a new line.

T or F: The SELECT statement allows the processing in internal table.

Ans :- (F).Use the LOOP AT … ENDLOOP instead.

T or F: The LOOP at command allows you to use the where clause.

Ans :- (T). If there is no table entry satisfying the 'where' logical expression ,the loop cannot be executed and the system field SY_SUBRC is set to a value not equal to zero .In any case the entire table is read.

T or F: The read table command using the key clause is similar to the select single.

Ans :- (T). Yes in that they both return only one entry from table But the READ is associated with an internal table and SELECT is associated with a database table.

How does the READ with KEY statement work?

Ans :- READ TABLE WITH KEY <'string' or FIELD-NAME>

The search argument is compared character by character with the start of the 'tab' internal table lines and returns one entry that matches

What field within the SY table contains the table index/

Ans :- The SY_TABIX system field holds the index value of the table line which has been placed in the header line of an internal table.

T or F: An internal table can be deleted, modified, or inserted without the use of an index?

Ans :- (T).Within a LOOP you can make changes to an internal table. The line affected is always the current line. If you don’t use the LOOP command an index must be used to change and internal table.

What does the CLEAR and REFRESH commands do?

Ans :- CLEAR : Initializes the header line

REFRESH : Deletes all table lines .Paging is released does not clear the header

FREE : Deletes all table lines ,Memory is released does not clear the header

**CLEAR and REFRESH are typically used together.

Why would you use describe table command?

Ans :- To gather information about an internal table (i.e. OCCURS value ,LINES existing table entries).

What are the subroutines used for?

Ans :- Subroutines are used in two different ways;

1) Subroutines and its call are in the same ABAP/4 program(internal call )

2) The subroutine is an external program.

When should you use an include versus a perform versus a function module?

Ans :- All are modularization techniques but typically the INCLUDE is for data structures, the PERFORM is for ABAP/4 subroutines and function modules are for non-ABAP/4 subroutines.

What is the difference between internal and external calls?

Ans :- INTERNAL-within program.

EXTERNAL-outside program.

Explain pass by value, reference and changing value?

Ans :- By Value:When the subroutine is called ,the formal parameters are copies of the actual parameters(with their own storage location)

By Value and Result : the formal parameters have a separate storage location .At the end of subroutine the value of the formal parameter is passed to the storage location of the actual parameter

Assigned

By Reference: when called the formal parameters are not allocated separate storage locations. Instead the address of the actual parameter is passed. Changes to the values of the formal parameters therefore have a direct effect on the assigned main program fields.

What is the syntax of perform, include and function modules?

Perform:

PERFORM USING

FORM [TABLES

] USING VALUE () CHANGING VALUE ()

Include:

INCLUDE

Function modules:

CALL FUNCTION ‘function name’

EXPORTING …

IMPORTING …

1 comment:

kumar said...

WHAT ARE THE QUESTIONS ASKED BY THE CLIENT OR INTERNAL INTERVIEW FOR SELECTING ABAPER IN THE PROJECT IN IBM OR MNC COMPANIES.

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

goodsites