Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Answer some more questions on Basic ABAP?

Former Member
0 Likes
964

hi all

Answer the Following,

1)at wch loop "ABC' will be printed.

loop at itab.

do 8 times.

write : ' '.

enddo.

skip.

write : 'ABC'.

endloop.

a)8

b)9

c)10

d)1

2)to sort itab which of the following field will help(more than 1 answer id correct)

data : begin of itab,

a) field(10) type p,

b) field(10) type c,

c) field(10) type n,

d) field(10) type x,

end of itab,

3)which SQL stmt does not LOCK the corresponding DB entries?

a)select single *

b)insert

c)select single update

d)modify

4)data : fielda(10) value 'ABCD'.

if fielda CO 'ABCD'.

what is the value of sy-fdpos.

a)0

b)ABCD

c)A

d)1

5) to delete the contents of itab(with header line)

a)clear itab

b)clear itab[]

c)refresh itab

d)refresh itab[]

6)what will be the value of F1 after submiting

program abc.

data :F1.

F1 = ' '.

perform out.

submit abc1 using F1 exporting list to memory id 'xyz'.

program abc1.

form out.

data : F1.

F1 = '1'.

endform.

a)space

b)1

c)run time error

d)0

reward points will be given for all correct answers....!!

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
935

Hi,

1)at wch loop "ABC' will be printed.

loop at itab.

do 8 times.

write : ' '.

enddo.

skip.

write : 'ABC'.

endloop.

a)8

b)9

c)10

d)1

<b>(D)</b> DO is performed every time till the end of itab lines.

2)to sort itab which of the following field will help(more than 1 answer id correct)

data : begin of itab,

a) field(10) type p,

b) field(10) type c,

c) field(10) type n,

d) field(10) type x,

end of itab,

<b>Should be all as all are character type data.</b>

3)which SQL stmt does not LOCK the corresponding DB entries?

a)select single *

b)insert

c)select single update

d)modify

<b>(A)</b>

4)data : fielda(10) value 'ABCD'.

if fielda CO 'ABCD'.

what is the value of sy-fdpos.

a)0

b)ABCD

c)A

d)1

<b>None of them it will be 4</b>.

5) to delete the contents of itab(with header line)

a)clear itab

b)clear itab[]

c)refresh itab

d)refresh itab[]

<b>You need both (A) (B) or (C) (D) Refresh does not clear the headerline.</b>

6)what will be the value of F1 after submiting

program abc.

data :F1.

F1 = ' '.

perform out.

submit abc1 using F1 exporting list to memory id 'xyz'.

program abc1.

form out.

data : F1.

F1 = '1'.

endform.

a)space

b)1

c)run time error

d)0

<b>(C)</b> I think as there is no data in the program to accept the data.

Regards,

Sesh

9 REPLIES 9
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
936

Hi,

1)at wch loop "ABC' will be printed.

loop at itab.

do 8 times.

write : ' '.

enddo.

skip.

write : 'ABC'.

endloop.

a)8

b)9

c)10

d)1

<b>(D)</b> DO is performed every time till the end of itab lines.

2)to sort itab which of the following field will help(more than 1 answer id correct)

data : begin of itab,

a) field(10) type p,

b) field(10) type c,

c) field(10) type n,

d) field(10) type x,

end of itab,

<b>Should be all as all are character type data.</b>

3)which SQL stmt does not LOCK the corresponding DB entries?

a)select single *

b)insert

c)select single update

d)modify

<b>(A)</b>

4)data : fielda(10) value 'ABCD'.

if fielda CO 'ABCD'.

what is the value of sy-fdpos.

a)0

b)ABCD

c)A

d)1

<b>None of them it will be 4</b>.

5) to delete the contents of itab(with header line)

a)clear itab

b)clear itab[]

c)refresh itab

d)refresh itab[]

<b>You need both (A) (B) or (C) (D) Refresh does not clear the headerline.</b>

6)what will be the value of F1 after submiting

program abc.

data :F1.

F1 = ' '.

perform out.

submit abc1 using F1 exporting list to memory id 'xyz'.

program abc1.

form out.

data : F1.

F1 = '1'.

endform.

a)space

b)1

c)run time error

d)0

<b>(C)</b> I think as there is no data in the program to accept the data.

Regards,

Sesh

Read only

Former Member
0 Likes
935

