Vous êtes sur la page 1sur 69

ABAP questions all topics

Explain about roll area , Dispatcher, ABAP-Processor?

Answer: Roll area is nothing but memory allocated by work process. It holds the
information needed by R/3 about programs execution such as value of the variables.

Dispatcher :All the requests that come from presentation server will be directed first to
dispatcher. Further dispatcher sends this requests to work process on FIFO(First In and
First Out) basis.

What is difference between search help and matchcodeobject.

1.A Search help is a ABAP Dictionary object used to define possible values (F4) help.

2.There are

two kinds of search help - elementary and collective.

3. An elementary search help uses a search

path to determine the possible entries.

4. A collective search help consists of two or more

elementary search helps, and thus provides more than one possible search path.

MATCH CODE OBJECT is used to call a particular search help and given along wirth the declaration of any
parameters or select-options

What is use of condense statement.


Condense is used to processing string in abap. The condense statement will
remove all spaces from a given String.
Internal Table With Header Line

Internal Table without Header Line


Look at the following example to differentiate both types.

1 TYPES : BEGIN OF x_personnel,


2 id(10) TYPE C,
3 name(25) TYPE C,
4 END OF x_personnel.
5
6 DATA: t_itab1 TYPE STANDARD TABLE OF x_personnel WITH HEADER LINE,
t_itab2 TYPE STANDARD TABLE OF x_personnel,
7 d_personnel TYPE x_personnel.
8
To access all contents of an internal table we use the following code.

1 LOOP AT t_itab1.
2 WRITE: / t_itab1-name.
3 ENDLOOP.
4 LOOP AT t_itab2 INTO d_personnel.
WRITE: / d_personnel-name.
5
ENDLOOP.
6
Both codes will return the same result. Notice that using header line, we could directly use the table
variable name to access the table contents, whilst without header line, contents are accessed via a working
area.

To access a single content with certain key, use following statements

1 READ TABLE t_itab1 WITH KEY id = '1234'.


2 WRITE : t_itab1-name.
3 READ TABLE t_itab1 INTO d_personnel WITH KEY id = '1234'.
WRITE : d_personnel-name.
4
t_itab1 and d_personnel contain the first record found that matches the criteria.

Using header line can cause ambiguity in code, for example CLEAR t_itab2 means that you cleared entire
contents of table t_itab2, whilst the statement CLEAR t_itab1 will only clear the contents
oft_itab1 header. To clear the entire contents of internal table with header line, use brackets after
variable statement, ex: CLEAR t_itab1[].

Though it may seem more simple and easy to use header line, for some cases it might be best not to use it
to avoid ambiguity and to improve the readability of the program.

What is the difference between internal table and a work area and how do they
work?
Internal table is a temporary two dimensional memory structure similar to database
table. We can store multiple records in the internal table and also using record
pointers we can do the activities such as reading, appending, deleting, modifying etc.

Whereas work area is a variable declared with the TYPE of an internal table or a
database table. It can store only one record at a time. It is like a structure declaration
in C. You can refer individual columns in the work area with the names.

If you declare an internal table with "WITH HEADER LINE" clause the internal table
itself acts as a work area. For example, your ITAB is a work area and ITAB[] is the
internal table.

If you are familiar with ORACLE PLSQL, work area is similar to %ROW_TYPE and
internal is similar to TABLE TYPE.

A work area is nothing more than a structure which serves as a header line for an
internal table. When you read an internal table (without header line) the line which
you read must be moved somewhere, it is moved into a work area.

1. What are the differences between sap memory and abap memory

Within a main session, when ever you start an application program, it opens up an
internal sessions with in the main session. The internal session has a memory area
that contains the ABAP program and its associated data. So when ever you want
to pass data between two internal sessions, then you can use ABAP Memory (i.e
import, export).

When comes to SAP memory (also known as global memory), if the data has to be
passed b/w two main sessions, we can use SAP Memory(SPA/GPA Parameters).
SAP Memory can also be used to pass data b/w internal sessions.

2. What are differences between At selection-screen and


at selection-screen output

AT SELECTION SCREEN:
when user enters the values in the fields of the selection screen and clicks on execution button,this event gets
triggered.this event is basically for checking the value entered by the user for the field of the selection screen i.e data
validity checking.this event is for entire selection screen.

AT SELECTION SCREEN OUTPUT:

This event is executed at PBO of the selection screen every time the user presses

ENTER - in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default
values.

Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used)

and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters

or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.

Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of
selection screen fields.

Example

Output all fields of the SELECT-OPTION NAME highlighted:

SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.

....

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.

SCREEN-INTENSIFIED = '1'.

MODIFY SCREEN.

ENDLOOP.

The addition MODIF ID XYZ to the key word SELECT-OPTIONS

assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1 .

At PBO of the selection screen, all these fields are then set to highlighted

3. What are the events?


4. what are the interactive events

'AT-LINE SELECTION, AT USER COMMAND and AT PF-STATUS' in a single report.


Yes, You can use the 3 together in a single report. Here is a sample code.

****************DATA DECLARATIONS*********************
SELECT carrid " Airline Code
connid " Flight Connection Number
airpfrom " Departure airport
airpto " Destination airport
deptime " Departure time
arrtime " Arrival time
FROM spfli
INTO TABLE t_flight.

DESCRIBE TABLE t_flight LINES w_lines .

*"--------------------------------------------------------------------*
* PF-Status *
*"--------------------------------------------------------------------*

SET PF-STATUS 'SELECT' .


*"--------------------------------------------------------------------*
* AT USER COMMAND EVENT *
*"--------------------------------------------------------------------*
AT USER-COMMAND.
CASE sy-ucomm.

WHEN 'SELECT_ALL'.
w_check = 'X'.
*ADD 4 TO W_LINE.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line .

MODIFY LINE w_line FIELD VALUE w_check .


ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
CLEAR w_line.

*"--------------------------------------------------------------------*
* AT LINE SELECTION EVENT *
*"--------------------------------------------------------------------*
AT LINE-SELECTION

LOOP AT t_flight INTO fs_flight.

WRITE :
/
w_check AS CHECKBOX,
w_mark,
fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002.
ENDLOOP.

This is just a sample code.You can use your own functionality and put them together.

1. AT LINE-SELECTION:

With this event, we can get the Index of Current/Previous list can be obtained for controlling the List.

For eg:

Sy-title - Title of Report

Sy-linct - Total Line No. of Page

Sy-Linno - Current Line No


Sy-Lsind - Index of List Created

Sy-Listi - Index of Previous List

Sy-Lilly - Line No.of List

Sy-Lisel - Contents of Line Selected

Sy-Ucomm - Fn.Code of Clicked Menu Item

Sy-pfkey - Status of Displayed Item

Sy-Linsz - Line Sz. of Report

Sy-Colno - Cur. Col. No.

Sy-Pagno - Current Page No.

Sy-Scols - No. of Cols in Window

Sy-Srows - No. of Lines in Window

Sy-CPage - Cur. Page No.

Sy-CuCol - Cursor Position Col #

Sy-CuRow - Cursor Position Lin #

Sy-LStat - Sts.Info. for Each List Level

Sy-Msgli - Content of the Message Line

Sy-StaCo - No.of First Displayed Col.

Sy-StaRo - No. of First Displayed Row

Sy-RepId - Name of Cur. Report

2. AT USER-COMMAND

The Usage for availing the functionality of "At User-Command" is:

AT PF <n> where n = 1 to 12 can be used.

3. AT PF-Status.
PF Status can also be used, by setting the keyword 'PICK' in the Status Menu.

5. What is Hide ?

HIDE statement in ABAP programming is used with lists. It used for storing the content

of field and list level information of the current list line in a hide area for our later use.

Syntax

HIDE <f>.

This statement will store the content of field <f> along with the current list line number

(System field SYLINNO) in the hide area.

