sap abap questions with answers

21
SAP ABAP Questions with Answers 1. When using Open SQL statements in an ABAP/4 program, you must ensure the following. a) The database system being addressed must be supported by SAP. b) The database tables being addressed must be defined in the ABAP/4 dictionary. c) Both a and b d) None Ans. c 2. Which of the following statements are correct? a) A database interface translates SAPs Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly. b) When you use Native SQL, the addressed database tables do not have to be known to the ABAP/4 dictionary. In Open SQL, the addressed database tables must be defined in the ABAP/4 dictionary. c) There is automatic client handling in Native SQL whereas clients must always be specified in Open SQL. Ans. a,b 3. Which of the following are true? a) TABLE is used as a synonym for STANDARD TABLE b) You can only access a hashed table using the generic key operations. Explicit or implicit index operations (such as LOOP ... FROM oe INSERT itab within a LOOP) are not allowed. c) All hashed tables are index tables. d) We have to define the hash procedure explicitly for HASHED TABLE. Ans. a, b

Upload: gursimran-singh-gujral

Post on 03-Apr-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SAP ABAP Questions with Answers

SAP ABAP Questions with Answers

1. When using Open SQL statements in an ABAP/4 program, you must ensure the following.a) The database system being addressed must be supported by SAP.b) The database tables being addressed must be defined in the ABAP/4 dictionary.c) Both a and bd) NoneAns. c2. Which of the following statements are correct?a) A database interface translates SAPs Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly.b) When you use Native SQL, the addressed database tables do not have to be known to the ABAP/4 dictionary. In Open SQL, the addressed database tables must be defined in the ABAP/4 dictionary.c) There is automatic client handling in Native SQL whereas clients must always be specified in Open SQL.Ans. a,b3. Which of the following are true?a) TABLE is used as a synonym for STANDARD TABLEb) You can only access a hashed table using the generic key operations.Explicit or implicit index operations (such as LOOP ... FROM oe INSERT itab withina LOOP) are not allowed.c) All hashed tables are index tables.d) We have to define the hash procedure explicitly for HASHED TABLE.Ans. a, b

Page 2: SAP ABAP Questions with Answers

4. Can a transparent table exist in data dictionary but not in the database physically?a) Trueb) FalseAns. b5. Can you create a table with fields not referring to data elements?a) Yesb) NoAns. a6. How do you create a batch input session for a transaction?a) â �Call transactionâ � in background mode.b) â �Call transactionâ in error mode.�c) â �Bdc_insertâ for the transaction.�d) None of the above.Ans. C7. What is the alternative to batch input session?a) Load moduleb) Call transactionc) BAPId) Idoc segmentAns. b

Page 3: SAP ABAP Questions with Answers

8. The following are true about â �EXEC SQLâ .�a) You can end the Native SQL with a semicolon.b) You can end the Native SQL with a period.c) You cannot perform reliable authorization checks using EXEC SQL.d) Host variables in the Native SQL are identified with a preceding hash (#).Ans. a, c9. The following are true about database locking.a) Database systems set physical locks on all lines affected by a database call.b) Read locks prevent the setting of further read locks for the objects in question.c) Read locks prevent other transactions from setting write locks for the objects in question.d) Write locks allow other transactions to set read locks for the objects inquestion.Ans. a, c10. What are field symbols?a) Field symbols are like pointers in C that can point to any data object in ABAP/4 and to structures defined in ABAP/4 dictionary.b) Field symbols have to be created with type specifications only.c) You cannot assign one field symbol to another.d) All operations you have programmed with the field symbol are carried outwith the assigned field.Ans. a, d

Page 4: SAP ABAP Questions with Answers

11. EXTRACT statementa) The first EXTRACT statement extracts the first extract record.b) The first EXTRACT statement creates the extract dataset and adds the first extract record.c) Each extract record contains, if specified, the fields of the field group.d) Each extract record contains, if specified, the fields of the fieldsymbol.Ans. b, c

12. You cannot assign a local data object defined in a subroutine or functionmodule to a field group.a) Trueb) FalseAns. a

13. Which of the following are true?a) COLLECT can only be used with STANDARD TABLE.b) To use COLLECT, the internal table should be derived from a database tablewith an explicit key.c) If the system finds a numeric component, that is not part of the key, thenumeric fields that are not part of the table key (see ABAP number types) are addedto the sum total of the existing entries. If it does not find an entry, controlpasses on to the next record in the internal table.d) If the system finds a numeric component, that is not part of the key, the numeric fields that are not part of the table key (see ABAP number types) are addedto the sum total of the existing entries. If it does not find an entry, the system creates a new entry instead.Ans. D

