Breaking News
Loading...
Tuesday 4 June 2013

SAP ABAP Interview Questions and Answers 4

06:30

REPORT GENERATION – FORMATTING

1. The alignment of a type 'c' field in a report is left Aligned.

2. In the statement Write:/15(10) Ofal-lifnr. what do the number 15 and 10 stand for15 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.

4. 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'--:--:--'.

5. In order to suppress the leading zeroes of a number field the keywords used are NO-ZERO.

6. 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.

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

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

9. The no of decimal places for output can be defines within a write statement. (T/F).

TRUE. Write:/ decimals 2.

10. 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.

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

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

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

14. The "SKIP TO LINE line number" is dependent on the LINE-COUNT statement included in the report statement of the program.

15. In order to skip columns the command used is POSITION .

16. In order to have boldfaced text as output the command used is Write:INTENSIFIED.

17. Background and foreground colors can be interchanged using the command Format Inverse.

18. In order to restore the system defaults for all changes made with the format statement is Format Reset.

19. 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.

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

22. If the variable "Text" has the value 'ABCDEF' the output for the statement "Write:/Text+2(3)" will be "CDE"

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

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

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

26. 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

28. How would you define the exponents for a type 'f' field?
Exponent .

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

30. 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.

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

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

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

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

35. 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.

36. 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.

37. 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.

38. 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.

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

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

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

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

43. To designate fields as hotspots at runtime, use FORMAT HOTSPOT = .

44. Horizontal lines created with ULINE and blank lines created with SKIP can be formatted as hotspots. (T/F).
FALSE.

45. How would you suppress the display of a parameter on the selection screen?
Parameters

………..No-Display.

46. Can you assign a matchcode object to a parameter? If so how?
Yes. PARAMETERS
……..MATCHCODE OBJECT ……..

47. For each SELECT-OPTIONS statement, the system creates a selection table. (T/F)
TRUE.

48. 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.

49. How can Symbols or R/3 icons be output on the screen?
WRITE AS SYMBOL.
WRITE AS ICON.

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

REPORTING – GENERAL

1. The system field, which indicates success or failure of a SQL operation, is SY-SUBRC.
2. What is the syntax for specifying database table name at runtime in SELECT statement.
NAME = 'SPFL1'.
SELECT * FROM (NAME).
……………….
……………….
ENDSELECT.

3. How do you read selected lines of database table into an internal table in packages of predefined size.
SELECT * FROM INTO TABLE PACKAGE SIZE.
Where n is variable.

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

5. 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
WHERE .

6. 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.

8. How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the same from memory to program.
EXPORT [FROM ][FROM ]…. TO MEMORY ID .
The ID , which can be up to 32 characters long, identifies the data in memory.

9. 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.

10. Statements used to delete data objects in ABAP/4 memory FREE MEMORY [ID ].

11. How will you create a file on application server.
Open dataset for output.

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

13. 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.

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

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

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

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

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

19. How to determine the attributes of an internal table?
DESCRIBE TABLE [LINES ] [OCCURS ].

20. Name the ABAP/4 key word for searching a string in an Internal Table.
SEARCH FOR .
The different options ( ) for the search in an internal table are:
ABBREVIATED
Searches tablefor a word containing the character string specified in , where other characters might separate the characters. The first letter of the word and the string must be the same.
STARTING AT 
Searches table for , starting at line . <lin1> can be a variable.
ENDING AT
Searches table for upto line . 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.

21. 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.

22. 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 FROM .
The program 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 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. 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.

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

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

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

TRUE.

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

27. 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)