Syntax
HIDE dobj.

Effect

This statement stores the content of a variable dobj together with the current list line whose line number
is contained in sy-linno in the hide area of the current list level. The data type of the
variable dobj must be flat and no field symbols or components of Boxed Components can be specified
that point to rows of internal tables, and no class attributes can be specified. The saved values can be
read as followed:

Any user action on a displayed screen list that causes a list event assigns all values saved
using HIDE to the relevant variables.

If a list row of a list level is read or modified using the statements READ LINE or MODIFY LINE,
all the values of this row saved using HIDE are assigned to the relevant variables.

Notes
The HIDE statement works independently of whether the list cursor was set. In particular,
variables for empty list rows can be stored (that is, rows in which the list cursor was positioned
using statements like SKIP).

The HIDE statement should be executed directly in the statement that has set the list cursor in
the row.

Example

Saving square numbers and cubic numbers for a list of numbers. The example shows that any variable
can be stored independently of the row content. In the real world, one would more likely save only the
number and execute the calculation, when required, in the the event block for AT LINE-SELECTION.

REPORT ...

DATA: square TYPE i,


cube TYPE i.

START-OF-SELECTION.
FORMAT HOTSPOT.
DO 10 TIMES.
square = sy-index ** 2.
cube = sy-index ** 3.
WRITE / sy-index.
HIDE: square, cube.
ENDDO.

AT LINE-SELECTION.
WRITE: square, cube.

Exceptions

Non-Catchable Exceptions

Cause: The field is too long for HIDE.


Runtime Error: HIDE_FIELD_TOO_LARGE

Cause: HIDE in a table row or a component in a table row is not possible.


Runtime Error: HIDE_ILLEGAL_ITAB_SYMBOL

Cause: HIDE in a local field is not possible.


Runtime Error: HIDE_NO_LOCAL: HIDE

Cause: HIDE is not possible on an empty page.


Runtime Error: HIDE_ON_EMPTY_PAGE

Cause: Illegal field


Runtime Error: HIDE_NOT_GLOBAL

Cause: Permitted number of HIDE statements per list row exceeded


Runtime Error: HIDE_TOO_MANY_HIDES
6. What is te difference between occurs 1 and occurs 2?

When occurs 1 internal table body size is one record is created ,For every New record it wil get that much memory,

When occurs 2 internal table body size is Two record is created ,For every New record it wil get that much memory,
so here memory is waisted so for every one record here two records space is created so

If u get only two records in ur internal table use occurs 2

With OCCURS 0, the memory allocation will be dynamic (made by the system) and was usefull when you didn't know
what would be the size of the itab. Now, if you knew previously that itab would be 500 records at a time (for example,
read 3 files with 500 lines), was better to use OCCURS 500 (initial memory allocation made by you).

7. What is the difference between Free and Refresh?

refresh clears all the contents of an internal table ...

free.. frees the memory allocation to the internal table ..

8. What are elements?


9. Can we have more than one selection-screen and how?

REPORT ZDYNAMIC_PROGRAM.

PARAMETERS: rb1 RADIOBUTTON GROUP ab MODIF ID bl2,

rb2 RADIOBUTTON GROUP ab MODIF ID bl2.

SELECTION-SCREEN BEGIN OF SCREEN 100.

parameter p_val1 type char10.

SELECTION-SCREEN END OF SCREEN 100.


SELECTION-SCREEN BEGIN OF SCREEN 200.

parameter p_val2 type char10.

SELECTION-SCREEN END OF SCREEN 200.

AT SELECTION-SCREEN.

if rb1 = 'X'.

call selection-screen 100.

else.

call selection-screen 200.

10. How to declare select-option as a parameter?

Parameters : var1 type c,

Select-option : var2 for var1


11. How can u write programatically value help to a field without using searchhelp and matchcodes.?

By using two types of function modules to be called in SAP Script:

1) HELP_OBJECT_SHOW_FOR_FIELD
2) HELP_OBJECT_SHOW

12. What is RFC?

A Remote Function Call (RFC) is the call or remote execution of a Remote Function
Module in an external system. In the SAP system, these functions are provided by
the RFC interface system. The RFCinterface system enables function calls between
two SAP systems, or between a SAP system and an external system.

13. How to set destination?

How to setup RFC Destination


Skip to end of metadata

Attachments:8
Added by Arpit Goyal, last edited by Arpit Goyal on Aug 20, 2009 (view change)
show comment
Go to start of metadata

RFC Destination is one of the way to connect from an ABAP system to an external system. This weblog talks about the basic
HTTP connection to external server (type G).

Business usecase from my area of expertise is connecting any R/3 system to a CE ESR (mainly for Proxy generation of
Services Modeled in ESR).

Step 1:

Go to transaction SM59.

UI looks like as follows:


Step 2:

As shown in the picture above, select the HTPP connection to external server and click on the Create icon (marked in red).

RFC Connection UI will come up. Fill in the necessary details as shown below:

Note that RFC Name should be unique, connection type should be Type-G.

Other information you need to enter is the host (or IP), Port and the Context root. The following URL should match the
service deployed on AS.

A good example to use the RFC destination will be to write a small ABAP code to establish connection to a servlet deployed
on AS. User can use HTTP protocol to invoke it from ABAP.

Step 3:

Click on the save icon and you will recieve an info message stating "HTTP connection may not be secure" which is true.
Press to continue.

Step 4:

Now most of the application which the RFC destination points to will require some basic authentication. And if it is not
provided part of the RFC destination, quite possible when the program uses the RFC Destination, it prompts for username-
password! So lets enter the logon & security details as shown

below:

Step 5:

Click on the save icon and now press on the connection test button to see whether the server is available or not. Incase
the entries point to the correct system, output should be somewhat similar as shown below:
More info:

- Incase wrong entries are provided error message comes at the status bar:

- Connection test DO NOT check the credentials. Even if wrong credentials are passed this information is not validated.

14. What are the function module types?

Three types:

Normal

Remote-enabled (RFC)

Update
15. What are tables?

Transparent Pool Cluster

Contain a single table. They are used to hold They are used to hold data from a few number of large
Used to store master data a large number of very tables.(stores system data)
small tables(stores
customizing data or
system data)

It has a one-to-one It has a many-to-one It has a many-to-one relationship with table in the
relationship with a table in relationship with a database
the database table in the database

For each transparent It is stored with other Many cluster tables are stored in a single table in the
table there is one pooled tables in a database called a table cluster
associated table in the single table called
database table pool in the
database

The database table has The database table The database table has different name, different number
the same name, same has different name, of fields and fields have different names
number of fields and the different number of
fields have the same fields and fields have
names different names

There is only a single Table pools contain Contains less tables than table pools
table more tables than table
clusters

Single table can have one Primary key of each Primary key of each table begins with same fields or
or more primary key table does not begin fields
with same fields or
fields

Secondary indexes can Secondary indexes Secondary indexes cannot be created


be created cannot be created

They can be accessed They can be accessed They can be accessed using open SQL only
using open and native using open SQL only
SQL

USE: They are used to USE: They reduce the USE: They would be used when the tables have primary
hold master data e.g. Table vendors or table of amount of database key in common and data in these tables are all accesses
customers. Example of transaction data is resources needed simultaneously
orders placed by customers when many small
tables have to be
opened at the same
time

16. what are client-dependant tables and independent tables?

A client-dependent table has the field MANDT of data type CLNT, which indicates Client id.

A client-independent table does not have this field.


Data which can be access by all user are client independent (no mandt field in table). Data which can be access by
some specific user are client dependent (use mandt field in table) .

Mainly the MANDT coloum plays important role.

17. how to distinguish them?


18. what is the use of Table maintanance allowed?

