Scrol

SAP Trainings contact sap.sreeram@gmail.com or 091-9916083157, 001-210-399-8414

Showing posts with label SAP ABAP FQA's. Show all posts
Showing posts with label SAP ABAP FQA's. Show all posts

ABAP FM, Variants, Messages


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

-     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


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 displaying it on the screen. To do this, use the keywords TO SAP-SPOOL:
SUBMIT RSFLFIND ... TO SAP-SPOOL DESTINATION 'LT50'.

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


What are the differences between SELECT-OPTIONS,VARIANTS AND PARAMETERS?
To enter values for variables on the selection screen, you must define the variables using the PARAMETERS statement.
To enter a range of values for the variables on the selection screen we use SELECT-OPTIONS statement.
If you want to run the same report program with the same selections at regular intervals (for example, for monthly sales statistics),  In, ABAP/4 offers you combine the desired values for all these selections in one selection set.  Such a selection set is called a VARIANTS.

 

What is SPA / GPA ? When do you use it?

To fill the input fields of a called transaction with data from the report, you can use the SPA/GPA technique.  SPA/GPA parameters are values that the system stores in the global, user-related SAP memory.  You use the SAP memory to transfer values between programs.  A user can access the values stored in the SAP memory during one terminal session for all modes used in parallel.
Usually, the input fields on the initial screen of a transaction are connected to SPA/GPA parameters.  If you fill these parameters from within your program before calling the transaction, the system fills the input fields with the corresponding values.


Why and how do you display a message? What are the message types?

An ABAP/4 module lets the system know that an error has occurred by issuing information,error or warning messages. you can also use success messages when a particular action is performed successfully. When the user presses ENTER, the current process is interrupted. The system returns the user to the SAP main menu using Abend message.
Message is displayed using MESSAGE Xnnn, where X is the type of the message and nnn is the number of the message.
You have to declare the Id of the message class in the program using
MESSAGE-ID cc,where cc is the message class.

How and where do You create Message class?

You can create a message class from two places in the system:
1)      From an Object class object list (in the Object Browser)
2)   From an ABAP/4 module (in the ABAP/4 editor)

SAP ABAP General Reporting



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 <table>                                                  Point at which the logical database
offers a line of the database table                  <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 <table> [FIELDS <list>].
After this statement, you can work with the current line of the database table <table>. The data is provided in the table work area <table>.


GET <table> LATE                                       Point after processing all tables which
are hierarchically subordinate to the database table <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 <table> LATE [FIELDS <list>].

In analogy to report programs that use only SELECT statements (see table in Comparison of Access Methods ), the processing block of a GET <table> LATE statement would appear directly before the ENDSELECT statement in the SELECT loop for the database table <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 report program:
Event keyword                                                            Event
----------------------------------------------------------------------------------------------------

AT LINE-SELECTION                                  Point at which the user selects a line

AT USER-COMMAND                                  Point at which the user presses a
function key or enters a command in the       command field.

AT PF<nn>                                                    Point at which the user presses the
function key with the function code                PF<n>


With the selection screen, ABAP/4 offers an interactive element also for report programs. You can define a selection screen without having to bother about all the details required in dialog programming.
The selection screen is always processed directly after a report program is started. The user can enter field values and selection criteria on this screen.

The main purpose of the selection screen is to enable the user to control the database selections of the report program. If a report program is started from another ABAP/4 program with the SUBMIT statement (see Calling Reports), the selection screen objects also serve as a data interface,
With a selection screen defined in the report program, you can enable the user to

·           assign values to variables with the PARAMETERS statement
·           determine selection criteria with the SELECT-OPTIONS statement

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       '_'.


How to specify a client for database table processing.
    TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED
         WHERE MANDT BETWEEN '001' AND '003'.
  ...
ENDSELECT.


Activation – During activation, the runtime object of aggregate object or tables is created. The runtime object is buffered so that the application program can access it quickly. Runtime object has information about the following objects of table

- domain – data elements – field definition – table definition


Lock Mechanism – prevents a new database operation being started an existing one has been correctly completed. When conversion is done, lock is created automatically and released only when conversion is successful.

Clearing of locks
·         restart adjustment – attempt is made to continue conversion at the point of termination 
Cancel adjustment – lock entry is simply deleted from table


Version  Management functions –

·         Canceling changes – reset revised version to active version
·         Storing changes – active version will be temporarily stored in version
Switching changes – switch between active and revised versions

Version catalog – list of all existing versions of an object

·         Revised version – produced when we edit an existing object
·         Active version – produced when we activate an object
·         Temporary version – produced when we copy the active version temporarily to the database with store version functions
·         Historical versions – created when 1. Correction is created 2 correction is 
      released


Table Buffering : Possible buffering types

·         full buffering – either, whole table or none of the table is located in the buffer (Tables up to 30 kb done in client dependent fully buffered tables)
·         Generic buffering – generic areas of the table are fully buffered.
·         Generic key – left justified section of primary key of a table.
·         generic area – all records for which fields of generic key correspond
·         Single record buffering – records actually being accessed are loaded to buffers,   large records where few records are accessed.