ABAP Frequently asked questions Part Four

What are the different database integrates ?


Semantic integrity

Relational integrity
Primary key integrity
Value set integrity
Foreign key integrity and
Operational integrity.


What is SAP locking ?

It is a mechanism for defining and applying logical locks to database objects.

What does a lock object involve ?

The tables
The lock argument.

What are the different kinds of lock modes ?

Shared lock
Exclusive lock
Extended exclusive list.

How can a lock object be called in the transaction ?
By calling Enqueue and Dequeue in the transaction.
What are the events by which we can program “help texts” and display “possible values lists” ?
PROCESS ON HELP-REQUEST (POH)
PROCESS ON VALUE-REQUEST (POV).
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)

What do you define in the Data element and Domain?

For Data Element
The information includes the field's representation on the screen in the form of FIELD TEXTS, COLUMN CAPTIONS in list outputs of the table contents and the format of the output via PARAMETER IDS and Online field documentation.

For Domain
Data Type,Field Length and the allowed data values are defined .
What is the difference between a pool table and a transparent table?

Transparent Table :
A tran table has a one to one relationship in the database. The table in the dictionary has the same name, same no of fields, and the fields have the same name as in the R3 table defn. A transparent table has application data (Master and Transaction).

Pooled Table :

A pool table has many to one relation with the table in the database. For one table in the database there r many tables in the dictionary. Tha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. A pooled table is stored in the pool at the database level. A table poo is a databse table with a special struct that enables the data of many R3 tables to be stored in it. It can hold only pooled tables.

What are field symbols and field groups? Have you used component idx of structure with field groups?

A field symbol does not physically reserve space for a field, but points to a field which is not known until run time of the program. Field symbols are comparable to the concept of pointers as used in the programming language C.An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement.

What is the step by step process to create a table in data dictionary?

1. Selecting the table fields 2. Maintaining foreign keys
3. Creating secondary indexes (optional) 4. Maintaining technical settings
5. Activating a table

What is the advantage of structures and how do you use them in Abap/4 programs?

A structure is defined in the ABAP/4 Dictionary like a table and can be accessed from ABAP/4 programs. Any change to the definition of the structure in the ABAP/4 Dictionary is automatically implemented in all programs.While data in tables is stored permanently in the database, structures contain data only during the runtime of a program.Structures are used in abap/4 programs to transfer data between programs as it is globally defined.Structures are used in particular for defining data at the interface between module pools and screens and for standardizing parameters for function modules.

What does an extract statement do in the Abap/4 program?

With the first EXTRACT statement of a report, the system creates the extract dataset and adds the first extract record. With each subsequent EXTRACT statement, the system adds another extract record to the extract dataset.What is a collect statement and how is it different from the append statement?

To fill an internal table with lines which have unique standard keys, we use the COLLECT statement.
If an entry with the same key already exists, the COLLECT statement does not append a new line as APPEND statement, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry. 

What is an open SQL vs Native SQL.

Open SQL allows you to access all database tables known to the SAP system, regardless of the database manufacturer. Sometimes, however, we may want to use database-specific SQL statements called Native SQL in your ABAP/4 program.

To avoid incompatibilities between different database tables and also to make ABAP/4 programs independent of the database system in use, SAP has created a set of separate SQL statements called Open SQL.

Open SQL contains a subset of standard SQL statements as well as some enhancements which are specific to SAP.A database interface translates SAP's Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly.


What does an EXEC SQL statement do in ABAP? What is the disadvantage of using it?

To use a Native SQL statement, it must be preceded by an EXEC SQL statement and concluded by an ENDEXEC statement.databases.
An ABAP/4 program with Native SQL statements does not generally run with different

What are the events used in ABAP4?

The events are

1)INITIALIZATION
2) AT SELECTION-SCREEN
3) AT SELECTION-SCREEN ON
4) START-OF-SELECTION
5)TOP-OF-PAGE
6)TOP-OF-PAGE DURING LINE SELECTION
7) END-OF-PAGE
8)END-OF-SELECTION
9) AT USER-COMMAND
10)AT LINE-SELECTION
11) AT PF
12)GET
13)GET LATE.
14)AT User Command

What is an interactive reports ?

What is the obvious difference of such reports with HTML type reports?

Interactive reporting allows the user to participate actively in retrieving and presenting data during the session. Instead of one extensive and detailed list, with interactive reporting you create a condensed basic list from which the user can call detailed information by positioning the cursor and entering commands. Interactive reporting thus reduces information retrieval to the data actually required.Detailed information is presented in secondary lists. A secondary list may either overlay the basic list completely or appear in an additional dialog window on the same screen.

The secondary list can itself be interactive again.Apart from creating secondary lists, interactive reporting also allows to call transactions or other reports from lists. These programs then use values displayed in the list as input values. The user can, for example, call a transaction from within a list to change the database table whose data is displayed in the list.

What happens when a table is activated in DD?

When the table is activated, a physical table definition in the database is added to the table definition stored in the ABAP/4 Dictionary. The database-independent table definition from the ABAP/4 Dictionary is translated into a definition of the relevant database.

What is a check table and What is a value table?

The relational data model contains not only tables, but also relationships between tables. These relationships are defined in the ABAP/4 Dictionary by foreign keys. An important function of foreign keys is to support data integrity in the relational data model. Foreign key fields may assume only those values allowed by the check table, in other words, values occurring in the primary key of the check table. 

