14/11/2011

Reporting General Question And Answers


REPORTING – GENERAL Q & A


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 = 'SPFLI'.
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 <SPFLI> INTO TABLE <ITAB> PACKAGE SIZE <N>.
            Where 'n' is variable.

Name the WILDCARD characters which are used for comparisons with character strings & numeric strings.
ü    '%’ And '_'.

4.      In SELECT statements can you specify a variable in WHERE condition or a part of the condition, if so what is syntax.
ü    SELECT * FROM <table> WHERE <var1> <condition> <var or const>.

5.      Name the ABAP/4 key words, which are used to change the contents of database table.        
ü    UPDATE or MODIFY.
***********************************************************************
6.      How to specify a client for database table processing.
ü    TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED
            WHERE MANDT BETWEEN '001' AND '003'.
             .……………
            ENDSELECT.

7.      How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the same from memory to program.
ü    EXPORT <f1> [FROM <g1>] <f2> [FROM <g2>] ... TO MEMORY ID <key>.
The ID <key>, which can be up to 32 characters long, identifies the data in memory.

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

9.      Statement used to delete data objects in ABAP/4 memory __________________.
ü    FREE MEMORY [ID <key>].

10. How will you create a file on application server
ü    Open dataset <dsn> for output.

11. ABAP/4 statement for opening a file on application server for reading ___________.
ü    Open dataset <dsn> for input.

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

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

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

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

16. Name the ABAP/4 key word, which is used to clear the Header line of an Internal Table.
ü    CLEAR <itab>.

17. Name the ABAP/4 key words to initialize an Internal Table with and without header line.
ü    REFRESH <itab>.

18. How to determine the attributes of an internal table?
ü    DESCRIBE TABLE <itab> [LINES <lin>] [OCCURS <occ>].

19. Name the ABAP/4 key word for searching a string in an Internal Table.
ü    SEARCH <itab> FOR <str> <options>.
The different options (<options>) for the search in an internal table are:

ABBREVIATED
Searches table <itab> for a word containing the character string specified in <str>, where the characters might be separated by other characters. The first letter of the word and the string <str> must be the same.

STARTING AT <lin1>
Searches table <itab> for <str>, starting at line <lin1>. <lin1> can be a variable.

ENDING AT <n2>
Searches table <itab> for <str> up to line <lin2>. <lin2> 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.

20. 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 up to 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 this 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 is 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.

21. 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 the 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 <prog> FROM <itab>.

The program <prog> 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 <prog> 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. <itab> 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.

22. Data types can be elementary or structured (TRUE/ FALSE)
ü    TRUE.

23. The amount of memory associated with a data type is ___________
ü    ZERO.

24. Data objects are the physical units a program uses at runtime. (TRUE / FALSE).
ü    TRUE.

25. The data object does not occupy any space in memory. (TRUE / FALSE).
ü    FALSE.

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

27. How would you find the attributes of a data type or data object?
ü    DESCRIBE FIELD <f> [LENGTH <l>] [TYPE <t> [COMPONENTS <n>]]
 [OUTPUT-LENGTH <o>] [DECIMALS <d>]
 [EDIT MASK <m>].

28. The components of a field string cannot have different data types. (TRUE / FALSE).
ü    FALSE.

29. Field strings are also called as __________________________.
ü    Records or Structures.


30. If a field string is aligned (Left, centered, right justified etc.), the filler fields are also added to the length of the type C field. (TRUE / FALSE).
ü    TRUE.

31. You cannot assign a local data object defined in a subroutine or function module to a field group. (TRUE / FALSE).
ü    TRUE.

32. A field group reserves storage space for the fields, and does not contain pointers to existing fields. (TRUE / FALSE).
ü    FALSE.

33. Defining a field group as ‘HEADER’ is optional. ( TRUE / FALSE).
ü    FALSE.

34. How would you define a field symbol ?
ü    FIELD-SYMBOLS <FS>.

35. Which function module would you use to check the user's authorization to access files before opening a file?
ü    AUTHORITY_CHECK_DATASET

36. Name the function module used to convert logical file names to physical file names in ABAP/4 programs.
ü    FILE_GET_NAME.

37. Parameters, which are defined during the definition of a subroutine with the FORM statement, are called ____________________.
ü    Formal Parameters.

38. Parameters which are specified during the call of a subroutine with the PERFORM statement are called ___________________.
ü    Actual Parameters.

39. In subroutines internal tables that are passed by TABLES, are always called by value and result. (TRUE / FALSE)
ü    FALSE. They are called by reference.