Search this site

Monday, December 27, 2010

Blocking Selection Screen

•Example
– SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-002.
PARAMETERS vendor RADIOBUTTON GROUP gr1.
PARAMETERS customer RADIOBUTTON GROUP gr1.
PARAMETERS material RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK rad1.

Positioning in the Selection Screen

• To position the next parameter or comment on the selection screen, the
POSITION option is used.
• Syntax
– SELECTION-SCREEN POSITION .
• For , you can specify a number, POS_LOW, or POS_HIGH.
• To create a logical block of elements on the selection screen, mark the
beginning of the block with the BEGIN OF BLOCK option of the
SELECTION-SCREEN statement, then define the individual elements and
mark the end of the block with the END OF BLOCK option as shown below:
– SELECTION-SCREEN BEGIN OF BLOCK
[WITH FRAME]
[NO INTERVALS].
SELECTION-SCREEN END OF BLOCK .
• Blocks can be nested.

Elements on a Single Line

• To position a set of parameters or comments on a single line on the selection
screen, the elements are declared in a block enclosed by the following two
statements:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN END OF LINE.
Example
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) text-001. “ Text Symbol for Title
PARAMETERS: p1(3), p2(5), p3(1).
SELECTION-SCREEN END OF LINE.

Specifying Blank Lines

• To produce blank lines, the SKIP option is used.
Syntax
– SELECTION-SCREEN SKIP [].
• To underline a line or part of a line, the ULINE option is
used.
Syntax
– SELECTION-SCREEN ULINE [[/]]
• To write text on the selection screen, the COMMENT option
is used
Syntax
– SELECTION-SCREEN COMMENT [/]
[FOR FIELD ]

Selection screen 2


Sunday, December 26, 2010

Selection screen

• Parameters cannot have data type F. The data type F is not supported in
the Selection Screen
• To suppress the display use NO-DISPLAY option
PARAMTER P_TELNO NO-DISPLAY.
• To make a parameter a required input field, the OBLIGATORY option of the
PARAMETERS statement is used.

Example:
REPORT ztraining.
PARAMETERS: value TYPE i DEFAULT 100,
name LIKE sy-uname DEFAULT sy-uname ,
date LIKE sy-datum DEFAULT sy-datum.

• To define a checkbox for parameter input, the option AS CHECKBOX of the
PARAMETERS statement is used.
Syntax
PARAMETERS

...... AS CHECKBOX.

• To define groups of radio buttons for parameter input, the RADIOBUTTON GROUP
option of the PARAMETERS statement is used.
Syntax
PARAMETERS

...... RADIOBUTTON GROUP .

Example
PARAMETERS: yes AS CHECKBOX,
no AS CHECKBOX DEFAULT 'X'
• Selection option:
SELECT-OPTIONS Statement
SELECT-OPTIONS FOR
NO EXTENSION
OBLIGATORY
LOWER CASE
SELECT-OPTIONS allows specification of multiple values and ranges. This can only
be declared for fields within tables defined in the TABLES statement.
Example
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr.



DATA Definitions

  • DATA Statement
DATA TYPE or LIKE VALUE DECIMALS
- All variables used within the ABAP/4 program must be declared with DATA
statements
- up to 30 characters in length, containing any characters other than
(, ), +, ., :
- Indicates the variable type

Example:
DATA: p_bukrs LIKE bkpf-bukrs.
DATA i_val TYPE i VALUE '99'.

  • TYPES Statement
TYPES TYPE or LIKE DECIMALS
SAP allows the creation of new user defined data types. And this does not
create a variable, BUT just a new type that can be used in creating a variable.

Example :
TYPES : cc LIKE bkpf-bukrs
DATA : c_cc TYPE cc.

Create view

1. Go to SE11. Choose 'views' option and click create.
2. Choose DB View
3. Save it in a Development class
4. In the Table column, enter the Table name on which you want to create view.
5. In the 'View Fileds' tab, enter the Table name and field nams in the respective columns and then save the view.
6. Check it and then generate the View.
7. Select 'Display Data' option from the Utilities menu and check whether the data has been loaded or not.

Saturday, December 25, 2010

Steps to create a structure

Sap script

What is Module programming(dialog programming) ?

Module pool programs are created in abap development work bench (TCODE: SE80).
Module pool programs are also called dialog programs.
The module Pool are reports prepared for different screens and to manage the sequence of events of these screens, in the transaction SE80 you can see all the dynpros that you have for this kind of report, add new ones, add all types of element to the report.
Process Before Output is the part of the dynpro code that is processed before the user can do anything with the data in the screen
Process After Input is the part of the dynpro code that is processed after the interaction with the user.
module pool programs are excuted using Tcodes

Modularisation

  1. Macros
  2. Include Program
  3. SubRoutines
  4. Function module
  5. File handling

Report

  1. Data definition
  2. Selection screen 1
  3. Selection screen 2

ABAP QUESTIONS FOR INTERVIEWS

  1. What are domains and data elements?

Saturday, December 11, 2010

What are the domains and data elements?

1)Domain consists of technical characterstics of a field.thay are data type and length.
Data element consists of field label and its length.Such AS:
DOMAINS : FORMAL DEFINITION OF THE DATA TYPES.THEY SET ATTRIBUTES SUCH AS DATA TYPE,LENGTH,RANGE. DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT.

2)Uses:
a)domains:
domains are the dictionary objects that are assigned with constants and data types

b)data elements:
data elements are dictionary objects that are assigned with the domains.
uses:

* data elements are used to create relation between tables.

* data elements are used to transfer the data from one R/3 to another R/3.