Table Maintenance is used to maintain the values of a custom table. Based on the requirements,
one can change or add/delete the contents of the custom table.
Table Maintenance generator is required to do Manual entries in the Table. If the requirement is
to update the table only programmatically and not manually then table maintenance generator is
not required. Manual entries in table can be maintained (New record can be inserted / existing
can be modified) using transaction SM 30, if the table maintenance for the table is generated.
19. What are the domains?

a domain is at the lowest level among the sub-elements of a table. it defines the data type and its length for example
char /4 (character 4). it has other characteristics such as fixed values etc.

a data element is at the next level and it can reference either a domain of SAP standard data types. it has
characteristics which are inherited by the fields of a table.

several data elements can refer to the same domain in their definitions.

it is not necessary to use a data elements for creating fields in a table. you can create fields by directly referencing
SAP standard data types.

20. What are the check tables and value tables?


21. What is the difference between table and structures?

A table is a table that has been created in the database.


A structure is just a list of fields defined under a name. Structures are useful for painting screen fields, and for
manipulating data that has a consistent format defined by a discrete number of fields.

There is no content to view in a structure. You can, however, view the definition of a structure in SE11.

Structure in ABAP can not store data.

at DDIC level both are same but a table in SAP has mapping

to a table in the underlying database.

In se16 you can see data only from a table.

22. How to declare one internal table with out header line without using structures ?

No, we cannot declare internal table without header line and without structure because it gives

error ITAB cannot be a table, a reference, a string or contain any of these object.

Code with Header without Structure

TABLES : ZREKHA_EMP.

DATA : ITAB LIKE ZREKHA_EMP OCCURS 0 WITH HEADER LINE.

SELECT * FROM ZREKHA_EMP INTO CORRESPONDING FIELDS OF ITAB.

APPEND ITAB.

ENDSELECT.
LOOP AT ITAB.

WRITE : / ITAB-EMPNO, ITAB-EMPNAME,ITAB-DEPTNO.

ENDLOOP.

Code without Header with Structure

TABLES : ZREKHA_EMP.

DATA : BEGIN OF ITAB OCCURS 0,

EMPNO LIKE XREKHA_EMP-EMPNO,

EMPNAME LIKE XREKHA_EMP-EMPNAME,

DEPTNO LIKE XREKHA_EMP-DEPTNO,

END OF ITAB.

SELECT * FROM ZREKHA_EMP INTO CORRESPONDING FIELDS OF ITAB.

APPEND ITAB.
ENDSELECT.

LOOP AT ITAB.

WRITE : / ITAB-EMPNO, ITAB-EMPNAME,ITAB-DEPTNO.

ENDLOOP.

23. what are lockobjects?


24. What are datasets? what are the diffrent syntaxes?

Reading Data from Files


To read data from a file on the application server, use the READ DATASET statement:

Syntax

READ DATASET <dsn> INTO <f> [LENGTH <len>].

This statement reads data from the file <dsn> into the variable <f>. In order to determine
into which variable you should read data from a file, you need to know the structure of the
file.

You can specify the transfer mode in the OPEN DATASET statement. If you have not already
opened the file for reading, the system tries to open it either in binary mode, or using the
additions from the last OPEN DATASET statement. However, it is good practice only to open
files using the OPEN DATASET statement. For further information about the OPEN DATASET
statement and the naming conventions for files, refer to

Opening a File.

If the system was able to read data successfully, SY-SUBRC is set to 0. When the end of the
file is reached, SY-SUBRC is set to 4. If the file could not be opened, SY-SUBRC is set to 8.

If you are working in binary mode, you can use the LENGTH addition to find out the length of
the data transferred to <f>. The system sets the value of the variable <len> to this length.
DATA FNAME(60) VALUE 'myfile'.

DATA: TEXT1(12) VALUE 'abcdefghijkl',


TEXT2(5),
LENG TYPE I.

OPEN DATASET FNAME FOR OUTPUT IN BINARY MODE.


TRANSFER TEXT1 TO FNAME.
CLOSE DATASET FNAME.

OPEN DATASET FNAME FOR INPUT IN BINARY MODE.


DO.
READ DATASET FNAME INTO TEXT2 LENGTH LENG.
WRITE: / SY-SUBRC, TEXT2, LENG.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET FNAME.

The output is:

0 abcde 5
0 fghij 5
4 kl### 2

This example fills the file "myfile" with 12 bytes from the field TEXT1. It is then read into the
field TEXT2 in 5-byte portions. Note here that the system fills up the last three bytes of
TEXT2 with zeros after the end of the file has been reached. The number of bytes transferred
is contained in the field LENG.

If you are working in text mode, you can use the LENGTH addition to find out the length of
the current line in the file. The system sets the value of the variable <len> to the length of
the line. The system calculates this by counting the number of bytes between the current
position and the next end of line marker in the file.

DATA FNAME(60) VALUE 'myfile'.

DATA: TEXT1(4) VALUE '1234 ',


TEXT2(8) VALUE '12345678',
TEXT3(2),
LENG TYPE I.
OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
TRANSFER: TEXT1 TO FNAME,
TEXT2 TO FNAME.
CLOSE DATASET FNAME.

OPEN DATASET FNAME FOR INPUT IN TEXT MODE.


DO 2 TIMES.
READ DATASET FNAME INTO TEXT3 LENGTH LENG.
WRITE: / TEXT3, LENG.
ENDDO.
CLOSE DATASET FNAME.

The output appears as follows:

12 4

12 8

This example writes the strings TEXT1 and TEXT2 to the file "myfile" in text mode. They are
then read into the string TEXT3 (length 2). The amount of memory occupied by the lines is
read into the field LENG.

25. What is the diffrences between we_upload and upload?

Upload is function used to write data from a file in the presentation server to internal table.here you get a dialog- box
to enter the path of the file name.

Ws_upload also perfoms the same function , but without screen. here you do not get a dialog-box, rather you need to
type the path of the file name.

26. What is the diffrence between open_form and close_form

OPEN_FORM: This form opens the script. The module OPEN_FORM opens layout set printing.

WRITE_FORM: This form is used to write the content mentioned in the windows of the SAP Script.
START_FORM: This form is dynamically call a page in the script. The layout set can be changed in the current print
procedure with START_FORM. This may also be used to trigger a new-spool id.

END_FORM: This form is used to close the current layout set.

CLOSE_FORM: This form close the current SAP script form.

You can have any number for WRITE_FORM, START_FORM and END_FORM, but for a script you can have only
one OPEN_FORM and CLOSE_FORM.

27. What are the page windows? How many main windows will be there in a page window?

In smartforms you can create 99 main windows. but in scripts only 1 main window is possble.

To create a main window in page,

right click on form painter--->create window.

To make this window as main window,

Double click on this window --> go to attributes select window type as main window.

28. How to include Logo in your layout?

As such first thing is to upload your logo to the R/3. Transaction is SE78. Have the logo file in .bmp format as that is
acceptable to R/3.

If you are using in Smartforms. Just make a window and right-click and attach image.

If you are using SAPScript then you have to use command INCLUDE.
29. How to debugg a script?
30. Tell me different standard layouts which we use?
31. sapscripts and abap programs are client dependent or not? why?

32 . What is LUW.

A Logical Unit of Work (LUW or database transaction) is an inseparable sequence of database operations which

must be executed either in its entirety or not at all. For the database system, it thus constitutes a unit.

Why Scripts are client dependent and Smart Forms are not
By Sirisha Vennelakanti, YASH Technologies

This blog is to understand why Sap scripts are client dependent and smart forms client independent.

To output documents using the programming interface, R/3 application programs makes use of scripts or
smart forms.

By design sap script is a word processing tool which displays data on the form with the help of text
elements where the logic of those is written in the print program and Forms were designed to be driven
from print program, hence are often termed as client dependent. Smart forms are client independent.
Bcoz it doesnt use any text elements. it will be executed through a function module. When a print
program calls a Smart Form, the form itself takes over to produce output, without any further direction
from print program.