Page 5: SAP ABAP Questions with Answers

14. Which of the following are true?a) ABAP queries are created by associating them to a logical database orthrough a direct read/data retrieval program.b) ABAP queries are created from functional areas that are created from a logical database or through a direct read/retrieval program.c) ABAP queries are created from user groups attached to the functional areasthat are created from a logical database or through a direct read/retrievalprogram.d) ABAP queries are created through the regular report program.Ans. c

15. A logical unit of work (LUW or transaction) beginsa) Each time you start a transaction.b) Each time you end a transaction.c) When the database changes of the previous LUW have been confirmed (database commit). d) Before the database changes of the previous LUW have been cancelled (database rollback).Ans. a, d.

16. A database commit is triggered bya) ABAP/4 command COMMIT WORK.b) CALL SCREEN, CALL DIALOG.c) A Remote Function Calld) CALL TRANSACTIONAns. a, b, c, d

17. The following are true about SAPscript control commands.a) If a control command is unknown or it contains syntax errors, the line containing it will be printed out as it is.b) If a control command is unknown or it contains syntax errors, the line containing it will be treated as a comment line.c) A maximum of one control command may appear in each line.d) A maximum of six control commands may appear in each line.Ans. b, c

Page 6: SAP ABAP Questions with Answers

18. To output SAPscript layout sets, in the print programa) You must always start the output with OPEN_FORM and end it withCLOSE_FORM.b) Within one transaction, you can use only one OPEN_FORM and CLOSE_FORM toopen and close a layout set.c) WRITE_FORM should be used within an OPEN_FORM and CLOSE_FORM.d) WRITE_FORM can be used without an OPEN_FORM and CLOSE_FORM.Ans. a, c

19. The transaction CMOD and SMOD area) Used to create enhancements to standard SAP programs.b) Used to create enhancements to ABAP queries.c) Used to create the user exits, menu exits and screen exits.d) Used to modify the standard function groups.Ans. a, c

20. Which of the following are tools to report data in ABAP?e) ALVf) ALEg) LSMWh) SmartFormsAns: a

Page 7: SAP ABAP Questions with Answers

21. ABAP Query tool is used to:a) Enquire about a running-program statusb) Automatically generate code for reportingc) Perform database operations for user-written programsd) None of the aboveAns: b.

22. In ABAP Query tool...e) Each user can be assigned to several user-groupsf) Each user can be assigned to several functional areasg) Each functional area can be assigned to several user-groupsh) One user can be assigned only to one user-group.Ans: a, b, c

23. Logical databases must be used to create an ABAP Querya) Trueb) FalseAns: b

24. In a BDC program, how would you handle errored records? Would youa) Rerun the programb) Report the errored recordsc) Generate a batch-input session with errored recordsd) Create an output file, to be run again after correctionsAns: b, c, d

25. What are IDocs?a) Documentation of executable programsb) Documents used for data-transport between SAP and non-SAP s/w.c) Documents used for data-transport between two different SAP systemsd) Documents used for one-time data-migration activities.Ans: b, c

26. For transportation of data from a presentation server into SAP, thefunction module used isa) UPLOADb) WS_UPLOADc) FILE_UPLOADd) DATA_UPLOADAns: a, b

27. For one-time high volume data-uploads into SAP from non-reliable systems,the following are generally used:a) BDCb) LSMWc) Direct table updated) IdocsAns: a, b

Page 8: SAP ABAP Questions with Answers

28. In an ABAP program, the INITIALIZATION event is invokeda) Before the AT-SELECTION-SCREEN eventb) After the AT-SELECTION-SCREEN eventc) Could be either wayd) Cannot be predictedAns: a

29. The statement to check whether an internal table itab_test has norecords, is:IF itab_test is initial.a) TRUEb) FALSEAns: b.

30. The statement used to clear all the contents of an internal table is:a) CLEAR itab.b) REFRESH itab.c) FREE itab.d) DELETE itab.Ans: b, c

Page 9: SAP ABAP Questions with Answers

31. The AT-SELECTION-SCREEN event is triggered when :a) ENTER key is hit on the selection-screenb) F8 key is hit on the selection-screenc) Any field on selection-screen is populated d) F4 key is hit on the selection-screenAns: a, b

Page 10: SAP ABAP Questions with Answers

