Thursday, February 10, 2011

SAP ABAP Report Programming Questions 3

How can we create callable modules of program code within one ABAP/4 Program?

A. By defining macros.

  1. By creating include programs in the library.

What are subroutines?

Subroutines are program modules which can be called from other ABAP/4 programs or within the same program.

What are the types of Subroutines?

Internal Subroutines: The source code of the internal subroutines will be in the same ABAP/4 program as the calling procedure (internal call).

  1. External Subroutines: The source code of the external subroutines will be in an ABAP/4 program other than the calling procedure.

What are the different types of parameters?

Formal parameters: Parameters which are defined during the definition of subroutine with the FORM statement.

Actual parameters: Parameters which are specified during the call of a subroutine with the PERFORM statement.

How can one distinguish between different kinds of parameters?

A. Input parameters are used to pass data to subroutines.

  1. Output parameters are used to pass data from subroutines.

What are the different methods of passing data?

Calling by reference: During a subroutine call, only the address of the actual parameter is transferred to the formal parameters. The formal parameter has no memory of its own, and we work with the field of the calling program within the subroutine. If we change the formal parameter, the field contents in the calling program also change.

  1. Calling by value: During a subroutine call, the formal parameters are created as copies of the actual parameters. The formal parameters have memory of their own. Changes to the formal parameters have no effect on the actual parameters.
  2. Calling by value and result: During a subroutine call, the formal parameters are created as copies of the actual parameters. The formal parameters have their own memory space. Changes to the formal parameters are copied to the actual parameters at the end of the subroutine.

The method by which internal tables are passed is By Reference.

What is the difference between the function module and a normal ABAP/4 subroutine?

In contrast to normal subroutines function modules have uniquely defined interface.

Sub routines do not return values.

Sub routines do not return exceptions.

Sub routines cannot be tested independently.

Declaring data as common parts is not possible for function modules. Function modules are stored in a central library.

What is a function group?

A function group is a collection of logically related modules that share global data with each other. All the modules in the group are included in the same main program. When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at runtime. Every function module belongs to a function group.

What is the difference between internal tables and extract datasets?

The lines of an internal table always have the same structure. By using extract datasets, you can handle groups of data with different structure and get statistical figures from the grouped data.

  1. You have to define the structure of the internal table at the begining. You need not define the structure of the extract dataset.
  2. In contrast to internal tables, the system partly compresses extract datasets when storing them. This reduces the storage space required.
  3. Internal tables require special work area for interface whereas extract datasets do not need a special work area for interface.

LOGICAL DATABASE.

What are logical databases? What are the advantages/disadvantages of logical databases?

Ans :- A Logical Database is a hierarchical structure of tables. Use the GET statement to process Logical Databases.

  • - LDB consists of logically related tables grouped together – used for reading and processing data.
  • - Advantages = 1. No need of programming for retrieval , meaning for data selection
  • - 2. Easy to use standard user interface, have check completeness of user input.

Disadvantages = 1. Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.

Preparation of the data records by the L.D.B and reading of the data records in the actual report are accomplished with the command pair.

- Put and Get.

The three main elements of LDB are

- Structure, Selections, Database Program.

What sort of tables one can use in designing the hierarchy of a LDB ?

- Tables which are having Foreign key relations.

The structure of Logical Databases relfects the ________________ dependencies of hierarchical tables in the SAP System.

- Foreign key

If you want to improve the response time ( time to access data ) Logical DataBases permits you to achieve this using ______________

- VIEWS.

What are the advantages of Logical DataBases ?

- It offers an easy-to-use selection screen. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections. It contains central authorization checks for database accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.

Report FORMATTING

In order to suppress the leading zeros of a number field the keywords used are :

NO-ZERO.

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

UNDER.

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

NO-GAP.

Data can be moved from one field to another using a 'Write:' Statement and stored in the desired format.

TRUE. Write : Date_1 to Date_2 format DD/MM/YY.

In order to have boldfaced text as output the command used is

Write : INTENSIFIED.

Background and foreground colors can be interchanged using the command

Format inverse.

Which datatype cannot be used to define parameters.

Type F.

For each new event, the system resets all formatting options to their default values. TRUE.

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.

To execute a page break under the condition that less than a certain number of lines is left on a page is acheived by ________________________.

RESERVE n lines.

What is the limit for the length of a page if the page length is not specified in the report statement.

60,000 Lines.

How can Symbols or R/3 icons be output on the screen?

WRITE AS SYMBOL.

WRITE AS ICON.

REPORTING - GENERAL

What are reports? and how do you set up reports?

A report program reads and analyzes data from one or more database tables without modifying the database. Usually, the result of such a report program is in the form of a list which is output to the screen or sent to a printer.

What are the different types of programs?

I Include Program

M Module Pool

F Function Modules

S External Subroutines

1 Online program

Events in Reporting ? Explain ?

The following events occur at runtime of a typical report program which uses logical databases:

Event keyword Event

--------------------------------------------------------------------------------------------------

INITIALIZATION Point before the selection screen

is displayed

When you start a program in which a selection screen is defined (either in the program itself or in the linked logical database program), the system normally processes this selection screen first. If you want to execute a processing block before the selection screen is processed, you can assign it to the event keyword INITIALIZATION.

AT SELECTION-SCREEN Point after processing user

input on the selection screen while the selection screen is still active

The event keyword AT SELECTION-SCREEN provides you with several possibilities to carry out processing blocks while the system is processing the selection screen.

START-OF-SELECTION Point after processing the selection screen

The event START-OF-SELECTION gives you the possibility of creating a processing block after processing the selection screen and before accessing database tables using a logical database. You can use this processing block, for example, to set the values of internal fields or to write informational statements onto the output screen.

At the START-OF-SELECTION event, also all statements are processed that are not attached to an event keyword except those that are written behind a FORM-ENDFORM block

GET

Point at which the logical database

offers a line of the database table

.

The most important event for report programs with an attached logical database is the moment at which the logical database program has read a line from a database table (see Accessing Data Using Logical Databases ). To start a processing block at this event, use the GET statement as follows:

Syntax

GET

[FIELDS ].

After this statement, you can work with the current line of the database table

. The data is provided in the table work area
.

GET

LATE Point after processing all tables which

are hierarchically subordinate to the database table

in the structure of the logical database.

To start a processing block at the moment after the system has processed all database tables of a logical database that are hierarchically inferior to a specific database table, use the event keyword GET as follows:

Syntax

GET

LATE [FIELDS ].

In analogy to report programs that use only SELECT statements (see table in Comparison of Access Methods ), the processing block of a GET

LATE statement would appear directly before the ENDSELECT statement in the SELECT loop for the database table
.

END-OF-SELECTION Point after processing all lines offered

by the logical database.

To define a processing block after the system has read and processed all database tables of a logical database, use the keyword END-OF-SELECTION.

The following events occur during the processing of the output list of a report program:

Event keyword Event

--------------------------------------------------------------------------------------------------

TOP-OF-PAGE Point during list processing when

a new page is started

END-OF-PAGE Point during list processing when a page

is ended

The following events occur during the display of the output list of a re

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites