Вы находитесь на странице: 1из 9

1. What is a data dictionary?

2. What is a table?

It is an object which stores data in the form of rows and columns.


Each row is called as record, and each column is called as field.
So, to define a table we have to define the fields first.
So, to define a field, we have to specify the below things:

3. What is a Data element?

It is an object which specifies semantic information such as field description, field labels (short,
medium, long and heading) for a field

4 . What is a Domain?

It is an object which specifies technical information such as data type and length for a field.
It also specifies sign, lower case, conversion routine, fixed values, and value table.

5. How many tables are there in SAP?

7) what is delivery class ?

The value in the Delivery class identifies the owner of the data in the table .

It specifies the type of the data that stored in a table.


The data can be business data or system data.
Business data means application data (master and transaction data).

6. What is transparent table?

Ans: The tables which create 1-to-1 correspondence between the table definition in the ABAP
data dictionary and the table definition in the physical database are called as transparent tables
in SAP.

7 . Give examples of transparent table.

Ans: VBAK, VBAP, KNA1 etc.

8. What is table pool?

Ans: Table pool is a table in the SAP database in which many pool tables are assigned.

9. What are pool tables?


Ans: Tables assigned to a table pool are called as pool tables.

10. What are table clusters?

Ans: Table cluster is a table in the SAP database in which many cluster tables are stored.

11. What are clustered tables?

Ans: Tables assigned to a Table cluster are called as clustered tables.

12. Uses of table pool or table cluster.

Ans: Table pool or table cluster is used to store SAP’s internal control information (screen
sequences, program parameters, temporary data, and continuous texts such as documentation).

13. Example of table cluster and cluster tables.

Ans: i. The table cluster RFBLG holds data for five transparent tables i.e. BSEC, BSED, BSEG, BSES
and BSET.

18. What is difference between check table and value table?


Value Table
This is maintained at Domain Level.
When ever you create a domain , you can entered allowed values. For example you go to Domain SHKZG - Debit/credit indicator. Here only
allowed values is H or S.
When ever you use this Domain, the system will forces you to enter only these values.
This is a sort of master check . To be maintained as a customization object. This mean that if you want to enter values to this table you have to
create a development request & transport the same.
Check table
For example you have Employee master table & Employee Transaction table.
When ever an employee Transacts we need to check whether that employee exists , so we can refer to the employee master table.
This is nothing but a Parent & Child relationship . Here data can be maintained at client level , no development involved.
As per DBMS what we call foregin key table, is called as check table in SAP.
There is 1 more important Difference in Value Table and Check Table is that:
1. The contents of the check will be used as an input help(F4 Help) for a particular field on which a check table is assigned.
But the contents of Value Table are never used in Input Help.

What is client ?

It is a unique number which is used to provide security to the data at the database level.
In the real time, Based on the client no only, usernames will be created and the access will be
given.
In the real time, normally we use the client number (100,120), (200,220), (300,320).

The field name, data element, and domain for client number is ‘MANDT’.
Why do we call client 000 as golden client?
Golden client contains all the configuration data and master data so some extent. All the configuration settings are done in golden clients and
then moved to other clients. Hence this client acts as a master record for all transaction settings, hence the name "Golden Client".
4) what is foreign key ?

The relation between two tables for validating the data is called foreign key relation. Validation
means checking whether the value is correct or not.
Check table:
A table which stores master data is called a check table.
Foreign Key Table :
A table which is linked with check table for validating its own data is called foreign key table
Foreign key relation :

A relation between two or more tables for validating the data is called foreign key relation.

what is field symbols in abap ?

Generally, we use the explicit work area to process the internal table like appending & modifying records. We can reduce the time and improve
the performance of the program by using the field-symbols. When we use the LOOP construct with the explicit work area, system need to engage
the resources to put the required record in the work area, process it and move it back to the table if the needed. This additional processing time
could be saved by using the field-symbol. By using the field-symbols we can save this additional time and improve the performance. Field-
symbols are similar to dereferenced pointers in C. While using the field-symbol, system uses the same memory allocated to that particular field in
the record instead of moving it to work area and processing