32. What is the transaction-code for viewing batch-runs of a program?a) SE37b) SM37c) SM35d) SM30Ans: b

33. SY-BATCH can be used to determine whether a program is being run inbatch-mode, within the AT-SELECTION-SCREEN event.a) TRUEb) FALSEAns: b

34. The following statements will clear the header-line of an internal table:a) DELETE ITAB.b) FREE ITAB.c) REFRESH ITAB.d) CLEAR ITAB.Ans: d

35. The SAP Logon password is always case-insensitive.a) TRUEb) FALSEAns: bP.S: From ECC6.0, SAP Logon Password is case-sensitive.

Page 11: SAP ABAP Questions with Answers

36. Data: BEGIN OF ITAB OCCURS 0,FIELD1(10), FIELD2(10),END OF ITAB.DO 20 TIMES.ITAB-FIELD1 = â Field1â .� � �ITAB-FIELD2 = â Field2â .� � � ENDDO.a) The internal table has 20 entries.b) The internal table has one entry.c) The internal table has no entry.d) Unpredictable.Ans: c

37. READ TABLE ITAB_TEST WITH KEYVBELN = k_vbeln.If multiple records in table ITAB satisfy the condition, thena) All records are fetchedb) The last record is fetchedc) The first record is fetchedd) Compilation errorAns: c

38. If ITAB has 1000 entries, and DBTAB is a large table, which is betterin terms of performance?i) LOOP AT ITAB.SELECT * INTO ITAB_2 FROM DBTAB WHEREKEY1 = ITAB-KEY1.APPEND ITAB_2.ENDSELECT.ENDLOOP.ii) LOOP AT ITAB.SELECT * INTO TABLE ITAB_2 FROM DBTAB WHEREKEY1 = ITAB-KEY1.ENDLOOP.iii) SELECT * INTO TABLE ITAB_2 FROM DBTABFOR ALL ENTRIES IN ITAB WHEREKEY1 = ITAB-KEY1.a) (i) is better than (ii), and (ii) is better than (iii).b) (ii) is better than (iii), and (iii) is better than (i).c) (iii) is better than (i) and (i) is better than (ii).d) (iii) is better than (ii) and (ii) is better than (i).Ans: d

39. DATA: BEGIN OF ITAB OCCURS 0,Fld1 (1),Fld2 (1),Fld3 (1),END OF ITABITAB has 5 records â [ (1,1,1), (1,1,2), (1,2, 2), (2,2,2), (2,2,3)� ].�The code segment:LOOP AT ITAB.

Page 12: SAP ABAP Questions with Answers

AT NEW fld3.WRITE fld3.ENDAT.ENDLOOP.Produces the output:a) 1 2 2 2 3b) 1 2 3c) 1 1 2 2 2d) 1 1 1 2 2Ans: a

Page 13: SAP ABAP Questions with Answers

40. TYPES: BEGIN OF TYPE1,FLD1,FLD2,FLD3,END OF TYPE1.DATA: ITAB1 TYPE STANDARD TABLE OF TYPE1.ITAB1-FLD1 = â aâ .� � �ITAB1-FLD2 = â bâ .� �ITAB1-FLD3 = â câ .� �APPEND ITAB1.a) The table has one record, with values (a, b, c ).b) The table has no recordsc) Compilation error due to method of declaration of type.d) Compilation error due to method of declaration of table.Ans: d

41. The fastest way to read a value in an internal table is to:a) Specify key, and do a binary searchb) Specify the table-keysc) Directly specify the index valued) Use a work-area with same structure as the internal table.Ans: c

42. If COLLECT is used on an internal table, which has a non-keycharacter field,a) The first recordâ s value is used in the collected version.�b) The last recordâ s value is used in the collected version.�c) Compilation errord) Cannot be predictedAns: c43. Which is the correct syntax for sorting an internal table?a) SORT ITAB USING key1 key2.b) SORT ITAB BY key1 key2.c) SORT ITAB WITH key1 key2.d) SORT ITAB key1 key2.Ans: B

Page 14: SAP ABAP Questions with Answers

44. If we need to fetch all database entries corresponding to a givenkey,X records at a time, the syntax to be used is:a) SELECTâ ¦PACKET SIZE Xâ ¦.b) SELECTâ ¦PACKAGE SIZE Xâ ¦c) SELECTâ ¦UPTO X RECORDSâ ¦.d) This facility is not available in ABAP.Ans: b