Steps for creation

Creation of Script

Print program will determine the output document, the areas values, and the frequency of the output. The
database access will be made in the print program which will insert them in the corresponding fields of the
form. Script needs direction from the print program to print output.

Scripts uses layout set that describes the layout of the individual print pages and uses text elements to
supply definable output blocks, which a print program can call.
Creation of smart form

Design the form

Form Activation which returns Function module

Application program for data retrieval & calling Smart form.

Application program calls the function module, the Smart Form uses the modules interface (which
corresponds to the form interface) to transfer any table data previously selected and to print the form
according to the form description. In addition form can have additional data selections.

Further when you downloaded a script with the sap utility program RSTXSCRP,
You can see a script has repeated transfer of control SAP script texts are usually allocated to an
object from an SAP application. For example, there are texts on customers, vendors, and materials,
whose data is client dependent and whereas smart forms uses call to the function module only once
and all form processing is handled using the Function module
32. what are the different internal tables ? explain them?
33. what is runtime analysis ?
34. what si the difference between select singe * and select * upto one row

the query which is used to fetch single row from data base table alternative to SELECT SINGLE is SELECT UPTO 1
ROW....

The SELECT UPTO 1 ROW query also returns single data from database table...

the difference between both query is that SELECT SINGLE should be used when u have only KEY FIELDS in the
where clause...

in case of SELECT UPTO 1 ROW....there is no need of having KEY FIELDS in the where clause...
35. what is the differnce between sum and collect?

Sum will add the whole internal values and store in the first line of the internal

table..

Collect will add the common key values in the internal table and store in the corresponding key field.

36. what are session mothod and call transaction method and explain about them?

Difference between CALL TRANSACTION and SESSION Method


by Vikram Chellappa

Call Transaction method Classical or session method

In this method, the ABAP/4 program In this method, ABAP/4 program read the
uses the call transaction <T-code > external data that is to be entered to the SAP
using <bdc_tab> mode <mode> system and stores the data in the batch input
update <update > method. session.

When the prgm has finished creating the


session, we can run the session thro the TC
SM35. This method involves FM like
BDC_OPEN,BDC_INSERT,BDC_CLOSE

In Call Transaction, the Whereas in Batch Input Sessions, the ABAP


transactions are triggered at the program creates a session with all the
time of processing itself and so the transactional data, and this session can be
ABAP program must do the error viewed, scheduled and processed (using
handling. Transaction SM35) at a later time. The latter
technique has a built-in error processing
mechanism too.

Synchronous Processing Asynchronous Processing


We can update the database both Synchronous Database update.
synchronously and asynchronously.
We can specify the mode in the During processing, no transaction is
program. started until the previous transaction has
been written to the database.

No batch input processing log Detailed Log will be generated for all the
sessions

While execution it starts from the While executing it wont start from the first. It will
first. start from the place where it ends with error.

Faster than session method Not as fast as call transaction method

37. If you have 10000 records i your file, which method you use in BDC?
38. what are diffrent modes and explain them?

Synchronous and Asynchronous are for update.

Modes A, N, E are processing modes,

If you use 'A' : While processing it will take you to all the screens for that transaction.

If you use 'N' : While processing it will not take you to all the screens for that transaction(NO screens will be
available).

If you use 'E' : While processing if any error occurs only that screens will be visible.
39. what are control events in a loop?

1. AT NEW f.

2. AT END OF f.

3. AT FIRST.

4. AT LAST.

5. AT fg.

40. what are the events we use in dialog programming? and explain them?
41. what are the differnces between se01 , se09 and se10?

SE01 especially for administrative purpose means administrator can achive all the tasks from here

SE09 is for workbench requests related to develpors to make the changes

SE10 for customizing requests related to business analysts.

42. what is the inside concept in select-options?


43. what is client?

Definition - What does Client mean?

In the SAP landscape, a client is an entity with independent information and data. The SAP client
concept is based on the fact that an application service provider (ASP) must provide and administer
all resources at a minimal cost, which is quite challenging in a multiple customer-client environment.

SAP provides the option of allocating each customer to a client, thereby removing the need to
provide separate physical systems for each customer. This helps reduce physical hardware and
sharing of hardware and related software, thereby reducing administration and support requirements
and facilitating clients and a large number of customers.
44. what is get cursor field?

AT LINE SELECTION is basically used when you are displaying in the Interactive reports. This is used once the
BASIC list is generated.

GET CURSOR FIELD is used to capture the cursor field in the output list and it is stored in the Field value " FVAL ".

REPORT ZTESTING.

tables : vbak, vbap.

data : begin of it_vbak occurs 0,

vbeln like vbak-vbeln,

auart like vbak-auart,

erdat like vbak-erdat,

end of it_vbak.

data : begin of it_vbap occurs 0,

vbeln like vbap-vbeln,

posnr like vbap-posnr,

matnr like vbap-matnr,

end of it_vbap.

data : fnam(30), fval(50).


select-options : s_vbeln for vbak-vbeln.

START-OF-SELECTION.

select vbeln auart erdat from vbak into corresponding fields of table it_vbak where vbeln in s_vbeln.

if not it_vbak[] is initial.

select vbeln posnr matnr from vbap

into corresponding fields of table it_vbap

for all entries in it_vbak where vbeln = it_vbak-vbeln.

endif.

END-OF-SELECTION.

loop at it_vbak.

write : / it_vbak-vbeln,

it_vbak-auart,

it_vbak-erdat.

endloop.

write : /.
at line-selection.

if sy-lsind = 1.

get cursor field fnam value fval.

CONDENSE FNAM.

CONDENSE FVAL.

data: lv_vbeln like vbap-vbeln.

lv_vbeln = fval.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = lv_vbeln

IMPORTING

OUTPUT = lv_vbeln.

if fnam = 'IT_VBAK-VBELN'.

loop at it_vbap where vbeln = lv_vbeln.


write : / it_vbap-vbeln,

it_vbap-posnr,

it_vbap-matnr.

endloop.

endif.

endif.

45. what is read line?

Effect

This statement assigns the content of a row stored in the list buffer to the system field sy-lisel, and
allows other target fields to be specified in result. In addition, all values for this row stored
with HIDE are assigned to the respective variables.

The row to be read is specified with the addition LINE or with CURRENT LINE.

46. what are the diff. between call screen and leave screen?
47. what is the transaction code for Table maintenance?
48. what are the differences between CALL SCREEN , LEAVE SCREEN ?
49. Interactive Reporting.
what is the event that in used in classic reporting and cannot be
used in interactive reporting?

50. which process is faster call transaction or session method?


51. Whether background process or frontend process is faster in
uploading data?
52. how to handle errors in background process?

Messages in background processing


In background processingall messages with the following exception are handled according to the type
specified in the MESSAGEstatement. Only during list processingis a message of type "W" converted into a
message of type "E" before the actual processing.

A message is not displayed, but instead is written as follows to the background processing log (Joblog)
depending on the message type:

Messages of type "S" are written to the log and the program is continued.

Messages of type "I" and "W" are written to the log and the program is continued. The user
input Enter, which is required to continue the program, is generated automatically.

Messages of type "E" and "A" are written to the log. A check is then performed and if applicable,
the message is handled with error_message. If this is not the case, the message is also written
to the log with message number 564 of the message class 00 and current background processing
is interrupted, whereby a message of type "A" executes a database rollback. When the message
is processed, background processing is continued.

COLLECT is a statement which is similar to APPEND, the differences are :

The COLLECT statement checks weather the work area record already exists with
same key field value (the key field must be of type C, N, D, T).

If yes, it will add the numerical fields to the existing record.

If no, it will append or add a new record.

53. BDC type questions???? What could they ask?

More good abap interview questions