Function modules
A Function module is a sub program which contains a piece of abap code which is used for specific
functionality or a task.
Function modules contains importing and exporting parameters
Function modules also contains Exceptions to raise Error messages
Function modules can be tested independently
Function modules can be debugged independently
Function modules are mainly used for global modularization i.e., once a function module is created
it can be used by multiple program throughout SAP.

What is view on ddic ?


Many a times it is required to extract data from several tables this can be a time consuming process.
To simplify the process and to increase the efficiency of the code, you can define a VIEW. Data is not
stored in a VIEW physically. Here data is combined from several tables, but the data is stored in their
respective tables. As the name goes a VIEW is just a VIEW of the selected/desired fields from a
number of tables. Fields that are not required are hidden. For example if data needs to be extracted
from 5 tables with desired fields, then you can create a VIEW of the required fields.

Q: Our ABAP program is working properly in Foreground. Can I schedule

it for background processing on the weekend?

A: SAP standard program RSBDCSUB helps you to schedule the job.

Create a variant for RSBDCSUB with the BDC session name.

Q: How can we send a mail to the user intimating him that his

report/BDCcompleted in background?

A: You can use FUNCTION RS_SEND_MAIL_FOR_SPOOLLIST

MF41 vs COGI
For the components in Repetitive Manufacturing is used to postprocess components used in production. In addition, the system displays the
posting error when postprocessing. This kind of postprocessing is used for individual postprocessing records.
Here, the system creates a separate postprocessing record for each backflushing error, since it must not lose track of the link between the
backflush and the postprocessing record.
Menu Path:
Logistics  Production  Repetitive Manufacturing  Backflush  Postprocess  Postprocessing individual components

How to increase performance using


Parallel Cursor in SAP ABAP ?
Using parallel cursor to increase performance of SAP ABAP
programs, parallel cursor in SAP ABAP

The first thing that comes into the mind of a good ABAPer is performance of his object, the main problem for performance
issues are bad Select statements ex: select joins for more than 3 tables, nested Loops, how ever there is a concept of parallel
cursor in SAP ABAP to avoid performance issues with nested loops with where condition.

To understand parallel cursor, follow and understand the below programs.

Program without parallel cursor


