Difference between Binary search and Linear search

Dear all,
If anyone helps me to get the basic difference between binary and Linear search in SAP environment.
Regards

Hi,
In case of linear search system will search from begining.
that means Example : z table contains single field with values 
1 2 3 4 5 6 7 8 9 
if u r searching for a value then system will starts from
first position. if required value is founded then execution
will comes out from z table.
In case of binary search system will starts from mid point.
if value is not founded then it will search for upper half.
in  that upper half it will check mid point.like that search
will takes place.
Thanks,
Sridhar

Similar Messages

  • Hi,  difference between database view and elementary search help

    hi
    pl.  can any one tell me the difference between
    database view and elementary search help, 
    and  help view and elementary search help,
    and database view and help view.
    in the output i do not see any difference.
    thanx.
    rocky robo

    HI
    An entire table can be included in a database view. In this case all the fields of the included table will become fields of the view (whereby you can explicitly exclude certain fields). If new fields are included in the table or existing fields are deleted, the view is automatically adjusted to this change.
    Database view:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm</a>
    Elementary search help:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/8b/415d363640933fe10000009b38f839/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/8b/415d363640933fe10000009b38f839/frameset.htm</a>
    Help view:
    Help views are used if a view with an outer join is needed as selection method in a  search help.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/42/81c1351181b73fe10000009b38f839/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/42/81c1351181b73fe10000009b38f839/frameset.htm</a>
    Regards,
    Gunasree

  • Searching for differences between oracle 8i and 9i

    hello
    can somebody help me please. i am searching for the difference between oracle 8i and 9i, and specially the differences in the DDL between 8i and 9i. may someone can help me!
    thanks
    Message was edited by:
    Da Rookee

    i need some expamples to show the difference....for
    example how it is written in 8i without joins and inNow you are talking about DML not DDL
    For some examples showing the differences between the "traditional" Oracle join syntax and the ANSI join syntax see this article on oracle-base
    http://www.oracle-base.com/articles/9i/ANSIISOSQLSupport.php

  • Searching and Matching - Difference between 'Match Pattern' and 'Match Geometric Pattern'?

    I was wondering if someone can explain to me the difference between  'Match Pattern' and 'Match Geometric Pattern' VIs? I'm really not sure which best to use for my application. I'm trying to search/match small spherical particles in a grey video in order to track their speed (I'm doing this after subtracting two subsequent frames to get rid of background motion artifacts).
    Which should I use?
    Thank you!
    Solved!
    Go to Solution.

    Hi TKassis,
    1.You may find from this link for the difference between these two,
    Pattern Match : http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_match_pattern_3/
    Geometric Match : http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_match_geometric_pattern/.
    2. I always prefer match pattern because of its execution speed, and incase of geometric pattern match it took lot of time to match your result. You may find in the attached figure for same image with these two algorithm execution time.
    Sasi.
    Certified LabVIEW Associate Developer
    If you can DREAM it, You can DO it - Walt Disney

  • What is difference between TEXT mode and BINARY mode?

    Hi,
              What is difference between TEXT mode and BINARY mode? In TEXT mode what is "ENCODING DEFAULT".
    OPEN DATASET wl_filename FOR INPUT
                              IN TEXT MODE ENCODING DEFAULT.
      OPEN DATASET wl_filename FOR INPUT
                              IN BINARY MODE .

    Hi vishnu,
    1. files like .TXT files are considered to be text,
       and other files like .EXE . DOC etc are binary files.
    2. In text files, after each line, there are two
       internal binary characters
      one for line feed and another one for newline.
    3. But, we don't have any meaning for it,
       when we view such files in notepad, for eg.
       Hence, to only get the understandable content,
       we should open such TXT files, in text mode.
      (we can also open them in binary mode,
      but we will get two extra characters after each line,
       and such two extra characters are meaningless
      for interpreting the text)
    4. In binary mode, each byte by byte is considered,
       without any meaning.
    regards,
    amit m.

  • What is difference between sy-tabix and sy-index.

    SAP Seniors,
    Can you please let me know what is difference between sy-index and sy-tabix.
    I read the SAP help, it is confusing for me. it looks like both are same from help. please help me.
    Thank you
    Anitha.

    HI,
        Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
    SY-TABIX
    Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
    APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
    COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
    LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
    READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
    SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
    SY-INDEX
    In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
    Hope this helps.
    Thank you,
    Pavan.

  • Difference between sy-tabix and sy-index?

    tell me about sy-tabix and sy-index?what is the difference between sy-tabix and sy-index?
    Moderator Message: Please search before posting. Read the [Forum Rules Of Engagement |https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] for further details.
    Edited by: Suhas Saha on Jun 18, 2011 5:33 PM

    HI,
        Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
    SY-TABIX
    Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
    APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
    COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
    LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
    READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
    SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
    SY-INDEX
    In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
    Hope this helps.
    Thank you,
    Pavan.

  • What is the difference between standard,sorted and hash table

    <b>can anyone say what is the difference between standard,sorted and hash tabl</b>

    Hi,
    Standard Tables:
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    Sorted Tables:
    Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    Hashed Tables:
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.
    Regards,
    Ferry Lianto

  • Wat is the exact differences between clustered table and pooled table

    hi,
       can you tell me ravi...wat is the exact differences between clustered table and pooled table
    with regards//
    anilreddyg

    Hi Anil Reddy
    Pooled Tables, Table Pools, Cluster Tables, and Table Clusters
    These types of tables are not transparent in the sense that they are not legible or manageable directly using the underlying database system tools. They are managed from within the R/3 environment from the ABAP dictionary and also at runtime when they are loaded into application memory.Pool and cluster tables are logical tables. Physically, these logical tables are arranged as records of transparent tables. The pool and cluster tables are grouped together in other tables, which are of the transparent type. The tables that group together pool tables are known as table pools, or just pools; similarly, table clusters, or just
    clusters, are the tables which group cluster tables.Not all operations that can be performed over transparent tables can be executed over pool or cluster tables.
    For instance, you can manage these tables using Open SQL calls from ABAP, but not Native SQL.These tables are meant to be buffered and loaded in memory, because they are commonly used for storing internal control information and other types of data with no external (business) relevance. SAP recommends that tables of pool or cluster type be used exclusively for control information such as
    program parameters, documentation, and so on. Transaction and application data should be stored in transparent tables.
    Table Pools
    From the point of view of the underlying DBMS as from the point of view of the ABAP dictionary, a table pool is a transparent table containing a group of pooled tables which, when created, were assigned to this table pool.
    Field Type Description
    TABNAME CHAR(10) Table name
    VARKEY CHAR(n) Maximum key length n =< 110
    DATALN INT2(5) Length of the VARDATA record returned
    VARDATA RAW(m) Maximum length of the data varies according to DBMS
    Table Clusters
    Similarly to pooled tables, cluster tables are logical tables which, when created, are assigned to a table cluster. Therefore, a table cluster, or just cluster, groups together several tables of type clusters.Several logical rows from different cluster tables are brought together in a single physical record. The records
    from the cluster tables assigned to a cluster are thus stored in a single common table in the database.A cluster contains a transparent cluster key which must be located at the start of the key of all logical cluster tables to be included in the cluster. As well, a cluster contains a long field (VARDATA), which contains the
    data of the cluster tables for this key. If the data does not fit into a field, continuation records are created.
    Field Type Description
    CLKEY1 CHAR(*) First key fields
    CLKEY2 CHAR(*) Second key field
    CLKEYN CHAR(*) nth key field
    PAGENO INT2(5) Number of the next page
    TIMESTMP CHAR(14) Time stamp
    PAGELG INT2(5) Length of the VARDATA record returned
    VARDATA RAW(*) Maximum length of the data section; varies according to database system
    Working with Tables
    The dictionary includes many functions for working with tables. There are five basic operations you can perform on tables: display, create, delete, modify, copy. Please do not confuse displaying a table with displaying the table entries (table contents). In order to display a table, it must previously exist; otherwise the system will display an error message in the status bar. For the following example, the table TABNA is used. To display this table, from the main dictionary screen, enter the table name in the Object name
    input field with the radio button selected next to Tables. Then, click on the Display button at the bottom of the screen, or press the F7 function key, or, alternatively,
    select Dictionary object Display from the menu.
    In this screen, you can see table information such as
    ¨ Table type, shown next to the name of the object. In the example, it is a transparent table.
    ¨ Short text description.
    ¨ Name of the user who made the last change, and the date of the change.
    ¨ Master language.
    ¨ Table status. On the screen, you can see this table is saved and active.
    ¨ Development class. For information on development classes, refer to Chap. 6.
    Delivery class, which sets the maintenance group for the table. It controls how tables will behave during client copy procedures, upgrades, and so forth.¨
    Tab. Maint. Allowed flag, which indicates whether you can generate a screen for maintaining table entries.
    ¨Then, on the lower part of the screen, you can see the table fields with all associated characteristics such as:
    ¨ Field name.
    ¨ Key indicator. When set, this field is the primary key, or part of it.
    ¨ Data element.
    ¨ Basic data type.
    ¨ Length.
    ¨ Check table.
    ¨ Short text, describing the field.
    Additional information about the table can be displayed by selecting the corresponding functions from the menu or directly from the application toolbar, such as keys, indexes, or technical settings
    Standard table:
    The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.
    You should usually access a standard table with index operations.
    Sorted table:
    The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.
    Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
    Hash table:
    The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.
    You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
    Index table:
    The table can be a standard table or a sorted table.
    Index access is allowed to such an index table. Index tables can be used to define the type of generic parameters of a FORM (subroutine) or a function module.
    Just have a look at these links:
    http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/74/83015785d811d295a800a0c929b3c3/frameset.htm
    Regards
    Sreeni

  • Differences between Procedural ABAP and OOPs ABAP

    Hi Friends,
    Can any one explain the differences between Procedural ABAP and OOPs ABAP in brief ? pls explain the most important ( atleast 3 or 4 points ). pls don't give me any other links, i will appreciate for good responses... and will be awarded with full points...
    Thanks and Regards
    Vijaya

    Hi
    Core ABAP (procedural) works with Event driven, subroutine driven one
    OOPS ABAP works on the OOPS concepts like Inheritance, polymorphism,abstraction and encapsulation.
    see the doc
    ABAP is one of many application-specific fourth-generation languages (4GLs) first developed in the 1980s. It was originally the report language for SAP R/2, a platform that enabled large corporations to build mainframe business applications for materials management and financial and management accounting. ABAP used to be an abbreviation of Allgemeiner Berichtsaufbereitungsprozessor, the German meaning of "generic report preparation processor", but was later renamed to Advanced Business Application Programming. ABAP was one of the first languages to include the concept of Logical Databases (LDBs), which provides a high level of abstraction from the basic database level.
    The ABAP programming language was originally used by SAP developers to develop the SAP R/3 platform. It was also intended to be used by SAP customers to enhance SAP applications – customers can develop custom reports and interfaces with ABAP programming. The language is fairly easy to learn for programmers but it is not a tool for direct use by non-programmers. Good programming skills, including knowledge of relational database design and preferably also of object-oriented concepts, are required to create ABAP programs.
    ABAP remains the language for creating programs for the client-server R/3 system, which SAP first released in 1992. As computer hardware evolved through the 1990s, more and more of SAP's applications and systems were written in ABAP. By 2001, all but the most basic functions were written in ABAP. In 1999, SAP released an object-oriented extension to ABAP called ABAP Objects, along with R/3 release 4.6.
    SAP's most recent development platform, NetWeaver, supports both ABAP and Java.
    Implementation
    Where does the ABAP Program Run?
    All ABAP programs reside inside the SAP database. They are not stored in separate external files like Java or C++ programs. In the database all ABAP code exists in two forms: source code, which can be viewed and edited with the ABAP workbench, and "compiled" code ("generated" code is the more correct technical term), which is loaded and interpreted by the ABAP runtime system. Code generation happens implicitly when a unit of ABAP code is first invoked. If the source code is changed later or if one of the data objects accessed by the program has changed (e.g. fields were added to a database table), then the code is automatically regenerated.
    ABAP programs run in the SAP application server, under control of the runtime system, which is part of the SAP kernel. The runtime system is responsible for processing ABAP statements, controlling the flow logic of screens and responding to events (such as a user clicking on a screen button). A key component of the ABAP runtime system is the Database Interface, which turns database-independent ABAP statements ("Open SQL") into statements understood by the underlying DBMS ("Native SQL"). The database interface handles all the communication with the relational database on behalf of ABAP programs; it also contains extra features such as buffering of frequently accessed data in the local memory of the application server.
    Basis
    Basis sits between ABAP/4 and Operating system.Basis is like an operating system for R/3. It sits between the ABAP/4 code and the computer's operating system. SAP likes to call it middleware because it sits in the middle, between ABAP/4 and the operating system. Basis sits between ABAP/4 and the operating system. ABAP/4 cannot run directly on an operating system. It requires a set of programs (collectively called Basis) to load, interpret, and buffer its input and output. Basis, in some respects, is like the Windows environment. Windows starts up, and while running it provides an environment in which Windows programs can run. Without Windows, programs written for the Windows environment cannot run. Basis is to ABAP/4 programs as Windows is to Windows programs. Basis provides the runtime environment for ABAP/4 programs. Without Basis, ABAP/4 programs cannot run. When the operator starts up R/3, you can think of him as starting up Basis. Basis is a collection of R/3 system programs that present you with an interface. Using this interface the user can start ABAP/4 programs. To install Basis, an installer runs the program r3inst at the command-prompt level of the operating system. Like most installs, this creates a directory structure and copies a set of executables into it. These executables taken together as a unit form Basis.
    To start up the R/3 system, the operator enters the startsap command. The Basis executables start up and stay running, accepting requests from the user to run ABAP/4 programs.
    ABAP/4 programs run within the protective Basis environment; they are not executables that run on the operating system. Instead, Basis reads ABAP/4 code and interprets it into operating system instructions. ABAP/4 programs do not access operating system functions directly. Instead, they use Basis functions to perform file I/O and display data in windows. This level of isolation from the operating system enables ABAP/4 programs to be ported without modification to any system that supports R/3. This buffering is built right into the ABAP/4 language itself and is actually totally transparent to the programmer.
    Basis makes ABAP/4 programs portable. The platforms that R/3 can run on are shown in Table. For example, if you write an ABAP/4 program on Digital UNIX with an Informix database and an OSF/Motif interface, that same program should run without modification on a Windows NT machine with an Oracle database and a Windows 95 interface. Or, it could run on an AS/400 with a DB2 database using OS/2 as the front-end.
    SAP also provides a suite of tools for administering the Basis system. These tools perform tasks such as system performance monitoring, configuration, and system maintenance. To access the Basis administration tools from the main menu, choose the path Tools->Administration.
    Platforms and Databases Supported by R/3
    Operating Systems Supported Hardware Supported Front-Ends Supported Databases
    AIX SINIX IBM SNI SUN Win 3.1/95/NT DB2 for AIX
    SOLARIS HP-UX Digital HP OSF/Motif Informix-Online
    Digital-UNIX Bull OS/2 Oracle 7.1
    Windows NT AT&T Compaq Win 3.1/95/NT Oracle 7.1
    Bull/Zenith OSF/Motif SQL Server 6.0
    HP (Intel) SNI OS/2 ADABAS D
    OS/400 AS/400 Win95 OS/2 DB2/400
    SAP Systems and Landscapes
    All SAP data exists and all SAP software runs in the context of an SAP system. A system consists of a central relational database and one or more application servers ("instances") accessing the data and programs in this database. A SAP system contains at least one instance but may contain more, mostly for reasons of sizing and performance. In a system with multiple instances, load balancing mechanisms ensure that the load is spread evenly over the available application servers.
    Installations of the Web Application Server (landscapes) typically consist of three systems: one for development, one for testing and quality assurance, and one for production. The landscape may contain more systems, e.g. separate systems for unit testing and pre-production testing, or it may contain fewer, e.g. only development and production, without separate QA; nevertheless three is the most common configuration. ABAP programs are created and undergo first testing in the development system. Afterwards they are distributed to the other systems in the landscape. These actions take place under control of the Change and Transport System (CTS), which is responsible for concurrency control (e.g. preventing two developers from changing the same code at the same time), version management and deployment of programs on the QA and production systems.
    The Web Application Server consists of three layers: the database layer, the application layer and the presentation layer. These layers may run on the same or on different physical machines. The database layer contains the relational database and the database software. The application layer contains the instance or instances of the system. All application processes, including the business transactions and the ABAP development, run on the application layer. The presentation layer handles the interaction with users of the system. Online access to ABAP application servers can go via a proprietary graphical interface, the SAPGUI, or via a Web browser.
    Transactions
    We call an execution of an ABAP program using a transaction code a transaction. There are dialog, report, parameter, variant, and as of release 6.10, OO transactions. A transaction is started by entering the transaction code in the input field on the standard toolbar, or by means of the ABAP statements CALL TRANSACTION or LEAVE TO TRANSACTION. Transaction codes can also be linked to screen elements or menu entries. Selecting such an element will start the transaction.
    A transaction code is simply a twenty-character name connected with a Dynpro, another transaction code, or, as of release 6.10, a method of an ABAP program. Transaction codes linked with Dynpros are possible for executable programs, module pools, and function groups. Parameter transactions and variant transactions are linked with other transaction codes. Transaction codes that are linked with methods are allowed for all program types that can contain methods. Transaction codes are maintained in transaction SE93.
    So, a transaction is nothing more than the SAP way of program execution—but why is it called “transaction”? ABAP is a language for business applications and the most important features of business applications were and still are are transactions. Since in the early days of SAP, the execution of a program often meant the same thing as carrying out a business transaction, the terms transaction and transaction code were chosen for program execution. But never mix up the technical meaning of a transaction with business transactions. For business transactions, it is the term LUW (Logical Unit of Work) that counts. And during one transaction (program execution), there can be many different LUW’s.
    Let’s have a look at the different kind of transactions:
    Dialog Transaction
    These are the most common kind of transactions. The transaction code of a dialog transaction is linked to a Dynpro of an ABAP program. When the transaction is called, the respective program is loaded and the Dynpro is called. Therefore, a dialog transaction calls a Dynpro sequence rather than a program. Only during the execution of the Dynpro flow logic are the dialog modules of the ABAP program itself are called. The program flow can differ from execution to execution. You can even assign different dialog transaction codes to one program.
    Parameter Transaction
    In the definition of a parameter transaction code, a dialog transaction is linked with parameters. When you call a parameter transaction, the input fields of the initial Dynpro screen of the dialog transaction are filled with parameters. The display of the initial screen can be inhibited by specifying all mandatory input fields as parameters of the transaction.
    Variant Transaction
    In the definition of a variant transaction code, a dialog transaction is linked with a transaction variant. When a variant transaction is accessed, the dialog transaction is called and executed with the transaction variant. In transaction variants, you can assign default values to the input fields on several Dynpro screens in a transaction, change the attributes of screen elements, and hide entire screens. Transaction variants are maintained in transaction SHD0.
    Report Transaction
    A report transaction is the transaction code wrapping for starting the reporting process. The transaction code of a report transaction must be linked with the selection screen of an executable program. When you execute a report transaction, the runtime environment internally executes the ABAP statement SUBMIT—more to come on that.
    OO Transaction
    A new kind of transaction as of release 6.10. The transaction code of an OO transaction is linked with a method of a local or global class. When the transaction is called, the corresponding program is loaded, for instance methods an object of the class is generated and the method is executed.
    Types of ABAP programs
    In ABAP, there are two different types of programs:
    Report programs(Executable pools)
    A Sample ReportReport programs AKA Executable pools follow a relatively simple programming model whereby a user optionally enters a set of parameters (e.g. a selection over a subset of data) and the program then uses the input parameters to produce a report in the form of an interactive list. The output from the report program is interactive because it is not a passive display; instead it enables the user, through ABAP language constructs, to obtain a more detailed view on specific data records via drill-down functions, or to invoke further processing through menu commands, for instance to sort the data in a different way or to filter the data according to selection criteria. This method of presenting reports has great advantages for users who must deal with large quantities of information and must also have the ability to examine this information in highly flexible ways, without being constrained by the rigid formatting or unmanageable size of "listing-like" reports. The ease with which such interactive reports can be developed is one of the most striking features of the ABAP language.
    The term "report" is somewhat misleading in the sense that it is also possible to create report programs that modify the data in the underlying database instead of simply reading it.
    A customized screen created using Screen Painter,which is one of the tool available in ABAP workbench(T-code = SE51).
    Online programs
    Online programs (also called module pools) do not produce lists. These programs define more complex patterns of user interaction using a collection of screens. The term “screen” refers to the actual, physical image that the users sees. Each screen also has a “flow logic”; this refers to the ABAP code invoked by the screens, i.e. the logic that initializes screens, responds to a user’s requests and controls the sequence between the screens of a module pool. Each screen has its own Flow Logic, which is divided into a "PBO" (Process Before Output) and "PAI" (Process After Input) section. In SAP documentation the term “dynpro” (dynamic program) refers to the combination of the screen and its Flow Logic.
    Online programs are not invoked directly by their name, but are associated with a transaction code. Users can then invoke them through customizable, role-dependent, transaction menus.
    Apart from reports and online programs, it is also possible to develop sharable code units such as class libraries, function libraries and subroutine pools.
    Subroutine Pools
    Subroutine pools, as the name implies, were created to contain selections of subroutines that can be called externally from other programs. Before release 6.10, this was the only way subroutine pools could be used. But besides subroutines, subroutine pools can also contain local classes and interfaces. As of release 6.10, you can connect transaction codes to methods. Therefore, you can now also call subroutine pools via transaction codes. This is the closest to a Java program you can get in ABAP: a subroutine pool with a class containing a method – say – main connected to a transaction code!
    Type Pools
    Type pools are the precursors to general type definitions in the ABAP Dictionary. Before release 4.0, only elementary data types and flat structures could be defined in the ABAP Dictionary. All other types that should’ve been generally available had to be defined with TYPES in type pools. As of release 4.0, type pools were only necessary for constants. As of release 6.40, constants can be declared in the public sections of global classes and type pools can be replaced by global classes.
    Class Pools
    Class pools serve as containers for exactly one global class. Besides the global class, they can contain global types and local classes/interfaces to be used in the global class. A class pool is loaded into memory by using one of its components. For example, a public method can be called from any ABAP program or via a transaction code connected to the method. You maintain class pools in the class builder.
    Interface Pools
    Interface pools serve as containers for exactly one global interface—nothing more and nothing less. You use an interface pool by implementing its interface in classes and by creating reference variables with the type of its interface. You maintain interface pools in the class builder.
    ABAP Workbench
    The ABAP Workbench contains different tools for editing Repository objects. These tools provide you with a wide range of assistance that covers the entire software development cycle. The most important tools for creating and editing Repository objects are:
    ABAP Editor for writing and editing program code
    ABAP Dictionary for processing database table definitions and retrieving global types
    Menu Painter for designing the user interface (menu bar, standard toolbar, application toolbar, function key assignment)
    Screen Painter for designing screens (dynamic programs) for user dialogs
    Function Builder for displaying and processing function modules (routines with defined interfaces that are available throughout the system)
    Class Builder for displaying and processing ABAP Objects classes
    The ABAP Dictionary
    Enforces data integrity
    Manages data definitions without redundancy
    Is tightly integrated with the rest of the ABAP/4 Development Workbench.
    Enforcing data integrity is the process of ensuring that data entered into the system is logical, complete, and consistent. When data integrity rules are defined in the ABAP/4 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
    An order not assigned to a customer
    Managing data definitions without redundancy is the process of linking similar information to the same data definition. For example, a customer database is likely to contain a customer’s ID number in several places. The ABAP Dictionary provides the capability of defining the characteristics of a customer ID number in only one place. That central definition then can be used for each instance of a customer ID number.
    The ABAP Dictionary’s integration with the rest of the development environment enables ABAP programs to automatically recognize the names and characteristics of dictionary objects.
    Additionally, the system provides easy navigation between development objects and dictionary definitions. For example, as a programmer, you can double-click on the name of a dictionary object in your program code, and the system will take you directly to the definition of that object in the ABAP/4 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.
    ABAP Syntax
    The syntax of the ABAP programming language consists of the following elements:
    Statements
    An ABAP program consists of individual ABAP statements. Each statement begins with a keyword and ends with a period.
    "Hello World" PROGRAM
    WRITE 'Hello World'.
    This example contains two statements, one on each line. The keywords are PROGRAM and WRITE. The program displays a list on the screen. In this case, the list consists of the line "My First Program".
    The keyword determines the category of the statement. For an overview of the different categories, refer to ABAP Statements.
    Formatting ABAP Statements
    ABAP has no format restrictions. You can enter statements in any format, so a statement can be indented, you can write several statements on one line, or spread a single statement over several lines.
    You must separate words within a statement with at least one space. The system also interprets the end of line marker as a space.
    The program fragment
    PROGRAM TEST.
    WRITE 'This is a statement'.
    could also be written as follows:
    PROGRAM TEST. WRITE 'This is a statement'.
    or as follows:
    PROGRAM
    TEST.
    WRITE
    'This is a statement'.
    Use this free formatting to make your programs easier to understand.
    Special Case: Text Literals
    Text literals are sequences of alphanumeric characters in the program code that are enclosed in quotation marks. If a text literal in an ABAP statement extends across more than one line, the following difficulties can occur:
    All spaces between the quotation marks are interpreted as belonging to the text literal. Letters in text literals in a line that is not concluded with quotation marks are interpreted by the editor as uppercase. If you want to enter text literals that do not fit into a single line, you can use the ‘&’ character to combine a succession of text literals into a single one.
    The program fragment
    PROGRAM TEST.
    WRITE 'This
    is
    a statement'.
    inserts all spaces between the quotation marks into the literal, and converts the letters to uppercase.
    This program fragment
    PROGRAM TEST.
    WRITE 'This' &
    ' is ' &
    'a statement'.
    combines three text literals into one.
    Chained Statements
    The ABAP programming language allows you to concatenate consecutive statements with an identical first part into a chain statement.
    To concatenate a sequence of separate statements, write the identical part only once and place a colon ( after it. After the colon, write the remaining parts of the individual statements, separating them with commas. Ensure that you place a period (.) after the last part to inform the system where the chain ends.
    Statement sequence:
    WRITE SPFLI-CITYFROM.
    WRITE SPFLI-CITYTO.
    WRITE SPFLI-AIRPTO.
    Chain statement:
    WRITE: SPFLI-CITYFROM, SPFLI-CITYTO, SPFLI-AIRPTO.
    In the chain, a colon separates the beginning of the statement from the variable parts. After the colon or commas, you can insert any number of spaces.
    You could, for example, write the same statement like this:
    WRITE: SPFLI-CITYFROM,
    SPFLI-CITYTO,
    SPFLI-AIRPTO.
    In a chain statement, the first part (before the colon) is not limited to the keyword of the statements.
    Statement sequence:
    SUM = SUM + 1.
    SUM = SUM + 2.
    SUM = SUM + 3.
    SUM = SUM + 4.
    Chain statement:
    SUM = SUM + : 1, 2, 3, 4.
    Comments
    Comments are texts that you can write between the statements of your ABAP program to explain their purpose to a reader. Comments are distinguished by the preceding signs * (at the beginning of a line) and " (at any position in a line). If you want the entire line to be a comment, enter an asterisk (*) at the beginning of the line. The system then ignores the entire line when it generates the program. If you want part of a line to be a comment, enter a double quotation mark (") before the comment. The system interprets comments indicated by double quotation marks as spaces.
    PROGRAM SAPMTEST *
    WRITTEN BY KARL BYTE, 06/27/1995 *
    LAST CHANGED BY RITA DIGIT, 10/01/1995 *
    TASK: DEMONSTRATION *
    PROGRAM SAPMTEST.
    DECLARATIONS *
    DATA: FLAG " GLOBAL FLAG
    NUMBER TYPE I " COUNTER
    PROCESSING BLOCKS *
    Advantages of ABAP over Contemporary languages
    ABAP OBJECTS
    Object orientation in ABAP is an extension of the ABAP language that makes available the advantages of object-oriented programming, such as encapsulation, interfaces, and inheritance. This helps to simplify applications and make them more controllable.
    ABAP Objects is fully compatible with the existing language, so you can use existing statements and modularization units in programs that use ABAP Objects, and can also use ABAP Objects in existing ABAP programs.
    ABAP Statements – an Overview
    The first element of an ABAP statement is the ABAP keyword. This determines the category of the statement. The different statement categories are as follows:
    Declarative Statements
    These statements define data types or declare data objects which are used by the other statements in a program or routine. The collected declarative statements in a program or routine make up its declaration part.
    Examples of declarative keywords:
    TYPES, DATA, TABLES
    Modularization Statements
    These statements define the processing blocks in an ABAP program.
    The modularization keywords can be further divided into:
    · Defining keywords
    You use statements containing these keywords to define subroutines, function modules, dialog modules and methods. You conclude these processing blocks using the END statements.
    Examples of definitive keywords:
    METHOD ... ENDMETHOD, FUNCTION ... ENDFUNCTION, MODULE ... ENDMODULE.
    · Event keywords
    You use statements containing these keywords to define event blocks. There are no special statements to conclude processing blocks - they end when the next processing block is introduced.
    Examples of event key words:
    AT SELECTION SCREEN, START-OF-SELECTION, AT USER-COMMAND
    Control Statements
    You use these statements to control the flow of an ABAP program within a processing block according to certain conditions.
    Examples of control keywords:
    IF, WHILE, CASE
    Call Statements
    You use these statements to call processing blocks that you have already defined using modularization statements. The blocks you call can either be in the same ABAP program or in a different program.
    Examples of call keywords:
    CALL METHOD, CALL TRANSACTION, SUBMIT, LEAVE TO
    Operational Statements These keywords process the data that you have defined using declarative statements.
    Examples of operational keywords:
    MOVE, ADD
    Unique Concept of Internal Table in ABAP
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    Internal Tables as Data Types
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    Line type
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    Key
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    Table type
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    Generic Internal Tables
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data objects.
    Internal Tables as Dynamic Data Objects
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    Choosing a Table Type
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    Standard tables
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    Sorted tables
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    Advanced Topics
    Batch Input: Concepts
    Processing Sessions
    The above figure shows how a batch input session works.A batch input session is a set of one or more calls to transactions along with the data to be processed by the transactions. The system normally executes the transactions in a session non-interactively, allowing rapid entry of bulk data into an R/3 System.
    A session records transactions and data in a special format that can be interpreted by the R/3 System. When the System reads a session, it uses the data in the session to simulate on-line entry of transactions and data. The System can call transactions and enter data using most of the facilities that are available to interactive users.
    For example, the data that a session enters into transaction screens is subject to the same consistency checking as in normal interactive operation. Further, batch input sessions are subject to the user-based authorization checking that is performed by the system.
    Advantages of ABAP over Contemporary languages
    ABAP Objects offers a number of advantages, even if you want to continue using procedural programming. If you want to use new ABAP features, you have to use object-oriented interfaces anyway.
    Sharing Data: With ABAP shared objects, you can aggregate data once at a central location and the different users and programs can then access this data without the need for copying.
    Exception Handling: With the class-based exception concept of ABAP, you can define a special control flow for a specific error situation and provide the user with information about the error.
    Developing Persistency: For permanent storage of data in ABAP, you use relational database tables by means of database-independent Open SQL, which is integrated in ABAP. However, you can also store selected objects transparently or access the integrated database or other databases using proprietary SQL.
    Connectivity and Interoperability: The Exchange Infrastructure and Web services are the means by which developers can implement a service-oriented architecture. With Web services, you can provide and consume services independently of implementation or protocol. Furthermore, you can do so within NetWeaver and in the communication with other systems. With the features of the Exchange Infrastructure, you can enable, manage, and adapt integration scenarios between systems.
    Making Enhancements: With the Enhancement Framework, you can enhance programs, function modules, and global classes without modification as well as replace existing code. The Switch Framework enables you activate only specific development objects or enhancements in a system.
    Considerable Aspects
    It follows a list of aspects to be considered during development. The list of course is not complete.
    Dynpro persistence
    When implementing dynpros one has to care for himself to read out and persist the necessary fields. Recently it happened to me that I forgot to include a field into the UPDATE-clause which is an error not so easy to uncover if you have other problems to be solved in the same package. Here, tool-support or built-in mechanisms would help.
    The developer could help himself out by creating something like a document containing a cookbook or guide in which parts of a dynpro logic one has to care about persistence. With that at hand, it would be quite easy finding those bugs in short time. Maybe a report scanning for the definition of the dynpro fields to be persisted could scan the code automatically, too.
    Memory Cache
    It should be common-sense that avoiding select-statements onto the database helps reducing the server load. For that the programmer either can resort to function modules if available. This maybe is the case for important tables. Or the programmer needs to implement his own logic using internal tables. Here, the standard software package could provide the developer with a tool or a mechanism auto-generating memory cached tables resp. function modules implementing this.
    Sometimes buffering of database tables could be used, if applicable. But that would require an effort in customizing the system and could drain down system performance overall, especially if a table is involved that has a central role.
    Interfaces
    It should be noticed that some function modules available have an incomplete interface. That means, the interface does not include all parameters evaluated by the logic of the function module. For example, global variables from within the function group could be read out, which cannot be influenced by the general caller. Or memory parameters are used internally to feed the logic with further information.
    One workaround here would be copying the relevant parts of the logic to a newly created function module and then adapt it to the own context. This sometimes is possible, maybe if the copied code is not too lengthy and only a few or no calls to other logic is part of it.
    A modification of the SAP code could be considered, if the modification itself is unavoidable (or another solution would be not justifiable by estimated effort to spend on it) and if the location of the modification seems quite safe against future upgrades or hot fixes. The latter is something that could be evaluated by contacting the SAP hotline or working with OSS message (searching thru existing one, perhaps open a new one).
    Example
    'From SAP NetWeaver:'
    set an exclusive lock at level object-type & object-id
    IF NOT lf_bapi_error = true.
    IF ( NOT istourhd-doc_type IS INITIAL ) AND
    ( NOT istourhd-doc_id IS INITIAL )
    CALL FUNCTION 'ENQUEUE_/DSD/E_HH_RAREF'
    EXPORTING
    obj_typ = istourhd-doc_type
    obj_id = istourhd-doc_id
    EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    terminate processing...
    lf_bapi_error = true.—
    ...and add message to return table
    PERFORM set_msg_to_bapiret2
    USING sy-msgid gc_abort sy-msgno
    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    gc_istourhd gc_enqueue_refdoc space
    CHANGING lt_return.
    ENDIF.
    ENDIF.
    ENDIF. " bapi error
    Example Report(Type - ALV(Advanced List Viewer))
    REPORT Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB .
    *Simple example to use ALV and to define the ALV data in an internal
    *table
    *data definition
    tables:
    marav. "Table MARA and table MAKT
    Data to be displayed in ALV
    Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
    " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
    "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    Other data needed
    field to store report name
    data i_repid like sy-repid.
    field to check table length
    data i_lines like sy-tabix.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    read data into table imat
    select * from marav
    into corresponding fields of table imat
    where
    matnr in s_matnr.
    Check if material was found
    clear i_lines.
    describe table imat lines i_lines.
    if i_lines lt 1.
    Using hardcoded write here for easy upload
    write: /
    'No materials found.'.
    exit.
    endif.
    end-of-selection.
    To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    The fieldcatalouge can be generated by FUNCTION
    'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    report source, including this report.
    Store report name
    i_repid = sy-repid.
    Create Fieldcatalogue from internal table
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = i_repid
    I_INTERNAL_TABNAME = 'IMAT' "capital letters!
    I_INCLNAME = i_repid
    CHANGING
    CT_FIELDCAT = int_fcat
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3.
    *explanations:
    I_PROGRAM_NAME is the program which calls this function
    I_INTERNAL_TABNAME is the name of the internal table which you want
    to display in ALV
    I_INCLNAME is the ABAP-source where the internal table is defined
    (DATA....)
    CT_FIELDCAT contains the Fieldcatalouge that we need later for
    ALV display
    IF SY-SUBRC <> 0.
    write: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
    ENDIF.
    *This was the fieldcatlogue
    Call for ALV list display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = i_repid
    IT_FIELDCAT = int_fcat
    TABLES
    T_OUTTAB = imat
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    *explanations:
    I_CALLBACK_PROGRAM is the program which calls this function
    IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains
    now the data definition needed for display
    I_SAVE allows the user to save his own layouts
    T_OUTTAB contains the data to be displayed in ALV
    IF SY-SUBRC <> 0.
    write: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
    ENDIF.
    OOPs ABAP uses Classes and Interfaces which uses Methods and events.
    If you have Java skills it is advantage for you.
    There are Local classes as well as Global Classes.
    Local classes we can work in SE38 straight away.
    But mostly it is better to use the Global classes.
    Global Classes or Interfaces are to be created in SE24.
    SAP already given some predefined classes and Interfaces.
    This OOPS concepts very useful for writing BADI's also.
    So first create a class in SE 24.
    Define attributes, Methods for that class.
    Define parameters for that Method.
    You can define event handlers also to handle the messages.
    After creation in each method write the code.
    Methods are similar to ABAP PERFORM -FORM statements.
    After the creation of CLass and methods come to SE38 and create the program.
    In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
    Regards
    Anji

  • DIFFERENCE between Tabstrip control and tabstrin(with wizard)

    difference between table control and table control wizard.
    and what is all about custom control
    give simple examples

    Hi
    Table Control
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/802338454211d189710000e8322d00/frameset.htm
    Table Control Wizard
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/802338454211d189710000e8322d00/frameset.htm
    Tab Strip
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/04/10f2469e0811d1b4700000e8a52bed/frameset.htm
    Tab Strip wizard
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/04/10f2469e0811d1b4700000e8a52bed/frameset.htm
    http://www.sapmaterial.com/tablecontrol_sap.html
    Custom Controls
    A custom control is an area on a screen. You create them in the Screen Painter, and, like all other screen objects, they have a unique name. You use custom controls to embed controls. A control is a software component on the presentation server, which can be either an ActiveX control or a JavaBean, depending on the SAPgui you are using. They allow you to perform tasks, such as editing texts, locally on the presentation server. The control is driven by the application logic, which still runs on the application server.
    The SAP Control Framework
    The controls on the presentation server and the ABAP application programs on the application server communicate using the Structure link SAP Control Framework. This is programmed in ABAP Objects, and contains a set of global classes that you can find in the Class Browser under Basis ® Frontend services. These classes encapsulate the communication between the application server and presentation server, which is implemented using Remote Function Call.
    All application controls are encapsulated in a global class. You can find the SAP Basis controls in the Class Browser under Basis ® Frontend Services or Basis ® Component Integration. Programs that use controls on a screen work with the methods and events of the global classes that encapsulates them.
    Container Controls
    Before you can work with a custom control on a screen, you must assign a Structure link SAP Container Control to it. Container controls are instances of special global classes from the SAP Control Framework. The global class for custom controls is called CL_GUI_CUSTOM_CONTAINER. To link a custom control to a container control, pass the custom control name to the CONTAINER_NAME parameter of the container control constructor when you instantiate it.
    As well as using custom containers, you can link controls to a screen using a SAP Docking Container. This is encapsulated in the global class CL_GUI_DOCKING_CONTAINER. The SAP Docking Container does not place the control within a screen. Instead, it attaches it to one of the four edges. You can nest containers. For example, you can use the SAP Splitter Container (classes CL_GUI_EASY_SPLITTER_CONTAINER or CL_GUI_SPLITTER_CONTAINER) within other containers. This allows you to split a custom control or docking control into more than one area, allowing you to embed more than one control.
    One example,
    program z.
    Constants *
    constants: c_me like trdir-cnam value 'VNDOVV',
    c_myurl type scarr-url value
    'http://www.brainbench.com/transcript.jsp?pid=147699',
    c_width type i value 260,
    c_height type i value 130.
    Types *
    types: begin of t_pgm,
    year(4) type c,
    name like trdir-name,
    end of t_pgm,
    begin of t_pgmkey,
    id type i,
    name like trdir-name,
    end of t_pgmkey.
    Data *
    data: it_pgmkey type table of t_pgmkey.
    Classes *
    Definitions *
    class screen_init definition create private.
    public section.
    class-methods init_screen returning value(this)
    type ref to screen_init.
    methods constructor.
    private section.
    class-data a_id type i.
    data: splitter_h type ref to cl_gui_splitter_container,
    splitter_v type ref to cl_gui_splitter_container,
    picture type ref to cl_gui_picture,
    tree type ref to cl_gui_simple_tree.
    methods: fill_tree,
    fill_picture.
    endclass.
    class screen_handler definition.
    public section.
    methods: constructor importing container
    type ref to cl_gui_container,
    handle_node_double_click
    for event node_double_click
    of cl_gui_simple_tree
    importing node_key,
    handle_picture_double_click
    for event picture_dblclick
    of cl_gui_picture.
    private section.
    data: html_viewer type ref to cl_gui_html_viewer,
    editor type ref to cl_gui_textedit.
    methods: fill_html,
    fill_src importing programid type trdir-name.
    endclass.
    Implementations *
    class screen_init implementation.
    method init_screen.
    data screen type ref to screen_init.
    create object screen.
    this = screen.
    endmethod.
    method constructor.
    data: events type cntl_simple_events,
    event like line of events,
    event_handler type ref to screen_handler,
    container_left type ref to cl_gui_container,
    container_right type ref to cl_gui_container,
    container_top type ref to cl_gui_container,
    container_bottom type ref to cl_gui_container.
    create object splitter_h
    exporting
    parent = cl_gui_container=>screen0
    rows = 1
    columns = 2.
    call method splitter_h->set_border
    exporting border = cl_gui_cfw=>false.
    call method splitter_h->set_column_mode
    exporting mode = splitter_h->mode_absolute.
    call method splitter_h->set_column_width
    exporting id = 1
    width = c_width.
    container_left = splitter_h->get_container( row = 1 column = 1 ).
    container_right = splitter_h->get_container( row = 1 column = 2 ).
    create object splitter_v
    exporting
    parent = container_left
    rows = 2
    columns = 1.
    call method splitter_v->set_border
    exporting border = cl_gui_cfw=>false.
    call method splitter_v->set_row_mode
    exporting mode = splitter_v->mode_absolute.
    call method splitter_v->set_row_height
    exporting id = 1
    height = c_height.
    container_top = splitter_v->get_container( row = 1 column = 1 ).
    container_bottom = splitter_v->get_container( row = 2 column = 1 ).
    create object picture
    exporting parent = container_top.
    create object tree
    exporting parent = container_bottom
    node_selection_mode =
    cl_gui_simple_tree=>node_sel_mode_single.
    create object event_handler
    exporting container = container_right.
    event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
    event-appl_event = ' '. "system event, does not trigger PAI
    append event to events.
    call method tree->set_registered_events
    exporting events = events.
    clear: event, events[].
    event-eventid = cl_gui_picture=>eventid_picture_dblclick.
    event-appl_event = ' '. "system event, does not trigger PAI
    append event to events.
    call method picture->set_registered_events
    exporting events = events.
    set handler: event_handler->handle_node_double_click for tree,
    event_handler->handle_picture_double_click for picture.
    call method: me->fill_picture,
    me->fill_tree.
    endmethod.
    method fill_picture.
    call method:
    picture->load_picture_from_sap_icons exporting icon = '@J4@',
    picture->set_display_mode
    exporting display_mode = picture->display_mode_fit_center.
    endmethod.
    method fill_tree.
    data: node_table type table of abdemonode,
    node type abdemonode,
    w_pgm type t_pgm,
    w_cdat type rdir_cdate,
    it_pgm type table of t_pgm,
    w_pgmkey type t_pgmkey.
    clear: a_id, it_pgmkey[].
    select distinct name cdat from trdir into (w_pgm-name, w_cdat)
    where cnam = c_me.
    w_pgm-year = w_cdat(4).
    append w_pgm to it_pgm.
    clear w_pgm.
    endselect.
    sort it_pgm.
    node-hidden = ' '. " All nodes are visible,
    node-disabled = ' '. " selectable,
    node-isfolder = 'X'. " a folder,
    node-expander = ' '. " have no '+' sign for expansion.
    loop at it_pgm into w_pgm.
    at new year.
    node-node_key = w_pgm-year.
    clear node-relatkey.
    clear node-relatship.
    node-text = w_pgm-year.
    node-n_image = ' '.
    node-exp_image = ' '.
    append node to node_table.
    endat.
    at new name.
    add 1 to a_id.
    node-node_key = w_pgmkey-id = a_id.
    w_pgmkey-name = w_pgm-name.
    node-relatkey = w_pgm-year.
    node-relatship = cl_gui_simple_tree=>relat_last_child.
    node-text = w_pgm-name.
    node-n_image = '@0P@'.
    node-exp_image = '@0P@'.
    append w_pgmkey to it_pgmkey.
    endat.
    append node to node_table.
    endloop.
    call method tree->add_nodes
    exporting table_structure_name = 'ABDEMONODE'
    node_table = node_table.
    endmethod.
    endclass.
    class screen_handler implementation.
    method constructor.
    create object: html_viewer exporting parent = container,
    editor exporting parent = container
    wordwrap_mode =
    cl_gui_textedit=>wordwrap_at_fixed_position
    wordwrap_position = 72.
    call method: fill_html,
    editor->set_readonly_mode exporting readonly_mode = 1.
    endmethod.
    method handle_node_double_click.
    data: w_name type programm,
    w_id type i,
    w_year(4) type c,
    w_pgmkey type t_pgmkey.
    w_name = node_key+4.
    w_id = w_name.
    clear w_name.
    read table it_pgmkey into w_pgmkey with key id = w_id
    binary search.
    if sy-subrc = 0.
    w_name = w_pgmkey-name.
    endif.
    w_year = node_key(4).
    if w_name is initial.
    call method: fill_html,
    html_viewer->set_visible exporting visible = 'X',
    editor->set_visible exporting visible = ' '.
    else.
    call method: fill_src exporting programid = w_name,
    editor->set_visible exporting visible = 'X',
    html_viewer->set_visible exporting visible = ' '.
    endif.
    call method cl_gui_cfw=>flush.
    endmethod.
    method handle_picture_double_click.
    call method: fill_html,
    html_viewer->set_visible exporting visible = 'X',
    editor->set_visible exporting visible = ' '.
    call method cl_gui_cfw=>flush.
    endmethod.
    method fill_html.
    call method html_viewer->show_url exporting url = c_myurl.
    endmethod.
    method fill_src.
    types t_line(72) type c.
    data src type table of t_line.
    read report programid into src.
    call method: editor->delete_text,
    editor->set_text_as_r3table exporting table = src[].
    endmethod.
    endclass.
    Data *
    data this_screen type ref to screen_init.
    Program execution *
    load-of-program.
    call screen 100.
    Dialog Modules PBO *
    module status_0100 output.
    set pf-status 'SCREEN_100'.
    set titlebar 'TIT_100'.
    this_screen = screen_init=>init_screen( ).
    endmodule.
    Dialog Modules PAI *
    module cancel input.
    leave program.
    endmodule.
    Reward if usefull

  • What are the main differences between Signal Express and Labview?

    National Instruments provides a matrix so one can quickly compare the
    various versions of Labview but no comparison of Signal Express with
    Labview. Hence how does Signal Express compare with Labview? What
    are some of the things one can do with Labview one can't do with
    Signal Express?
    Howard

    hrh1818 wrote: Which version of Labview are you referring to? I don't consider the graphical version of Labview to be a full featured programming language. LabWindows/CVI is by a long shot a lot closer to being a full featured programming language than the graphical version of Labview.
    Howard,
    You clearly don't know what you are talking about. There is no "graphical version" of LabVIEW, there is just LabVIEW. Click on the article "Is LabVIEW a general purpose programming language?" written by the Jeff K. for some easy reading from a few years ago. It is all still true (except that object oriented features and recursion have been added in recent versions).
    One of the main points at this years NI-week was the discussion of how processor development is switching more and more to multicore designs  to improve performance because a simple boost in clock frequency is becoming more difficult. Linear, text based code is not well suited to take advantage of multticore design, while the dataflow based LabVIEW programming language automatically scales well to multiple processor cores, without any need to rewrite older code. I would say that only LabVIEW is futureproof in this respect. LabVIEW programmers are not wimps that are simply too stupid to write text based code. LabVIEW is not a toy language for people that don't want to learn a "real" programming language.
    LabVIEW is arguably the best programming language in terms of getting things done! I've never felt limited with LabVIEW and my programs often don't even have anything to do with data acquisition or instrument control. The difference between text based code vs. LabVIEW is like "DOS vs. Windows", "Radio vs. HD television". "Trilobyte vs. Homo sapiens" (sorry Putnam ). Text based code is monochrome, archaic and outdated and its linearity imposes unecessary constraints on the programmer that can only be (partially) overcome by wasting even more time throwing even more code at it.
    Sure, a seasoned text based programmer will initially have problems adapting to LabVIEW, just because you would need to adapt to and embrace the power of dataflow and not try to make a literal translation of the text code to LabVIEW, retaining old habits. If you get stuck, come back and ask here in the forum.
    You were looking for object oriented features and failed. All you need to do is a quick site search. All the information is out there. Just because you cannot find it in the first five sentences of the glossy brochure does not mean it does not exist. Maybe you want to read one of the application notes such as:
    LabVIEW Object-Oriented Programming: The Decisions Behind the Design
    In general, you should avoid judgement until you have all information. Your opinions seem quite biased and superficial and not really based on hard facts.
    Initially you asked about the difference between signal express and LabVIEW.
    hrh1818 wrote:
    > What kind of measurments do you want to do and what kind of requirements do you have?
    > You can also see for yourself and download evaluation version of both.
    No thanks, there has to be a better way to get an answer to my
    question than get involved in a two month study project.
    If you would answer the first question quoted above, we could certainly help you with the decision. Isn't that the main purpose of this thread?
    You can also contact your local LabVIEW Field Engineer to go over your requirements and help you make a decision. They usually know their stuff!
    Message Edited by altenbach on 09-02-2007 11:51 PM
    LabVIEW Champion . Do more with less code and in less time .

  • Disk Utilty - what is difference between single volume and single partition

    In Disk Utility I can, should I wish, format a drive by using Erase to create a single volume. Also in Disk Utility, I have the option to use Partition to create one (or more) partition.
    What is the difference between a volume and a single partition?
    What are their relative merits?
    In what circumstances would I want to create a single partition instead of a volume?
    Disk Utility also prompts me to name the volume or partition. From experience, what would you suggest as a suitable name and where is this information subsequently used?

    A "volume" or "partition" are the same thing. The subject of using partitions has been covered many times on the forums. Do some searching and you'll find quite a lot of information. Also try doing some Google searching.

  • Difference between SQL Explain and SP Explain

    What is the difference between SQL Explain and SP Explain? And why would they suggest a different index is being used for the same statement in the same trace?

    Hi,
    Go through the link,
    http://www.redbooks.ibm.com/redbooks/pdfs/sg247094.pdf#search=%22SQL%20Explain%20and%20SP%20Explain%20in%20SAP%22
    Regards,
    Azaz.

  • Difference between unique constraint and unique index

    1. What is the difference between unique constraint and unique index when unique constraint is always indexed ? Which one is better in this case for better performance ?
    2. Is Composite index of 3 columns x,y,z better
    or having independent/ seperate indexes on 3 columns x,y,z is better for better performance ?
    3. It has been very confusing for me to decide which columns to index, I have indexed most foreignkey columns, is it a good idea ? We do lot of selects and DMLS on most of our tables. Is there any query that I can run and find out if indexes are really being used and if they are improving any performance. I have analyzed and computed my indexes using ANALYZE index index_name validate structure and COMPUTE STATISTICS;
    null

    1. Unique index is part of unique constraint. Of course you can create standalone unique index. But is is no point to skip the logical view of business if you spend same effort to achive.
    You create unique const. Oracle create the unique index for you. You may specify index characteristic in unique constraint.
    2. Depends. You can't utilize the composite index if the searching condition is not whole or front part of the indexing key. You can't utilize your index if you query the table for y=2. That is.
    3. As old words in database arena, Index may be good or bad for a table depending on the size of table, number of columns in the table... etc. It is very environmental dependent. In fact, It is part of database nomalization. Statistic is a way oracle use to determine the execution plan.
    Steve
    null

Maybe you are looking for