45. LOOP AT ITAB_DTL_1.COLLECT ITAB_DTL_1 INTO ITAB_FINAL.ENDLOOP.If the tables contain character fields, which table should be declaredwith the keysExplicitly specified?a) ITAB_DTL_1b) ITAB_FINALc) Either one will do.d) Neither needs a key to be specifiedAns: B

46. The syntax to concatenate a set of values into one variable is:a) CONCATENATE source1, source2 INTO target.b) CONCATENATE source1 source2 INTO target.c) CONCATENATE source1 and source2 INTO target.d) None of the above.Ans: b

47. On the selection-screen, if, while using SELECT-OPTIONS, we specifyNO INTERVALS,we can guarantee that the user will not be able to enter a range ofvalues.a) TRUEb) FALSEAns: b

48. ABAP programmers can create their own data types?a) YESb) NOAns: a

49. MOVE can be used to copy:a) One field’s contents to another field�b) One structure’s contents to another compatible structure�c) One table’s contents to another compatible tabled) A part of one field to another fieldAns: a.b.c.d

Page 15: SAP ABAP Questions with Answers

50. PERFORM ROUTINE1 USING val1.â ¦..FORM ROUTINE1 USING temp1.Temp1 = 10.ENDFORM.Is the value of val1 changed?a) YESb) NOAns. a51. Within an IF-ENDIF block,a) ELSE must be usedb) ELSEIF must be usedc) If ELSEIF is used, ELSE must be usedd) None of the aboveAns: d52. The user-list in a given SAP client can be found using transactiona) STO4b) SE04c) SM04d) None of the aboveAns: c

53. The DESCRIBE statement on internal tables is used to:a) Find the number of lines currently in tableb) Find initial size of the tablec) Find type of the internal tabled) Give the line size, in number of characters, of the tableAns: a, b, c54. Which of the following statements can work without a corresponding END-statement?a) DOb) ATc) IFd) SELECTAns: d

55. In an ABAP program, we can specify a variable to be of HEXADECIMAL type.a) TRUEb) FALSEAns: a

56. In an ABAP program, we can specify a variable to be of OCTAL type.a) TRUEb) FALSEAns: b____________________________________________________________________________57. The default length of a field of type â timeâ (â Tâ ) in an ABAP� � � �program is:a) 6

Page 16: SAP ABAP Questions with Answers

b) 8c) 14d) 0Ans: a

Page 17: SAP ABAP Questions with Answers

58. The various numeric types definable in an ABAP program are:a) I, F, P, Nb) I, F, Pc) I, F, Nd) I, P, NAns: b

59. Variables in an ABAP code can be defined as being similar to data- dictionary elements, using:a) LIKEb) FORc) TYPEd) None of the aboveAns: a, b, c

60. Constants and internal tables are defined using the keywords (respectively):a) CONSTANTS and TABLESb) DATA and DATAc) DATA and TABLESd) CONSTANTS and DATAAns: a

Page 18: SAP ABAP Questions with Answers

61. There are 8 elementary data-types, and hence, 64 possible conversions. Of these,a) Type D and T cannot be inter-convertedb) None of the other types can be converted into D and T.c) D and T cannot be converted into any other type.d) Only C can convert into D/T and vice-versa.Ans: a

62. MOVE f1 TO f2 is equivalent to f2 = f1 a) TRUEb) FALSEAns: a____________________________________________________________________________63. If a structure does not contain internal tables as components, we canequate two structures of incompatible types.a) TRUEb) FALSEAns: a____________________________________________________________________________64. For an inequality check between two variables, the symbol used is:a) NEb) <>c) ><d) NEQAns: a, b, c

65. S1 = â ABCABâ .� � �S2 = â ABCD â .� ���IF S1 CN S2.WRITE â aâ .� ���ELSE.WRITE â bâ � �

ENDIF.Output of above code is:a) ab) bc) Compilation errord) BlankAns: b

66. The statementIF NUM IS BETWEEN 3 AND 7.Is a valid syntax?a) TRUEb) FALSE

Page 19: SAP ABAP Questions with Answers

Ans: B

67. Is it possible to call a subroutine of one program from anotherprogram?a) Trueb) FalseAns: A

68. Can ABAP control statements be used within a sap script?a) YESb) NOAns: a

69. The presentation server is actually the program named SAPGUI.a) Trueb) FalseAns: a

70. When is Top-of-page event executeda) Triggered by a New-page statementb) When the First Write Statement of the program is encountered.c) Before outputting the first line on a new page.Ans: b, c