************Emerald solutions**********
1) NAST
2) TRANSACTION WE20 / WE21 FOR?
3) DIFFERENCE BETWEEN
V1 TYPE D and V1 like sy-datum.
4) what is stack list?
5) How many Modules can be called?
6) How to create checkbox in write statement?
Ans: WRITE AS CHECKBOX.
Eg. DATA: flag1(1) TYPE c VALUE ' ',
flag2(1) TYPE c VALUE 'X',
flag3(5) TYPE c VALUE 'Xenon'.
WRITE: / 'Flag 1 ', flag1 AS CHECKBOX,
/ 'Flag 2 ', flag2 AS CHECKBOX,
/ 'Flag 3 ', flag3 AS CHECKBOX.
7) How to upload file at Application Server?
8) How to directly jump to 15th list from Basic list?
Ans. Sy-lsind = 0.
9) If a view consists of only one table then is the view
Read only or Read-Write.
10)What is Node?
*********** Patni **************
11) Smartform: Can u create template in table?
12) What is true about Check field and Validation table field
a)Both must hv same name.
b) Both must hv same domain name.
c) Both must hv same data element.
13) Can data be transferred from SAP to non-SAP system through LSMW?
14) hide one of the field on the selection screen.
a) Screen-Active = 1 & Screen-Input = 1
b) Screen-Active = 1 & Screen-Invisible = 1
c) Screen-Invisible = 1 & Screen-Active does not matter.
d) Screen-Invisible = 0 & Screen-Active does not matter.

15) Data : data_pattern(5) Value ABC,


data_str(12) Value abcdeABCDE.
Replace data_pattern with 12345 into data_str.
Data_str = ?
Ans: Data_str = abcde12345DE.
16) Which stmnt bypasses Buffering (correct option can be more than one)
a)Select.
b)Selectinto..
c) Select..distinct..
e) Selectfor update..
17) How do we handle EXCEPTIONs in ABAP?
18) Authorization takes place when: (NOT SURE OF OPTIONS)
a) during SELECT. (ans: NO)
b) AUTHORITY-CHECK IS WRITTEN.
c) System Administrator checks for the authorizations taken.

) NAST message status table

2) TRANSACTION WE20 / WE21 FOR?


we20 partner profile
we21 port

3) DIFFERENCE BETWEEN
V1 TYPE D and V1 like sy-datum.
v1 : when date is assigned then not formated .format is ddmmyyyy.
v2 : when date is assigned then formated .format is dd.mm.yyyy.

4) what is stack list?


the list in which screen numbers are stored.can be up to 9 screens.

5) How many Modules can be called?


not getting the question....

6) How to create checkbox in write statement?


Ans: WRITE AS CHECKBOX.
this is ok..
this is how u do it..
Eg. DATA: flag1(1) TYPE c VALUE ' ',
flag2(1) TYPE c VALUE 'X',
flag3(5) TYPE c VALUE 'Xenon'.
WRITE: / 'Flag 1 ', flag1 AS CHECKBOX,
/ 'Flag 2 ', flag2 AS CHECKBOX,
/ 'Flag 3 ', flag3 AS CHECKBOX.
flag1 - checkbox will be written after flag 1 and will be blank.
flag2 - checkbox will be written after flag 2 and will be checked.
flag3 - checkbox will be written after flag 3 and will be checked with only length of 1 character.other 4
characters will be ignored. And since 1st character is X it will also be checked.But if the 1st character is
anything other than X that is even ' ' it will keep box as blank.
imp note : and next time dont ask such silly questions.

7) How to upload file at Application Server?


open dataset for output/appending.

8) How to directly jump to 15th list from Basic list?


Ans : sy-lsind = 15 .

9) If a view consists of only one table then is the view


Read only or Read-Write.
i dont know read only or read-write only...
but it is projection view and they are read only or read and change..
more abt views :
projection view : no joining since single table .
maintaince : outer join data can be maintained.
help view : outer join.

10)What is Node?
a node can be a root node or child node in LDB( logical data base ) and it has to be either database table or
a dictonary type. otehr 2 are there but only for your information pourpose..
data types and dynamic type nodes.

11) Smartform: Can u create template in table?


i m not gettign in....under table node templet can be created...line type of templets can be created using
table..but in table i dont know....
I know the answer is no. u cant..
12) What is true about Check field and Validation table field
0answer : the domain of both the fields should be same
a)Both must hv same name.
b) Both must hv same domain name. (this is correct)
c) Both must hv same data element.

13) Can data be transferred from SAP to non-SAP system through LSMW?
ya it can be ..but for that idocs are to be used.

14) hide one of the field on the selection screen.


ANSWER : SCREEN-ACTIVE = 0 .
Screen-Active = 1 & Screen-Input = 1
Screen-Active = 1 & Screen-Invisible = 1
Screen-Invisible = 1 & Screen-Active does not matter.
Screen-Invisible = 0 & Screen-Active does not matter.
15) Data : data_pattern(5) Value ABC,
data_str(12) Value abcdeABCDE.
Replace data_pattern with 12345 into data_str.
Data_str = ?
Ans: Data_str = abcde12345DE.

16) Which stmnt bypasses Buffering (correct option can be more than one)
a)Select.
b)Selectinto..
c) Select..distinct.. passes buffering .
Selectfor update..

17) How do we handle EXCEPTIONs in ABAP?


by checking sy-subrc values .

18) Authorization takes place when: (NOT SURE OF OPTIONS)


abap program is executed .
authority-check statement is used.
rest all rubbish....
during SELECT. (ans: NO)
AUTHORITY-CHECK IS WRITTEN.
System Administrator checks for the authorizations taken.

important topics in abap interview


1. How data is stored in cluster table?
Each field of cluster table behaves as tables which contains the no. of entries.
2. What are client dependant objects in abap/sap?
SAP Script layout, text element, and some DDIC objects.
3. On which even we can validate the input fields in module programs?
In PAI (Write field statement on field you want to validate, if you want to validate group
of fields put in chain and End chain statement.)
4. In selection screen I have three fields, plant mat no and material group. If I input plant
how do I get the mat no and material group based on plant dynamically?
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' to get material and material
group for the plant.
5. How do you get output from IDOC?
Data in IDOc is stored in segments; the output from IDoc is obtained by reading the data
stored in its respective segments.
6. When top of the page event is triggered?
After executing first write statement in start-of-selection event.
7. Can we create field without data element and how?
In SE11 one option is available above the fields strip. Data element/ direct type.
8. How do we debug sapscript?
Go to SE71 give lay set name, go to utilities select debugger mode on.
9. Which transaction code can I used to analyze the performance of ABAP program.
TCode AL21.
10. How can I copy a standard table to make my own z_table.
Go to transaction SE11. Then there is one option to copy table. Press that button. Enter
the name of the standard table and in the Target table enter Z table name and press enter.
ABAP Frequently Asked Question
ABAP/4
Q: When we create a customer the information is updated in structure RF02D and the
some tables like KNA1 are updated. How can we find the tables for master data
transactions?
A: Go to ABAP Workbench -> Overview -> application hierarchy - SAP -> follow the
customizing based tree for your application. Double click on a lowest hierarchy level to
get for the correct marked development class. Here you can find all the tables, views,
logical databases etc. used for a system operation.
SapScript
Q: We get the total number of pages as expected by using 'SAPSCRIPT-FORMPAGES' in a
duplex layout. In our case duplex case is always 'Terms & Conditions'. We do not want the
number of pages as in duplex printing. What is the best possible solution?
A: On the Terms & Conditions page, Change the Page counter mode to 'HOLD' to keep the
page counter from incrementing when you print the Term & Conditions.




SAP SCRIPT
Operations on the whole SAPscript form and concepts

How can I debug my SAPscript?

Go to the transaction SE71.


Enter the form name.
Choose the menu Utilities->Activate Debugger to enable debugging.

Or call standard program RSTXDBUG.

