0% found this document useful (0 votes)
145 views5 pages

Test 1

This document contains questions and code snippets related to ABAP programming. It covers topics like field symbols, internal tables, data types, control statements, and more. The questions are divided into three sections: Section I contains 10 multiple choice questions related to code output, Section II contains 15 questions asking to explain concepts and write pseudo code, Section III contains 4 long answer questions covering a variety of ABAP topics.

Uploaded by

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

Test 1

This document contains questions and code snippets related to ABAP programming. It covers topics like field symbols, internal tables, data types, control statements, and more. The questions are divided into three sections: Section I contains 10 multiple choice questions related to code output, Section II contains 15 questions asking to explain concepts and write pseudo code, Section III contains 4 long answer questions covering a variety of ABAP topics.

Uploaded by

Kishore Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ABAP I

60Marks

Section-I 10*1 = 10M


Write the Output for the following:
1. DATA: lv_data TYPE string VALUE 'ABC'.
FIELD-SYMBOLS: <lv_val> TYPE STRING.
ASSIGN lv_data TO <lv_val>.
CLEAR <lv_val>.
WRITE: <lv_val>.
WRITE: / lv_data.

2. Data: lv_i type i.


Do 10 times.
Lv_i = sy-index.
Write: / lv_i.
CHECK sy-index GT 5
EXIT.
ENDDO.
WRITE: / Program Completed.
3. DATA LV_NAME(12) VALUE 'JACKJOHNCARL'.
Write pseudo code to get output as JOHNCARL using field symbols.

4. DATA: v_data TYPE string VALUE 'SAP FUNCTIONAL'.


FIELD-SYMBOLS: <fs_val> TYPE STRING.
IF <fs_val> IS ASSIGNED.
<fs_val> = 'Assigned'.
ELSE.
ASSIGN v_data to <fs_val>.
ENDIF.
WRITE: <fs_val>.

5. Data lv_dat type d value '20140711'.


Lv_dat = sy-datum.
write /(10) lv_dat using EDIT MASK '__/____/__'.
6. data lv_time type sy-uzeit.
lv_time = sy-uzeit.
write : lv_time+0(2),lv_time+2(2),lv_time+4(2).

7. Data: lv_s(8) value 'abcdefgh',


lv_t(8) value '12345678',
lv_off1 type i,
lv_off2 type i,
lv_len1 type i,
lv_len2 type i.
lv_off1 = 2. lv_len1 = 3.
lv_off2 = 4. lv_len2 = 3.
move lv_s+ lv_off1(lv_len1) to lv_t+ lv_off2(lv_len2).
write / lv_t.
8. DATA: LV_STRING(80) value 'Variable: &. The variable & is substituted later.'.
Write a pseudo code to replace all the occurrences of & with X without using
replace statement.
9. We have a string lv_str with both lower case and upper case characters. Write
an ABAP statement to change the case of all letter. (Ouput : fEdABc)
Data: lv_str TYPE string.
Lv_str = FeDabC.
<WRITE YOUR STATEMENT HERE>
WRITE: lv_str.
10. Data lv_test(40).
lv_test = 'Customer's Name'.
write lv_test.

Section-II 15*2 = 30M


1. What is the difference between SY-SUBRC, SY_INDEX and SY-TABIX?
2. What is data element and domain? Explain what is a foreign key relationship
and its prerequisites to establish foreign key.
3. What is the difference between a value table and a check table?
4. What is hashed table, its purpose?
5. What is the difference between .Include Structure and .Append structure?

6. What is the Difference between Collect and Sum?


7. What are data references? Explain with a brief example.
8. What is the best way of modifying records in the internal tables, write
the pseudo code?

Write the Outputs for the following.

9. data: begin of gt_icode occurs 0,


field1(5),
field2(5),
end of gt_icode.
the internal table gt_icode contains the following entries:
field1 field2
------- -----John 12345
alice 23478
sam 54321
john 50000
Write a pseudo code to search for word John and display as output.
10.
FIELD-SYMBOLS: <lv_val> TYPE string.
ASSIGN ABC TO <lv_val>.
WRITE <lv_val>.
11.

types: begin of S_test,


f1 type c,
end of S_test.
data: gt_test type standard table of S_test,
gwa_test type gt_test.
insert initial line into gt_test index 1.
append 'x' to gt_test.
append initial line to gt_test.
append 'x' to gt_test.
insert initial line into gt_test index 1.
append 'x' to gt_test.
append initial line to gt_test.
append 'x' to gt_test.
delete adjacent duplicates from gt_test.
describe table gt_test.
write sy-tfill.

12.

data: lv_name(10) value '1234567890'.


do 9 times.
write: / lv_name+sy-tabix(sy-index).
enddo.

13.

data : begin of t_ line,


col1 type i value '11',
col2 type i value '22',
col3 type i value '33',
end of t_line.
field-symbols : <fs1> type any,
<fs2> type any,
<fs3> type any.
data : lv_comp type char4 value 'COL3'.
assign t_line to <fs1>.
assign lv_comp to <fs2>.
do 3 times.
assign component sy-index of structure <fs1> to <fs3>.
write :/ <fs3>.
enddo.
assign component <fs2> of structure <fs1> to <fs3>.
write :/ <fs3>.

14.

data: begin of t_record,


cola type i,
colb type i,
end of t_record.
data gt_table like hashed table of record with unique key cola.

do 4 times.
t_record-cola = sy-index.
t_record-colb = sy-index ** 3.
insert t_record into table gt_table.
enddo.
t_ record-cola = 3.
t_record-colb = 64.
read table gt_table into record index 3 comparing colb.
write:/ 'sy-subrc = ', sy-subrc.
skip.
write:/ 'record-cola:', t_record-cola, /'record-colb:', t_record-colb.
15.

Explain differences between Insert, Modify and Update.

Section-III 4*5 = 20M

1. a)Define Generic Data types and Complete Data types with an


example.
b)Explain CLEAR, REFRESH,FREE.
c) What is a Macro? Why do we use that? Explain with an example
using placeholders.How many placeholders can we use for a macro?
2. What is field symbol and explain how a field symbol can be used as
table and work area with an example.
3. What is an internal table? Explain about types of the internal table.
What are the different control break statements available inside a
loop?
4. A. How do you delete duplicate records from internal table?
B. How do you find number of records present in internal table?
C. What is difference between types and like?
D. Explain SAP R/3.
E. What are system fields, with example?

You might also like