28. How would you find the attributes of a data type or data object?
DESCRIBE FIELD [LENGTH
type tableview using screen .

53. Differentiate between static and dynamic step loops.
Step loops fall into two classes: Static and Dynamic. Static step loops have a fixed size that cannot be changed at runtime. Dynamic step loops are variable in size. If the user re-sizes the window the system automatically increases or decreases the number of step loop blocks displayed. In any given screen you can define any number of static step loops but only a single dynamic one.

54. What are the two ways of producing a list within a transaction?
By submitting a separate report.
By using leave to list-processing.

55. What is the use of the statement Leave to List-processing?
Leave to List-processing statement is used to produce a list from a module pool. Leave to list processing statement allows to switch from dialog-mode to list-mode within a dialog program.

56. When will the current screen processing terminates?
A current screen processing terminates when control reaches either a Leave-screen or the end of PAI.

57. How is the command Suppress-Dialog useful?
Suppressing entire screens is possible using this command. This command allows us to perform screen processing "in the background". The system carries out all PBO and PAI logic, but does not display the screen to the user. Suppressing screens is useful when we are branching to list-mode from a transaction dialog step.

58. What happens if we use Leave to list-processing without using Suppress-Dialog?
If we don't use Suppress-Dialog to next screen will be displayed but as empty, when the user presses ENTER, the standard list output is displayed.

59. How the transaction that are programmed by the user can be protected?
By implementing an authority check.

60. What are the modes in which any update tasks work?
Synchronous and Asynchronous.

61. What is the difference between Synchronous and Asynchronous updates?
A program asks the system to perform a certain task, and then either waits or doesn't wait for the task to finish. In synchronous processing, the program waits: control returns to the program only when the task has been completed. In asynchronous processing, the program does not wait: the system returns control after merely logging the request for execution.

62. SAP system configuration incluedes Dialog tasks and Update tasks.

63. Dialog-task updates are Synchronous updates.

64. Update –task updates are Asynchronous updates.

65. What is the difference between Commit-work and Rollback-Work tasks?

Commit-Work statement "performs" many functions relevant to synchronized execution of tasks. Rollback-work statement "cancels: all reuests relevant to synchronized execution of tasks.

66. What are the different database integrities?
• Semantic Integrity.
• Relational Integrity.
• Primary Key Integrity.
• Value Set Integrity.
• Foreign Key integrity and
• Operational integrity.

67. All SAP Databases are Relational Databases.

68. What is SAP locking?
It is a mechanism for defining and applying logical locks to database objects.

69. What does a lock object involve?
The tables.
The lock argument.

70. What are the different kinds of lock modes?
Shared lock
Exclusive lock.
Extended exclusive list.

71. How can a lock object be called in the transaction?
By calling Enqueue and Dequeue in the transaction.

72. What are the events by which we can program "help texts" and display "possible value lists"?
-PROCESS ON HELP-REQUEST (POH).
-PROCESS ON VALUE-REQUEST (POV).

73. What is a matchcode?
A matchcode is an aid to finding records stored in the system whenever an object key is required in an input field but the user only knows other (non-key) information about the object.

74. In what ways we can get the context sensitive F1 help on a field?
- Data element documentation.
- Data element additional text in screen painter.
- Using the process on help request event.

75. What is roll area?
A roll area contains the program's runtime context. In addition to the runtime stack and other structures, all local variables and any data known to the program are stored here.

76. How does the system handle roll areas for external program components?
- Transactions run in their own roll areas.
- Reports run in their own roll areas.
- Dialog modules run in their own roll areas
- Function modules run in the roll area of their callers.

77. Does the external program run in the same SAP LUW as the caller, or in a separate one?
- Transactions run with a separate SAP LUW
- Reports run with a separate SAP LUW.
- Dialog modules run in the same SAP LUW as the caller
- Function modules run in the same SAP LUW as the caller.
The only exceptions to the above rules are function modules called with IN UPDATE TASK (V2 function only) or IN BACKGROUND TASK (ALE applications). These always run in their own (separate) update transactions.

78. What are function modules?
Function modules are general-purpose library routines that are available system-wide.

79. What are the types of parameters in the function modules?
In general, function module can have four types of parameters:
- EXPORTING: for passing data to the called function.
- IMPORTING: for receiving data returned from the function module.
- TABLES: for passing internal tables only, by reference (that is, by address).
- CHANGING: for passing parameters to and from the function.

80. What is the difference between Leave Transaction and Call Transaction?
In contrast to LEAVE TO TRANSACTION, the CALL TRANSACTION statement causes the system to start a new SAP LUW. This second SAP LUW runs parallel to the SAP LUW for the calling transaction.

81. How can we pass selection and parameter data to a report?
There are three options for passing selection and parameter data to the report.
- Using SUBMIT…WITH
- Using a report variant.
- Using a range table.

82. How to send a report to the printer instead of displaying it on the screen?
We can send a report to the printer instead of diplaying it on the screen. To do this, use the keywords TO SAP-SPOOL:
SUBMIT RSFLFIND…TO SAP-SPOOL DESTINATION 'LT50'.

83. How can we send data to external programs?
Using SPA/GPA parameters(SAP memory).
Using EXPORT/IMPORT data (ABAP/4 memory)

84. What are SPA/GPA parameters (SAP memory)
SPA/GPA parameters are field values saved globally in memory. There are two ways to use SPA/GPA parmeters:
By setting field attributes in the Screen Painter.
By using the SET PARAMETER or GET PARAMETER statements.

BDC

1. What is full form of BDC Session?
Batch Data Communication Session.

2. What are the steps in a BDC session?
The first step in a BDC session is to identify the screens of the transaction that the program will process. Next step is to write a program to build the BDC table that will be used to submit the data to SAP. The final step is to submit the BDC table to the system in the batch mode or as a single transaction by the CALL TRANSACTION command.

3. How do you find the information on the current screen?
The information on the current screen can be found by SYSTEM 􀃆 STATUS command from any menu.

4. How do you save data in BDC tables?
The data in BDC tables is saved by using the field name 'BDC_OKCODE' and field value of '/11'.

5. What is the last entry in all BDC tables?
In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of '/11'.

6. What is a multiple line field?
A multiple line field is a special kind of field which allows the user to enter multiple lines of data into it.

7. How do you populate data into a multiple line field?
To populate data into a multiple line field, an index is added to the field name to indicate which line is to be populated by the BDC session (Line index).

8. Write the BDC table structure.
BDC table structure
FIELD TYPE DESCRIPTION
Program CHAR (8) Program name of transaction.
DynPro CHAR (4) Screen number of transaction.
DynBegin CHAR (1) Indicator for new screen.
Fnam CHAR (35) Name of database field from screen.
Fval CHAR (80) Value to submit to field.

9. Does the CALL TRANSACTION method allow multiple transactions to be processed by SAP?
No. The CALL TRANSACTION method allows only a single transaction to be processed by SAP.

10. Does the BDC-INSERT function allow multiple transactions to be processed by SAP?
Yes.

11. What is the syntax for 'CALL TRANSACTION'?
CALL TRANSACTION trans [ using bdctab MODE mode ].
Three possible entries are there for MODE.
A - Show all screens.
E - Show only screens with errors.
N - Show no screens.



Share This :
Tags:

0 comments:

Post a Comment

 
Toggle Footer