To stop debugging, you must print the SAPscript form, and click Exit button in the debugger window when it is displayed.
I have created a SAPscript in language DE. Now I need to translate it
to EN. How could I do this?

Open your SAPscript in transaction SE71.


In the Header screen, in the Language Attributes Option, choose Translate to... Option to translate to other languages.

If any text modules or texts have to be translated within the SAPscript, then it can be done using SE63 transaction.

How can I copy SAPscripts from one client to another, or export/import


them?

In the transaction SE71, enter the Form name and choose the menu, Utilities->Copy from client to copy SAPscripts from one
client to another.

Use RSTXSCRP to import/export SAPscripts.

How can I change the page size of the layout?

In the SAPscript, Goto -> Header -> Basic Settings


Here you could configure the page settings and their orientation.

How to find the Driver Program for the given SAPscript?

1. Go to the Table TNAPR using SE11

2. Get the Contents of the Table(CNTRL+SHIFT+F10)

3. On the Table Content Selection Screen, Type the SAPscript Name for which we have find the Driver Program in
the field FONAM and execute(F8)

4. PGNAM field of the result display contains the Driver Program Name for our SAPscript

How can I get the landscape format in SAPscript?

In the form go to basic settings--> you can find a landscape option --> click on it and at the bottom. You can find the page
option enter the page name for which you want to assign ladscape format.

How many MAIN windows are allowed for SAPscript?

SAPscript allows 99 MAIN windows


Each Page can consists up to 99 windows. Each main window is assigned a consecutive
identifying number (0..98).

This is mainly used for label printing or address printing.

Is it possible to create a SAPscript without a main window?

(this can be used for static forms which always print the same number of pages)
Yes, but you must call WRITE_FORM function module at least once (even with a non-existing element or window!)
If there is more than one page, you may need to force the next page to be printed by calling CONTROL_FORM function
module with command NEW-PAGE (PAGE2 for example)

Where are the SAPscript form names?

Table STXH, with field values tdobject = 'FORM' and tdid = 'TXT' and tdname = form name

How to assign own form to a standard print program?

Most of applications use NACE transaction, but there are also Print Workbench, Post-Processing Framework.

How to convert a sapscript to Smart Form?

Start SMARTFORMS transaction, Goto Menu path Utilities -> Migration -> Import SAPscript Form.

To mass migrate, use the following:

1. Execute the program SF_MIGRATE.

2. Select the names and the language of the SAPscript forms and choose Execute.
The system creates the Smart Forms under the names of the SAPscript forms plus the extension _SF.
It displays a list of the migrated forms.

3. To change and adapt a form, go to transaction SMARTFORMS. Then activate the changed Smart Form.

What are the different types of windows in SAPscripts?

Windows are defined in the Layout sets which define the position and the text to displayed.

The different types of windows are:

MAIN - Main Window


The main window is a continous window which can extend over several pages. If the text in the main window fills up a page,
a new page is created.
Only one main window can be defined in the SAPscript whereas up to 100 instances of main window can be created in a
page.

VAR - Variable Window


This window can have the variable contents displayed on them. The contents of the window cannot exceed the window size.
The content can be formatted for each page.

CONST - Constant Window


The constant window can have a fixed content and is formatted only once.

Elements

How do I create Boxes in SAPscript?

You can create Boxes in the SAPscript using the BOX command specifying the x,y co-ordinates and the width and the height

/: BOX XPOS '0' CM YPOS '0.5' CM WIDTH '9.2' CM HEIGHT '3.5' CM FRAME 8 TW

How can I create a Shaded box?

Use the addition INTENSITY in the BOX command to apply gray shading to the boxes.

/: POSITION XORIGIN '2' CM YORIGIN '7.5' CM

/: BOX WIDTH '18' CM HEIGHT '1.25' CM INTENSITY 15

This will create a box with the given height and width and shading it with 15% intensity (you also need to provide X,Y
positions).

How do I set tabs between the fields in display?

To enter a tab, use ,, (2 commas). Then, in the Paragraph Format tab, create a new paragraph format. In the "Tabs" Tab,
enter the tab position and the alignment for the fields.

How do I create standard texts for the SAPscripts?

You can create standard texts using the transaction SO10. Then to insert these standard texts in the SAPscript choose the
menu, Insert->Text->Standard and choose the standard text that you want to choose.

Alternatively, you can display standard texts in your SAPscripts using the command:
/: INCLUDE ZSTEXT OBJECT TEXT ID ST LANGUAGE EN

where ZSTEXT refers to the Standard Text name.

How can I Word Wrap the text being displayed in SAPscript?

Use the Function Module RKD_WORD_WRAP to wrap the text and use this for output.

How can I display barcodes in SAPscripts?

Create a character format in the SAPscript.


Choose the Bar Code for the character format.

And finally to display barcodes, in the command enter:

<C1>&vbeln&</>

where C1 is the character format created and vbeln is the variable for which the barcode is to be created.

How can I print logos in SAPscripts?

TIFF files (*.tif):

Use the program RSTXLDMC to convert the TIFF file to standard text.

Print this using the INCLUDE command:

INCLUDE ZLOGO OBJECT TEXT ID ST


Bitmap files (*.bmp)

Go to transaction SE78

Choose BMAP under GRAPHICS

Choose Import Graphic (F5)

Select the image and upload

In SE71 choose Insert->Graphics and then choose the image for display
How can I prevent page-break in the message that is to be displayed?

Enclose the text that you want to prevent page-break in PROTECT... ENDPROTECT
SAPscript will ensure that each line of this text is printed together on the same page.

Ie.If SAPscript finds that the text cannot be printed on that page completely a implicit page break occurs and the text is
printed on the next page

/: PROTECT

* Text

* Within

* The same page

/: ENDPROTECT

What are the various text formatting options in SAPscript?

SAP Library - SAPscript - Formatting options

Formatting Meaning Comment


option

&symbol(N)& Display N first characters


of symbol

&symbol(Z)& Omit leading zeros

&symbol(S)& Omit leading sign

&symbol(<)& Display leading sign to forum: Ignored if the domain has "sign" option disabled (sign is never printed in
the Left (you may also use that case)
/: SET SIGN LEFT)
Formatting Meaning Comment
option

&symbol(>)& Display leading sign to forum: Ignored if the domain has "sign" option disabled (sign is never printed in
the right (you may also that case)
use /: SET SIGN RIGHT)

&symbol(C)& Compress spaces

&symbol(.N)& Display upto N decimal Do not use a field related to a currency code or unit of measure (as these last
places define the number of decimals), otherwise you'll get error SSFCOMPOSER602
(Field &2: Incorrect formatting option "&1") while outputting the form

&symbol(T)& Omit thousands separator

&symbol(R)& Right justified

&symbol(I)& Suppress output of the


initial value

&symbol(K)& Ignore conversion routine forum: "K option works only for Character-like variables (char, date, time,
numc), string and Integer. It doesn't work for packed, float and other types (see
routine CONVERT_SYMBOLVALUE in include LSTXVFCD)"

You may combine options, for example: &symbol(8R)& which means right-aligned inside 8 characters

Which are frequently Used System Variables in SAPscript?

&DATE& Currentdate
&DAY& Day

&MONTH& Month

&YEAR& Year

&TIME& Time of the day

&HOURS& Hours

&MINUTES& Minutes

&SECONDS& Seconds

&PAGE& Page

&NEXTPAGE& Next page number

&SPACE& Blank

&ULINE& Underline

&VLINE& Vertical line


&NAME_OF_MONTH& Name of the Month

&SAPSCRIPT-FORMPAGES& Total number of pages in currently formatted layout set

&SAPSCRIPT-JOBPAGES& Total number of pages in currently formatted print request

For more information:

SAP Library - SAPscript - System Symbols

SAP Library - SAPscript - General SAPscript Fields