1)at wch loop "ABC' will be printed.

loop at itab.

do 8 times.

write : ' '.

enddo.

skip.

write : 'ABC'.

endloop.

a)8

b)9

c)10

d)1

<b>Answer: The first 8 loops are printed 'space' and then at the 9th loop 'ABC' is printed.</b>

2)to sort itab which of the following field will help(more than 1 answer id correct)

data : begin of itab,

a) field(10) type p,

b) field(10) type c,

c) field(10) type n,

d) field(10) type x,

end of itab,

<b>SORT can be done on all the 4 options, here is the syntax where we can sort even Char fields.

SORT itab [ASCENDING|DESCENDING]

[AS TEXT]

[STABLE]

[sort_key].

</b>

3)which SQL stmt does not LOCK the corresponding DB entries?

a)select single *

b)insert

c)select single update

d)modify

<b>It's select single *.</b>

4)data : fielda(10) value 'ABCD'.

if fielda CO 'ABCD'.

what is the value of sy-fdpos.

a)0

b)ABCD

c)A

d)1

<b>The answer for SY-FDPOS is 4.</b>

5) to delete the contents of itab(with header line)

a)clear itab

b)clear itab[]

c)refresh itab

d)refresh itab[]

<b>REFRESH ITAB[].</b>

6)what will be the value of F1 after submiting

program abc.

data :F1.

F1 = ' '.

perform out.

submit abc1 using F1 exporting list to memory id 'xyz'.

program abc1.

form out.

data : F1.

F1 = '1'.

endform.

a)space

b)1

c)run time error

d)0

<b>It's run time error.</b>

Regards,

Pavan P.

Read only

PS_1978
Active Participant
0 Likes
935

Hi Asha,

1. It prints ABC for each and every loop i.e., for all the records in the internal table "itab" but after 8 spaces.

2. You can use any of the four fields to sort. But you have to add OCCURS clause to the data statement.

3. As per me its a... select single *...

4. None of the answers given by you. Even sy-subrc will be not equal to zero if you define it as data : fielda(10) value 'ABCD'. You have to define it as data: fielda(4) value 'ABCD'. In order to get sy-subrc = 0 and in this case, sy-fdpos = 4.

5. clear itab[].

6. It gives Syntax error, as there is no definition for subroutine <b>out</b> in program abc.

Regards,

Phani.

Message was edited by:

Sivapuram Phani Kumar

Read only

Former Member
0 Likes
935

hi

why do u say it as as select single * for second question?

Read only

Former Member
0 Likes
935

Hi Asha,

1-Never prints

2-B

3-A

4-What is FIElDA CO

5-B

Read only

0 Likes
935

and

6-Give Errors.

THANKS

Read only

0 Likes
935

hi

field a(10)---is decalration for variable 'a' which of type string.

CO----is a string which means Contains Only

Read only

Former Member
0 Likes
935

1)at wch loop "ABC' will be printed.

loop at itab.

do 8 times.

write : ' '.

enddo.

skip.

write : 'ABC'.

endloop.

a)8

b)9

c)10

d)1

Answer : 'ABC' s printed as many record s there in itab but each 'ABC' printed after 8 spaces.

2)to sort itab which of the following field will help(more than 1 answer id correct)

data : begin of itab,

a) field(10) type p,

b) field(10) type c,

c) field(10) type n,

d) field(10) type x,

end of itab,

Answer : a) field(10) type p and

c) field(10) type n

3)which SQL stmt does not LOCK the corresponding DB entries?

a)select single *

b)insert

c)select single update

d)modify

Answer : Select single *

4)data : fielda(10) value 'ABCD'.

if fielda CO 'ABCD'.

what is the value of sy-fdpos.

a)0

b)ABCD

c)A

d)1

Answer : Sy-fdpos = 4

5) to delete the contents of itab(with header line)

a)clear itab

b)clear itab[]

c)refresh itab

d)refresh itab[]

Answer : clear itab[]

6)what will be the value of F1 after submiting

program abc.

data :F1.

F1 = ' '.

perform out.

submit abc1 using F1 exporting list to memory id 'xyz'.

program abc1.

form out.

data : F1.

F1 = '1'.

endform.

a)space

b)1

c)run time error

d)0

answer : c)

Regards,

Darshana

Read only

Former Member
0 Likes
935

hi all

thanks for all your answers....