REPORT ZSAN_PARALLEL_CURSER.
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MBRSH TYPE MARA-MBRSH,
MATKL TYPE MARA-MATKL,
MEINS TYPE MARA-MEINS,
END OF TY_MARA.
DATA : IT_MARA TYPE TABLE OF TY_MARA,
WA_MARA TYPE TY_MARA.
TYPES: BEGIN OF TY_MVKE,
MATNR TYPE MVKE-MATNR,
VKORG TYPE MVKE-VKORG,
VTWEG TYPE MVKE-VTWEG,
END OF TY_MVKE.
DATA : IT_MVKE TYPE TABLE OF TY_MVKE,
WA_MVKE TYPE TY_MVKE.
SELECT
MATNR
MTART
MBRSH
MATKL
MEINS FROM MARA INTO TABLE IT_MARA UP TO 500 ROWS.
SORT IT_MARA.
DELETE ADJACENT DUPLICATES FROM IT_MARA COMPARING ALL FIELDS.
SELECT MATNR
VKORG
VTWEG FROM MVKE INTO TABLE IT_MVKE
FOR ALL ENTRIES IN IT_MARA WHERE MATNR = IT_MARA-MATNR.
LOOP AT IT_MARA INTO WA_MARA.
LOOP AT IT_MVKE INTO WA_MVKE WHERE MATNR = WA_MARA-MATNR.
WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MVKE-VKORG, WA_MVKE-VTWEG.
ENDLOOP.
ENDLOOP.
Program with parallel cursor.
REPORT ZSAN_PARALLEL_CURSER.
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MBRSH TYPE MARA-MBRSH,
MATKL TYPE MARA-MATKL,
MEINS TYPE MARA-MEINS,
END OF TY_MARA.
DATA : IT_MARA TYPE TABLE OF TY_MARA,
WA_MARA TYPE TY_MARA.
TYPES: BEGIN OF TY_MVKE,
MATNR TYPE MVKE-MATNR,
VKORG TYPE MVKE-VKORG,
VTWEG TYPE MVKE-VTWEG,
END OF TY_MVKE.
DATA : IT_MVKE TYPE TABLE OF TY_MVKE,
WA_MVKE TYPE TY_MVKE.
SELECT
MATNR
MTART
MBRSH
MATKL
MEINS FROM MARA INTO TABLE IT_MARA UP TO 500 ROWS.
SORT IT_MARA.
DELETE ADJACENT DUPLICATES FROM IT_MARA COMPARING ALL FIELDS.
SELECT MATNR
VKORG
VTWEG FROM MVKE INTO TABLE IT_MVKE
FOR ALL ENTRIES IN IT_MARA WHERE MATNR = IT_MARA-MATNR.
SORT: IT_MARA, IT_MVKE.
DATA V_INDEX TYPE SY-TABIX.
LOOP AT IT_MARA INTO WA_MARA.
READ TABLE IT_MVKE INTO WA_MVKE WITH KEY MATNR = WA_MARA-MATNR BINARY SEARCH.
IF SY-SUBRC = 0.
V_INDEX = SY-TABIX.
LOOP AT IT_MVKE INTO WA_MVKE FROM V_INDEX. "no where condition for loop
IF WA_MVKE-MATNR <> WA_MARA-MATNR.
EXIT.
ENDIF.
WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MVKE-VKORG, WA_MVKE-VTWEG.
ENDLOOP.
ENDIF.
CLEAR: WA_MARA, WA_MVKE.
ENDLOOP.

Select for all entries in SAP ABAP, What are the advantages of select for all entries in SAP ABAP
programming ?

SELECT FOR ALL ENTRIES is the best alternative for SELECT WITH JOINS, this
statement is very helpful for reading data from more than 2 tables.
The load on database will be very less.
SELECT <FIELDS> FROM <DBTABLE1> INTO TABLE <ITAB1>
WHERE <CONDITION>.
SELECT <FIELDS> FROM <DBTABLE2> INTO <ITAB2> FOR ALL ENTRIES IN <ITAB1>
WHERE <FIELD1> = <ITAB1>-FIELD1.
**HERE WE ARE READING DATA 2 DATABASE TABLES, SEE WHERE CONDITIONS OF SECOND SELECT STATEMENT

DATA: it_mara TYPE TABLE OF mara,


wa_mara TYPE mara.
DATA: it_makt TYPE TABLE OF makt,
wa_makt TYPE makt.
SELECT *
FROM mara
INTO TABLE it_mara
WHERE mtart = 'FERT'.
IF it_mara IS NOT INITIAL.
SELECT *
FROM makt
INTO TABLE it_makt
FOR ALL ENTRIES IN it_mara
WHERE matnr = it_mara-matnr.
ENDIF.

Open SQL & Native SQL in SAP ABAP


The goal of this tutorial is not to teach you SQL or database concepts but to introduce you to the SQL diversity in ABAP

In ABAP/4 programming language, there are two types of SQL being used.

1. NATIVE SQL
2. OPEN SQL.

Open SQL allows you to access the database tables declared in the ABAP dictionary regardless of the database
platform that the R/3 system is using.

Native SQL allows you to use database-specific SQL statements in an ABAP/4 program. This means that you can use
database tables that are not administered by ABAP dictionary, and therefore integrate data that is not part of the R/3
system.

Open SQL consists of a set of ABAP statements that perform operations on the central database in the R/3 system. The
results of the operations and any error messages are independent of the database system in use. Open SQL thus
provides a uniform syntax and semantics for all of the database systems supported by SAP. ABAP programs that only
use Open SQL statements will work in any R/3 system, regardless of the database system in use. Open SQL
statements can only work with database tables that have been been created in the ABAP dictionary.
Basic Open SQL Commands

 SELECT
 INSERT
 UPDATE
 MODIFY
 DELETE
 OPEN CURSOR,