How can I format the date being displayed in the SAPscript?

The date fields in SAPscripts can be formatted using the SET DATE MASK control command.

/: SET DATE MASK = 'MMMM DD, YY'

This displays the date as : September 26, 07

The following are the codes that can be used in the date mask:

YY Year (2 digits)

YYYY Year (4 Digits)

MM Month (2 Digits)

MMM Month Name (Abbreviated)


MMMM Month Name (Full)

DD Day as two digits

DDD Day name (Abbreviated)

DDDD Day name

Using the SET DATE MASK causes the subsequent date fields to be displayed using the same formatting. To return to the
default formatting use the following command:

/: SET DATE MASK = ' '

For more information, see SAP Library - SAPscript - Formatting Date Fields: SET DATE MASK

How can I format the time in the SAPscript?

Similar to SET DATE MASK for date fields we can use SET TIME MASK for formatting time fields.

/: SET TIME MASK = 'HH hrs MM min SS sec'

This displays the time as : 11 hrs 43 min 37 sec'

The following are the codes that can be used in the time mask:

HH Hours

MM Minutes

SS Seconds
The time formatting can be reset to the default setting using:

/: SET TIME MASK = ' '

For more information, see SAP Library - SAPscript - Formatting Date Fields: SET TIME MASK

What is the difference between the SAPscript texts, 'Customer


&KNA1-KUNNR&' and '&Customer KNA1-KUNNR&'?

In the first case of 'Customer : &KNA1-KUNNR&', the text 'Customer : ' is displayed regardless of the variable
KNA1-KUNNR even if it has initial value

In the second case of '&Customer : KNA1-KUNNR&', the text 'Customer :' and KNA1-KUNNR is displayed only
when the variable KNA1-KUNNR has non-initial value
For more information, see SAP Library - SAPscript - Formatting options - Preceding and Subsequent Texts (Pre-Text / Post-
Text)

What is the use of the POSITION and SIZE command in SAPscripts?

The POSITION command is used to x, y coordinate position which is used by the BOX command. The offset from the
current window positions are specified which could be either positive or negative.

/: POSITION XORIGIN '2' CM YORIGIN '-1.5' CM

Similarly the SIZE command sets the width and height parameters.

/: SIZE WIDTH '10' TW HEIGHT '10' TW

Control commands

How to Use the New-Window Command?

You can use the NEW-WINDOW command to call the other main window explicitly in the form, even if the current main
window is not full. We can create upto 99 Main Windows. This Main windows are generally used to create labels or to write
Addresses.Need to write this in the Main window.

/: NEW-WINDOW
How can I trigger new page in SAPscripts?

Use the command NEW-PAGE to trigger a new page in SAPscript.

/: NEW-PAGE

You can explicitly trigger a page not in sequence by specifying the name pf page with the command NEW-PAGE

/: NEW-PAGE <pagename>

How can I set the header and footer in the main window?

The TOP...ENDTOP and BOTTOM...ENDBOTTOM commands are used to set the header and footer texts in the main
window respectively.
These texts will be displayed on the start and end of every new page in the output.

To disable these texts enclose empty commands between the commands.


Eg.:

/: TOP

/: ENDTOP

What the conditional statements used in SAPscripts?

The following conditional statements are used in SAPscripts:

/: IF...ELSE/ELSEIF...ENDIF

/: CASE...ENDCASE

What is filter BADI.

Based on filter values, you can have different implementations of the same BADI. For example, if you have company
code as filter, these can be handled by different development teams belonging to the respective company code to suit
their individul requirements.
Text Tables
Use
You create text tables when you want to store explanatory text in several languages. It is not
advisable to store such texts in your primary table. You can make a text table that must
comprise the key of the primary table (for more information, see the example below). Every
text table must also have an additional language key field (field of data type LANG).

Delivery Class
Use
You use the delivery class to control the transport of table data for an installation, upgrade,
or client copy and transports between customer systems. The delivery class is also used in
the extended table maintenance.

Features
There are the following development classes:

A- Application table (master and transaction data).

C- Customer table, data is only maintained by the customer.

L- Table for storing temporary data.

G- Customer table, SAP can insert new data records but cannot overwrite or delete
existing ones. The customer namespace must be defined in table TRESC. To define the
customer namespace use reportRDDKOR54. You can start it directly from the table
maintenance by choosing Maintain Customer Namespace on the Delivery and
Maintenance tab.

E- System table with its own namespace for customer entries. The customer namespace
must be defined in table TRESC. To define the customer namespace use
report RDDKOR54. You can start it directly from the table maintenance by
choosing Maintain Customer Namespace on the Delivery and Maintenance tab.

S- System table, data changes have the status of program changes.


W- System table (for example table of the development environment) whose data is
transported with its own transport objects (such as R3TR PROG, R3TR TABL and so on).

Behavior During Client Copy


Only the data of client-dependent tables is copied.

Class C, G, E, S- The data records of the table are copied to the target client.

Class W, L- The data records of the table are not copied to the target client.

Class A- Data records are only copied to the target client if explicitly requested
(parameter option). It is not sensible to transport such data, but this is supported
nevertheless to allow the entire client environment to be copied.

Data Class
Use
If you choose the data class correctly, your table is automatically assigned to the
correct area (table space or DB space) of the database when it is created. Each data
class corresponds to a physical area in which all the tables assigned to this data
class are stored.

There are the following data classes:

APPL0 (master data):

Data that is seldom changed. An example of master data is the data contained in an
address file, such as the name, address and telephone number.

APPL1 (transaction data):

Data that is frequently changed. An example of transaction data is the goods in a


warehouse which change after each purchase order.

APPL2 (organizational data):

Customizing data that is defined when the system is installed and seldom changed. An
example is the table with country codes.

Two further data classes, USR and USR1, are provided for the customer. These are
for user developments. The tables assigned to these data classes are stored in a
table space for user developments. In the following figure you can see tables
assigned to different data classes. The figure presents the tables in the ABAP
Dictionary and in the database.

Text Modules
Use
You use text modules to centrally store texts in the system that you frequently use in forms.
This detaches the text maintenance from the form maintenance so that you need not call
the

Form Builder to edit individual texts.

Features
SAP Smart Forms provide a text module maintenance function that allows you to create and
edit text modules. Similar to text nodes, text modules have the following characteristics:
They can be used cross-client
They are connected to the transport system
They are connected to the translation tools in the system
Sy-TABIX : SY-TABIX is a syatem variable which stores the
index current processing record of an internal table.

SY-INDX : SY-INDEX is a system variable which acts as a


loop iteration counter, it stores loop iteration number.

How to attached f4 help in parameter


TABLES : MARA.
DATA: BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF IT_MARA.

DATA : IT_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.


PARAMETERS : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.


SELECT MATNR FROM MARA UP TO 10 ROWS INTO TABLE IT_MARA.
SORT IT_MARA BY MATNR.
DELETE ADJACENT DUPLICATES FROM IT_MARA COMPARING MATNR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
RETFIELD = 'MATNR'
DYNPPROG = SY-REPID
DYNPNR = '1000'
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_MARA
RETURN_TAB = IT_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.

IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
How can we create a button is selection screen.

SELECTION-SCREEN :
FUNCTION KEY 1.
SELECTION-SCREEN :
FUNCTION KEY 2.
INITIALIZATION.

DATA : func_text TYPE smp_dyntxt.


CLEAR func_text.
func_text-text = 'DISPLAY DATA'.
sscrfields-functxt_01 = func_text-text.
CLEAR func_text.
func_text-text = 'DELETE DATA'.
sscrfields-functxt_02 = func_text-text.

Creating a Custom Container


A custom container is a control into which you can place other controls. It allows the screen
framework to resize and compress controls at runtime.

What are the tools of abap development workbench