* to create search helps.

Steps to Creating domains, Data Elements, Tables

Steps to Creating domains, Data Elements, Tables
To give you the steps for creating table:.

There are two approach in creating a table.

1. Bottom-up approach
2. Top-down approach.

Both are valid and you can choose which approach is suitable for you. I always use the bottom-up approach. Here are the steps to create the tables with this approach.

1. SE11 will take you to the DDIC and enter the name of the new table to be created. Let us say Zname. Click create.

2. Enter the short discription of the table and enter the field of the table. If it is primary key and you have to check the box.

3. Enter the data element and double click it, you will be asked to save and will take you to data element discription page. Enter the short discription of the data element and enter the information of domain like the length of field and type of field.

4. If you wanted to use the existing domain then its fine, or else, you have to create one. Enter the domain name in the data element page and double click it. Page will ask to save and jump to domain creation page.

5. In the domain page, you have to save the information which you have already given in the data elements page and check it. Before going to data element page, you have to activate the domain.

6. Go to data element page and save, check and activate.

7. Go to main table page and save, check, and activate.

8. Also, you have to save the technical settings of the table.

The table is now ready for operation. You can use it in your program or you can use it to enter information.

Check table: It is the table which will have all the information about the Foreign keys which are the primary keys in the check table.

It can be created by creating the foreign key from the main table. Click foreign key in the main table and it will take you to a page which will ask for table name and field to which foreign key relation has to be associated. Enter the information and you can create the check table automatically.

SM30 is used for maintenance of the table, that is to realease the errors occured during the creation of the table.

Well, this is the information I have.




Friday, December 3, 2010

Objects of Data Dictionary

The basic objects of the ABAP Dictionary are tables, data elements, and domains. These form the active part of the ABAP Dictionary and contain all the field-related metadata of the R/3 System.
A field is not a dictionary object, but rather is a component of a table. A field cannot exist without a table and only has meaning within that particular table.
Data elements and domains are dictionary objects. Therefore, they can be used by many tables. They specify the characteristics of fields.

Tables are the objects that actually hold the information in a database. They consist of rows (records) and columns (fields).
For example, table KNA1 stores information about customers. Some of the columns in KNA1 are KUNNR (customer ID number), NAME1 (customer name), and ORT01 (customer city). Each row in KNA1 stores this information for a different customer.
Certain fields in a table are specified as the primary key of that table. The primary key is that field or combination of fields that uniquely identifies a row in the table. In table KNA1, the SAP R/3 client (MANDT) and the customer number (KUNNR) form the primary key.

The database utility provides the interface between the ABAP Dictionary and the underlying database management system (DBMS). It supports the creation of tables and secondary indices in the database both online and in the background.
Whenever you make a change to a dictionary object that affects the underlying database, the database utility is activated. Usually it works silently behind the scenes, but occasionally the database utility will prompt you for information. This occurs when an error is encountered or when existing data must be converted.
The database utility provides the interface to the DBMS by automatically generating the Data Definition Language (DDL) that the DBMS understands.The basic objects of the ABAP Dictionary are tables, data elements, and domains. These form the active part of the ABAP Dictionary and contain all the field-related metadata of the R/3 System.
A field is not a dictionary object, but rather is a component of a table. A field cannot exist without a table and only has meaning within that particular table.
Data elements and domains are dictionary objects. Therefore, they can be used by many tables. They specify the characteristics of fields.

Tables are the objects that actually hold the information in a database. They consist of rows (records) and columns (fields).
For example, table KNA1 stores information about customers. Some of the columns in KNA1 are KUNNR (customer ID number), NAME1 (customer name), and ORT01 (customer city). Each row in KNA1 stores this information for a different customer.
Certain fields in a table are specified as the primary key of that table. The primary key is that field or combination of fields that uniquely identifies a row in the table. In table KNA1, the SAP R/3 client (MANDT) and the customer number (KUNNR) form the primary key.

The database utility provides the interface between the ABAP Dictionary and the underlying database management system (DBMS). It supports the creation of tables and secondary indices in the database both online and in the background.
Whenever you make a change to a dictionary object that affects the underlying database, the database utility is activated. Usually it works silently behind the scenes, but occasionally the database utility will prompt you for information. This occurs when an error is encountered or when existing data must be converted.
The database utility provides the interface to the DBMS by automatically generating the Data Definition Language (DDL) that the DBMS understands.

1. Abap dictionary

A data dictionary is a centralized storage location for information about the data that is stored in a database. This information is often called “metadata” (data about data).
SAP’s data dictionary is called the ABAP Dictionary.
A data dictionary provides answers to questions such as:
What data is contained in the database?
What are the attributes of this data: name, length, format, etc.?
What relationships exist among different data objects?
The ABAP Dictionary:
Enforces data integrity
Manages data definitions without redundancy
Is tightly integrated with the rest of the ABAP Workbench
When data integrity rules are defined in the ABAP Dictionary, the system automatically prevents the entry of invalid data. Defining the data integrity rules at the dictionary level means they only have to be defined once, rather than in each program that accesses that data.
The following are examples of data lacking integrity:
-> A date field with a month value of 13
-> An order assigned to a customer number that doesn’t exist

Additionally, the system provides easy navigation between development objects and dictionary definitions. For example, if you can double-click on the name of a dictionary object in your program code, the system will take you directly to the definition of that object in the ABAP Dictionary.
When a dictionary object is changed, a program that references the changed object will automatically reference the new version the next time the program runs. Because ABAP is interpreted, it is not necessary to recompile programs that reference changed dictionary objects.