A foreign key provides a link between two tables, for eg.,T1 and T2 by including a reference in table T1 to the primary key of table T2. For this purpose, Foreign key fields assigned to the primary key fields of T2 are included in T1. Table T1, which is the one being checked, is called a foreign key table, and table T2 is called a check table. The terms dependent (foreign key) table and referenced (check) table are also used.

VALUE TABLE:If the domain of the check field has a value table, this is proposed by the system as check table in the foreign field maintenance. The key fields of the value table are in this case assigned fields of the foreign key table with the same domain. These fields may assume only those values allowed by the value table.The value range of the domain can be defined by specifying value table.All table fields referring to this domain can then be checked against the corresponding field of this value table.In order the check can be executed, a foreign key must be defined for the value table.


What are ranges? What are number ranges?

It is often necessary to directly access individual records in a data structure. This is done using unique keys. Number ranges are used to assign numbers to individual database records for a commercial object, to complete the key. Such numbers are e.g. order numbers or material master numbers.

How do you validate the selection criteria of a report? And how do you display initial values in a selection screen?

The selection criteria is validated in the processing block of the AT SELECTION SCREEN event for the input values on the screen and respective messages can be sent.

To display initial values in the selection screen:
1) Use INITIALIZATION EVENT
2)Use DEFAULT VALUE option of PARAMETERS Statement
3) Use SPA/GPA Parameters (PIDs).

What is the Client concept in SAP? What is the meaning of Client independent?

In commercial, organizational and technical terms, the client is a self contained unit in the R3 system, with separate set of Master data and its own set of Tables.When a change is made in one client all other clients are affected in the system - this type of objects are called Client independent objects.

What is Internal table?

Internal tables are table objects that only exist for the runtime of the program. There are several ABAP statements for working with internal tables, for example, append, insert, delete, or find lines.The number of lines of an internal table is extended dynamically at runtime as required. 

You can use internal tables for table calculations on subsets of database tables. For example, you can read a part of one or more database tables into an internal table.They also allow you to reorganize their contents to suit the needs of your program. You can, for example, read particular entries from one or more large customer tables into an internal table, and then use them to create a list. When you run your program, you can access this data directly, instead of having to search for each record in the database.

What is a variant and where do you use it?

If you want to run a report program with same selections at regular intervals (for example, for monthly sales statistics), you would not want to enter the same values each time. So, ABAP/4 offers you a possibility to combine the desired values for all these selections in one selection set. You can create as many different selection sets as you like for each report program and they remain assigned only to the report program in question. Such a selection set is called a variant.

Using Variants Online

Using Variants in Background Processing
Online, starting a report via variant saves the user work,minimizes input errors. In background processing, a variant is the only possibility you have to pass values for the selections.To fill certain selections with values that change according to the application, you use a variant, which takes the variable values from Table TVARV. 

What is set parameter and get parameter?

We can pass data to a called program using SPA/GPA parameters. SPA/GPA parameters are field values saved globally in memory. Each parameter is identified by a three-character code: you can define these parameters in the object browser by selecting Other objects on the first screen. The SPA/GPA storage is user-specific and valid throughout all the user's sessions.by using the SET PARAMETER or GET PARAMETER statements

These statements let you store and retrieve SPA/GPA values from an ABAP/4 program. If the selection screens for the two transactions do not share the same required fields, use these statements to store screen fields explicitly by name.Before calling the new transaction from a PAI module, store the caller transaction's fields under one name:

SET PARAMETER ID 'RID' FIELD .
The system stores the value in in the SPA parameter 'RID'. The three-character identifier 'RID' must be defined in the SAP table TPARA. If the SPA parameter 'RID' already contains a value, the SET PARAMETER statement overwrites it (with the contents of ). 

In the PBO module for the called transaction, retrieve the fields under the other name:
GET PARAMTER ID 'RID' FIELD .

What is field symbol?

A field symbol does not physically reserve space for a field, but points to a field which is not known until runtime of the program. Sometimes you only know which field you want to process, and how you want to process it, at runtime.For this purpose, you can create field symbols in your program. At runtime, you can assign real fields to such field symbols. All operations which you have programmed with the field symbol are then carried out with the assigned field. After successful assignment, there is no difference in ABAP/4 whether you reference the field symbol or the field itself.

How to use a grid list?

Use Function Module Display_*LIST. In U’r program .Put all the data that U want to output in its final format and then pass this internal table to the function module

Two types of grid list .
1)DISPLAY_GRID_LIST(Version 4.0b)
2)DISPLAY_BASIC_LIST(Version 4.6b)

Calculate the subtotal etc and save it as a variant ,However while printing it will print all the enties of the fields

How to pass data from the form to the Subroutine program?
Use structure ITCSY

How can we pass selection and parameter data to a report ?

- There are three options for passing selection and parameter data to the report.
1) using SUBMIT...WITH
2)using a report variant
3)using a RANGE table

Standard Programs that every ABAPer Shud Know

RSAVGL00 Table adjustment across clients

RSBDCSUB Release batch-input sessions automatically RSCLTCOP Copy tables across clients

RSINCL00 ExtendedProgramlist

RSORARELGettheOracleRelease

RSPARAM Displayallinstanceparameters

RSTXSCRP TransportSAPscriptfilesacrosssystems

RGUGBR00 Substitution/Validationutility

RSUSR003 CheckthepasswordsofusersSAP*andDDICinallclients

RSUSR006 List users last login

RSTXLDMC To Load LOGO’s to application server


RELATED POSTS

FAQ'S ON ABAP ENHANCEMENTS
Mysap web application server
SAP web application and business server pages

No comments :

Post a Comment