1. ABAP DICTIONARY
2. ABAP EDITOR
3. CLASS BUILDER
4. FUNCTION BUILDER
5. SCREEN PAINTER
6. MENU PAINTER
7. OBJET NEVIGATOR
8. ABAP TEXT ELEMENT
9. MAINTAIN TRANSACTION.

What are the testing tools of abap development workbench.

1. ABAP DEBUGGER.
2. ABAP RUNTIME ANALYSIS.
3. PERFORMANCE ANALYSIS.
https://www.sapnuts.com/faq/what-is-the-use-of-folder-in-smartforms.html

Just to group nodes, dosen`t effect any functionality, we can


group nodes into a folder.

what is the event that will be triggered first in an ABAP report?

What are the differences between simple and interactive ABAP reports?

Types of ABAP reports in SAP?

How many lists can be displayed through an interactive report?

Maximum 21 lists can be displayed (1 basic list 20


secondary lists).

what are the events in interactive reporting?

What is the length of function code at user-command?

Each menu function, push button, or function key has an


associated function code of length FOUR (for example,
FREE), which is available in the system field SYUCOMM
after the user action.

What is an ABAP/4 Query in SAP?


What are internal tables?

Type of parameters to pass to RFC pass by value or pass by referance ?

How the values will be passed to RFC Function module PassbyValue or Passbyreference?

Select up to 1 row and select single difference ?

How to Debug RFC Function module?

Control break events in ABAP?

1. AT-FIRST: This is used when we want to execute the


statements before records are processed.

2. AT-LAST: This event is used when we want to execute


the statements after all records are processed.

3. AT-NEW: This event is used when we want to execute


the statement before group of records are processed.

4. AT-END: This event is used when we want to execute


the statements after processing of group of records.

WHAT IS THE DIFFERENCE BETWEEN ABAP MEMORY AND SAP MEMORY?

WHAT IS AN INTERNAL TABLE? EXPLAIN THE DIFFERENT TYPES?

What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN


OUTPUT?

What is the difference between SY-INDEX and SY-TABIX?


What is the difference between PASS BY VALUE and PASS BY REFERENCE?

These concepts are generally used for Function modules


or Subroutines etc. and their meaning can be taken
literally.
Say we are passing a variable lv_var:

CALL FUNCTION 'DEMO_FM'


EXPORTING
VAR = lv_var.

When we PASS lv_var by VALUE , the actual value of


lv_var is copied into VAR.
When we PASS lv_var by REFERENCE , the reference or
the memory address of lv_var is passed to the Function
module. So VAR and lv_var will refer to the same memory
address and have the same value

What will you use SELECT SINGLE or SELECT UPTO 1 ROWS?

How to transport variants in SAP ABAP?

We use RSTRANSP program to transport variants in SAP


ABAP, go to SE38, provide RSTRANSP execute, provide
program name, variant name, execute create transport

How to create checkbox in selection-screen using write statement?


What are local objects in SAP?

Local objects (Dev class$TMP) are independent of


correction and transport system.

What are subroutines in SAP Programs?

Subroutines are program modules, which can be called


from other ABAP/4 programs or within the same program.

What is the difference between SY-TABIX and SY-INDEX?

What are conversion routines in SAP ABAP?

What is Modularization and its benefits?

If the program contains the same or similar blocks of


statements or it is required to process the same function
several times, we can avoid redundancy by using
modularization techniques. By modularizing the ABAP/4
programs we make them easy to read and improve their
structure. Modularized programs are also easier to
maintain and to update.

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 in SAP?

Function Group is a collection of function modules that


shares global data with each other.
When an ABAP/4 program contains a CALL FUNCTION
statement, the system loads the entire function group in
with the program code at run time. Every function module
belongs to a function group.

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

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

How to transport text elements in SAP ABAP?

If is is first time, they will automatically transport along with


the program, if you change them next time, it will ask for
TR, you can move that TR

What are the types of parameters in the function modules?

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

What is the difference between Leave Transaction and Call Transaction?

In contrast to LEAVE TO TRANSACTION, the CALL


TRANSACTION statement causes the system to start a
new SAP LUW. This second SAP LUW runs parallel to the
SAP LUW for the calling transaction.

Which event is executed first at-selection-screen or at-selection-screen-output in sap abap?

What is the use of Folder in Smartforms ?

what is extension in and extension out in BAPI ?

BAPI extension is used to update custom fields of a table


(ex: MARA).
BAPI extension out is used to retrieve custom fields of a
table

In interactive report if user 19 times double clicked, again he want to main screen.. how can
do this?
If Sy-ucomm ='BACK'. Leave to screen 0. Endif.

What is the difference in a Table and a Template in Smartform?

Table display dynamic data, whereas template display static data.

Can you move a Smartform from one SAP system to another without using transports?

Yes, this can be achieved using the Upload/Download


feature for Smartforms. One can download the Smartform
from one system and save it as an XML file. Once that is
done, the XML file can be used to upload the Smartform in
another system.

Can you have a Smartform without a main window?

How do you find the name of the Function Module for a Smartform?

On which event we can validate the input fields in module programs?

In PAI (Write field statement on field you want to validate, if


you want to validate group of fields put in chain and End
chain statement.)

In selection screen I have three fields, plant mat no and material group. If I input plant how
do I get the mat no and material group based on plant dynamically
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
MATERIAL.
CALL FUNCTION ->
F4IF_INT_TABLE_VALUE_REQUEST to get material and
material group for the plant

When top of the page event is triggered?

After executing first write statement in start-of-selection


event.

How do we debug sapscript?

What is the use of FOR ALL ENTRIES


?

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.
To avoid nested select statements we use SELECT FOR ALL
ENTRIES statement. Performance wise SELECT FOR ALL
ENTRIES is better to use.
Details For all Entries in SAP ABAP

What are field symbols in SAP ABAP?

Field symbols are like pointers in C that can point to any


data object in ABAP/4 and to structures defined in ABAP/4
dictionary. All operations you have programmed with the
field symbol are carried out with the assigned field.

Can you have a Smartform without a main window?

Yes, you can create a Smartform without a Main Window.


But there is no need to do anything of such sort. Whenever
you create a Smartform, a main window is created by
default.

How do you find the name of the Function Module for a Smartform? When is this function
module created?

The function module for Smartform is created when the


Smartform is activated. You can find the name of the
Function Module for a Smartform by going to Environment
--> Function Module Name.

What is a Final Window in smartforms?

Final Window is called after all the other windows are


called in a Smartform.

I have 1 basic list and 15 secondary list in interactive report. If i am in 9th list, how can i come
directly to the basic list?

System variable sy-lsind stores the list number, by using


this we can go to basic list.

I have a Ztable, I wants to add one more field to the table without disturbing previous data,
what should I do ?

While adjusting database table in SE14, select 'Save Data'


radio button .

Can we sort internal table without using SORT statement ? Explain ?


We can sort internal table without using SORT statement
by declaring sorted internal table . ex: DATA : IT_MARA
TYPE SORTED TABLE OF MARA

What are dynamic modifications of a screen? explain?

Dynamic modifications are changing the


screen(hiding/enabling/disabling etc of screen elements)
based on user actions, this can be done by using event AT-
SELECTION-SCREEN OUTPUT.

Difference between select option and ranges in


SAP ABAP ?
Added on June 22nd 2015 by Ashok Kumar Reddy

The main difference between select option and ranges is that


ranges implicitly or automatically creates internal table with
fields like OPTION,LOW,HIGH,SIGN,etc . Where as in case of
select option we have to explicitly create internal table.
When you declares a select options it will implicitly declare an
internal table (ranges) for you.

While using RANGES syntax u can declare internal table


explicitly.

The only need of declaring ranges is when you are not taking
input from the user but you want make limit based selection at
that time it will be use full e.g. SELECT ** from ** where MATNR
in val_range .

Vous aimerez peut-être aussi