FETCH,
CLOSE CURSOR

Example

TABLES SBOOK.

DATA C TYPE CURSOR,

WA LIKE SBOOK.

OPEN CURSOR C FOR SELECT * FROM SBOOK WHERE CARRID = 'LH '

AND CONNID = '0400'

AND FLDATE = '19950228'

ORDER BY PRIMARY KEY.

DO.
FETCH NEXT CURSOR C INTO WA.

IF SY-SUBRC <> 0.

CLOSE CURSOR C.

EXIT.

ENDIF.

WRITE: / WA-BOOKID, WA-CUSTOMID, WA-CUSTTYPE,

WA-SMOKER, WA-LUGGWEIGHT, WA-WUNIT,

WA-INVOICE.

ENDDO.

Output the passenger list for the Lufthansa flight 0400 on 28-02.1995:

Open SQL Return Codes


All Open SQL statements fill the following two system fields with return codes.

SY-SUBRC

After every Open SQL statement, the system field SY-SUBRC contains the value 0 if the operation was successful, a
value other than 0 if not.

SY-DBCNT

After an Open SQL statement, the system field SY-DBCNT contains the number of database lines processed.

Native SQL
As already mentioned, Native SQL allows you to use database-specific SQL statements in an ABAP program.

To use Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC
statement.

Syntax

EXEC SQL [PERFORMING <form>].

<Native SQL statement>

ENDEXEC.
There is no period after Native SQL statements. Furthermore, using inverted commas (") or an asterisk (*) at the
beginning of a line in a native SQL statement does not introduce a comment as it would in normal ABAP syntax. You
need to know whether table and field names are case-sensitive in your chosen database.

In Native SQL statements, the data is transported between the database table and the ABAP program using host
variables. These are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). You can
use elementary structures as host variables. Exceptionally, structures in an INTO clause are treated as though all of
their fields were listed individually.

As in Open SQL, after the ENDEXEC statement, SY-DBCNT contains the number of lines processed. In nearly all
cases, SY-SUBRC contains the value 0 after the ENDEXEC statement.
SAP : Bank Guarantees Configuration

Bank Gaurantees are normally two stage transactions i.e

1. When you receive the Bank Gaurantee


2. When you receive the payment for which it was issued

The configuration for Bank Gaurantee can be done using the T Code FBKP.

You need to assign the GL accounts for the Special GL Indicator "G".In tis process you can do it for Customers or Vendors.

It is a GL Account Assignment to the Reconcilliation Account that is being assined the Customer or Vendor master.

When ever a Bank Gaurantee is received then we enter the data as Noted item.And the amount would be shown as a open item in the Bank Gaurantee GL
account.

When the amount is received then in the entry screen for the amount received we also select the Special GL indicator G so that the Open Item gets
cleared.

By doing so it would be possible to arrive at the list of the Gaurantees open at any point of time.

The steps are as follows :

1.T Code FBKP for GL Account Assignment to the Reconcilliation Account


2.T.Code F-49 for entering the Bank Gaurantee received as Noted Item.
3.T Code F-28 for Gurantee received from the Customer for the sales invoice. In the first screen in the Open Item Selection segment provide "G" as the
Specil GL indicator after providing the Customer No.

The the system would automatically clear the Gaurantee along with the invoice amount.

We will not receive the BG from Customer nor pay to the Vendor. as Security there will be Deposit in our bank account.
the Entry for the same will be

DR FDR with Bank for BG.( % of the BG as deposit (asset)


DR Bank Charges.( % of BG, will be expense)
CR Bank CC A/c ( CC already allot for the client)

In case of delivery fullfillment with customer or after the fixed term the entry will be

Cr FDR with Bank for BG


Cr Intrest Chages ( Income on the Deposit)
Dr Bank cc A/c.

Вам также может понравиться