ABAP Dictionary

82
ABAP Dictionary (SE11) Introduction Data Dictionary is an interface to data that is independent of platform. It uses database to store everything(business data, programs, screen, screen program('dynpros'), menus and other elements). Three types of tables in the data dictionary o Every field of a table in the Data Dictionary corresponds to a real field in the database. So, all the tables in the Data Dictionary are called transparent tables . A transparent table has one-to-one relationship with a database table (same table name; same field name; same number of fields). o Pooled tables (small tables like VIEWS ) holds customizing data from many database tables and they have many -to-one relationship with a database table . For one database table, there are many tables in the dictionary ( with different table name; different field names and different number of fields). Each pooled table contains table description. Many pooled tables are stored together in a database table called a table pool which holds system data. You create table definition for a table pool. When activated, an associated single table will be created in the database. Then you can defines pooled tables and assign the pooled tables to the table pool. o A Clustered table holds data from a few very large tables (like joining tables on common part of primary key). It has many-to-one relationship with a database table. Many clustered tables are stored in a single database table called a table cluster. o (Pooled tables and clustered tables are usually used only by SAP) Create table definition(3 steps) o Define table name ( table name begins with y or z) o Define data elements for a field (data element name begins with y or z) Enter domain name (if the domain name exists)

description

ABAP Dictionary

Transcript of ABAP Dictionary

  • ABAP Dictionary (SE11)

    Introduction Data Dictionary is an interface to data that is independent of platform. It uses database to store everything(business data, programs, screen, screen program('dynpros'), menus and other elements).

    Three types of tables in the data dictionary o Every field of a table in the Data Dictionary corresponds to a

    real field in the database. So, all the tables in the Data Dictionary are called transparent tables. A transparent table has one-to-one relationship with a database table (same table name; same field name; same number of fields).

    o Pooled tables (small tables like VIEWS ) holds customizing data from many database tables and they have many -to-one relationship with a database table . For one database table, there are many tables in the dictionary ( with different table name; different field names and different number of fields). Each pooled table contains table description. Many pooled tables are stored together in a database table called a table pool which holds system data. You create table definition for a table pool. When activated, an associated single table will be created in the database. Then you can defines pooled tables and assign the pooled tables to the table pool.

    o A Clustered table holds data from a few very large tables (like joining tables on common part of primary key). It has many-to-one relationship with a database table. Many clustered tables are stored in a single database table called a table cluster.

    o (Pooled tables and clustered tables are usually used only by SAP)

    Create table definition(3 steps) o Define table name ( table name begins with y or z) o Define data elements for a field (data element name begins

    with y or z) Enter domain name (if the domain name exists)

  • Enter field labels (for labeling input fields) Enter on-line documentation ( F1 help)

    o Define a domain for a field (domain name begins with y or z) short text (required) data type data length output length(optional)

    o (domain and data elements are re-usable)

    Data types in ABAP dictionary

    Contains global data type o Can create global data types in ABAP Dictionary

    (Data types defined in ABAP program are mostly local variables)

    23 Predefined ABAP Dictionary types are built from ABAP data types:

    ABAP data type (L=Length specified in the domain)

    Predefined ABAP Dictionary types (data types used in domain)

    n(6) ACCP Accounting period YYYYMM c(L) CHAR Character c(3) CLNT Client

    c(5) CUKY Currency key; referenced by a CURR field

    p((L+2)/2) CURR Currency field is stored as DECIMALS m [NO-SIGN]

    d(8) DATS Date field YYYMMDD stored as CHAR(8) -- a data element p((L+2)/2) DEC Decimal f (8) FLTP Floating numbers with 8-byte accuracy

  • i INT1 1 byte integer. Whole number
  • Elementary types (Predefined ABAP data types)

    a) Numeric

    type i (whole numbers; initial value is 0; 4 bytes long; range: -2,147,483,648 to 2,147,483,647)

    e.g. data: customerNumber type i, loopCounter type i, wordLength type i value 15.

    type f (floating-point numbers; initial value is 0: 8 bytes long; range: -1E**-307 to 1E308)

    e.g. data: f1 type f, f2 type f, f3 type f.

    f1 = 2. f2 = '-16.34567'. f3 = '-75E03'.

    type p (packed number; initial value is 0; 8 bytes long; 15 to 31 digits)

    e.g. data: price type p decimals 2, packed_16(16) type p.

    b) Alphanumeric

    type n (numeric string; initial value is 00...0; 1 byte per digit; range: 1 to 65535)

    e.g. data vendorNumber type n "numeric text vendorNumber= '12345'.

    type c ( character string; initial value is blank one byte per character; range: 1 to 65535)

  • e.g. data: name(25) type c, " 77 name pic x(25). city (25), " 77 city pic x(25). flag, " 77 flag pic x(1). oneCharacter value 'B', " 77 onCharacter pic x(1) value 'B'. language(2) value 'ABAP' " AB is stored in language

    type string (character string; initial value is empty; range: 0 to any characters) -- not for screen field

    type d (date YYYYMMDD; initial value is 00000000; 8 bytes long; fixed-length digits)

    e.g. " Get today from system's variable sy-datum data today type d.

    " mm/dd/yyyy in US; dd/mm/yyyy in Europe " You can set your own date format from Layout button write today.

    type t (time HHMMSS; initial value is 000000

    6 bytes long; fixed-length digits)

    type x (hexadecimal code; initial value is x'00' ; one byte per digit range: 1 to 65535)

    xstring (hexadecimal code; initial value is empty; range: 0 to any characters) -- not for screen field

    e.g. data xstring(2) type x value 'F089'. " 2 hex.digits per byte

  • USER-DEFINED DATA TYPES

    Elementary type

    e.g. constants: " cannot change constants collegeName(6) type c value 'Humber', maxNumberOfSeats type i value 30.

    data: maxReservations type maxNumberOf Seats.

    Complex type - Structured type o component with a name (including another structure--

    nested structure)

    -- predefined Dictionary type -- a data element (semantic info. e.g. field label, help text, ...) -- a structure type (record structure) -- a table type (array)

    o e.g. 1. data: begin of student, " student record structure id(9) type n, name(25), phone(10), end of student.

    data professor like student.

    student-id = 123456789. student-name = 'Tanya Davis'. student-phone = '4166576622'. move student to professor.

    o e.g.2.

    types: begin of phoneNumber, countryCode(3) type n, areaCode(3) type n,

  • number(7) type n, end of phoneNumber,

    begin of employee, id(9) type n, name(25) type c, cellPhone type phoneNumber occurs 2, end of Employee.

    data: employees type employee occurs 200.

    TABLES TYPE

    e.g.1. data customersArray like customer occurs 100. e.g.2. data

    begin of personalData, name(25), phone(10), end of personalData.

    data employee type personalData occurs 300.

    LINE TYPE o defines attributes of individual fields i.e. array structure

    ACCESS TYPE ( o Use index to access lines or access by key in certain kinds

    of internal tables (arrays) STANDARD TABLE OR INDEXED TABLE

    o Mostly access by index o Access by non-unique key via sequential search o e.g.

    types: begin of customer, id (9) type n, name(25) type c, end of customer,

    "sequential table customerStandardTable type standard table of customer with non-unique key id.

    data: "work area

  • wa_customer type customer, "internal table myCustomerStandardTable type customersStandardTable, tableIndex type sy-tabix.

    * Read first customer read table myCustomerStandardTable into wa_customer index 1.

    SORTED TABLE OR INDEXED TABLE o Access by index o Mostly access by unique key via binary search

    Data: " sflight is a database table name wa_sflight type sflight, mySflightSortedTable type sorted table of sflight with unique key carrid connid fldate.

    select * from sflight into corresponding fields of table

    mySflightSortedTable.

    HASHED TABLE o access by unique key only

    types: begin of customer, id type student-id, name type student-name, phone type student-phone, end of customer,

    customerHashedTable type hashed table of customer with unique key id.

    data: wa_customer type customer, myCustomerHashedTable type customerHashedTable . parameters: pa_id type student-id.

  • select name, phone from student into corresponding fields of table myCustomerHashedTable.

    read table myCustomerHasedTable with table key id = pa_id into wa_customer.

    check sy-subrc = 0. write:/ wa_city-name, wa_city-phone.

    FIND ACCESS TYPE OF AN INTERNAL TABLE AT RUNTIME

    DESCRIBE TABLE internalTableName KIND charfield

    key definition (key fields) key type (unique or non-unique key) (table type is not specified) Reference type (pointer)

    Type and Uses of Lock Objects in SAP How many types of lock objects? How to create Lock objects? What is the main use of it in real time?

    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.

    SAP Provide three type of Lock objects. - Read Lock(Shared Locked) protects read access to an object. The read lock allows other transactions read access but not write access to the locked area of the table

    - Write Lock(exclusive lock) protects write access to an object. The write lock allows other transactions neither read nor write access to the locked area of the table.

    - Enhanced write lock (exclusive lock without cumulating) works like a write lock except that the enhanced write lock also protects from further accesses from the same transaction.

  • You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.

    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.

    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.

    Technicaly: When you create a lock object System automatically creat two function module. 1. ENQUEUE_. to insert the object in a queue. 2. DEQUEUE_. To remove the object is being queued through above FM.

    A Short Tutorial on User Exits Content Author: Abhishek

    User exits

    1. Introduction 2. How to find user exits 3. Using Project management of SAP Enhancements

    1. Introduction User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

    The naming standard of function modules for functionmodule exits is: EXIT_

    The call to a functionmodule exit is implemented as: CALL CUSTOMER.-FUNCTION

    Example:

    The program for transaction VA01 Create salesorder is SAPMV45A

    If you search for CALL CUSTOMER-FUNCTION i program SAPMV45A you will find ( Among other user exits):

    CALL CUSTOMER-FUNCTION '003' exporting

  • xvbak = vbak xvbuk = vbuk xkomk = tkomk importing lvf_subrc = lvf_subrc tables xvbfa = xvbfa xvbap = xvbap xvbup = xvbup.

    The exit calls function module EXIT_SAPMV45A_003

    2. How to find user exits Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

    If you know the Exit name, go to transaction CMOD.

    Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

    You will now come to a screen that shows the function module exits for the exit.

    3. Using Project management of SAP Enhancements We want to create a project to enahance trasnaction VA01

    - Go to transaction CMOD - Create a project called ZVA01 - Choose the Enhancement assign radio button and press the Change button

    In the first column enter V45A0002 Predefine sold-to party in sales document . Note that an enhancement can only be used i 1 project. If the enhancement is already in use, and error message will be displayed

    Press Save

    Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.

    Now the function module is displayed. Double click on include ZXVVAU04 in the function module

    Insert the following code into the include: E_KUNNR = '2155'.

    Activate the include program. Go back to CMOD and activate the project.

    Goto transaction VA01 and craete a salesorder.

  • Note that Sold-to-party now automatically is "2155"

    Finding the user-exits of a SAP transaction code * * Finding the user-exits of a SAP transaction code * * Enter the transaction code in which you are looking for the user-exit * and it will list you the list of user-exits in the transaction code. * Also a drill down is possible which will help you to branch to SMOD. * * Written by : SAP Basis, ABAP Programming and Other IMG Stuff * http://www.sap-img.com * report zuserexit no standard page heading. tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir. tables : tstct. data : jtab like tadir occurs 0 with header line. data : field1(30). data : v_devclass like tadir-devclass. parameters : p_tcode like tstc-tcode obligatory. select single * from tstc where tcode eq p_tcode. if sy-subrc eq 0. select single * from tadir where pgmid = 'R3TR' and object = 'PROG' and obj_name = tstc-pgmna. move : tadir-devclass to v_devclass. if sy-subrc ne 0. select single * from trdir where name = tstc-pgmna. if trdir-subc eq 'F'. select single * from tfdir where pname = tstc-pgmna. select single * from enlfdir where funcname = tfdir-funcname. select single * from tadir where pgmid = 'R3TR' and object = 'FUGR' and obj_name eq enlfdir-area. move : tadir-devclass to v_devclass. endif. endif. select * from tadir into table jtab where pgmid = 'R3TR' and object = 'SMOD' and devclass = v_devclass. select single * from tstct where sprsl eq sy-langu and tcode eq p_tcode. format color col_positive intensified off. write:/(19) 'Transaction Code - ', 20(20) p_tcode, 45(50) tstct-ttext. skip. if not jtab[] is initial. write:/(95) sy-uline. format color col_heading intensified on.

  • write:/1 sy-vline, 2 'Exit Name', 21 sy-vline , 22 'Description', 95 sy-vline. write:/(95) sy-uline. loop at jtab. select single * from modsapt where sprsl = sy-langu and name = jtab-obj_name. format color col_normal intensified off. write:/1 sy-vline, 2 jtab-obj_name hotspot on, 21 sy-vline , 22 modsapt-modtext, 95 sy-vline. endloop. write:/(95) sy-uline. describe table jtab. skip. format color col_total intensified on. write:/ 'No of Exits:' , sy-tfill. else. format color col_negative intensified on. write:/(95) 'No User Exit exists'. endif. else. format color col_negative intensified on. write:/(95) 'Transaction Code Does Not Exist'. endif. at line-selection. get cursor field field1. check field1(4) eq 'JTAB'. set parameter id 'MON' field sy-lisel+1(10). call transaction 'SMOD' and skip first screen. *---End of Program What is User Exits? The following document is about exits in SAP :-

    The R/3 enhancement concept allows you to add your own functionality to SAPs standard business applications without having to modify the original applications.

    SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

    Types of Exits There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.

  • Menu Exits Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

    SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu items text when activating the item in an add-on project.

    Screen Exits Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screens flow logic.

    Function Module Exits Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.

    When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.

    Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.

    These calls have the following syntax:

    CALL CUSTOMER-FUNCTION 001.

    Field Exits Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a companys international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.

    The field exit concept lets you create a special function module that contains this logic.

    You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.

    In 4.6c, you can use "RSMODPRF" program to create field exits.

    An example of a user exits :-

  • MODULE user_exit_0001 INPUT CASE okcode. WHEN 'BACK OR EXIT'. CASE sy-dynnr. WHEN '100'. SET SCREEN 0. LEAVE SCREEN. WHEN '200'. ****************************************************************************** **** Note that you can write any code that satisfy your needs. **** **** But in this case, this was wrote as a sample code for reference sake. **** **** And you can test it. **** ****************************************************************************** SET SCREEN 100. LEAVE SCREEN. ENDCASE. ENDCASE.

    What is the difference between SMOD and CMOD? CMOD is the Project Management of SAP Enhancements (i.e., SMOD Enhancements). SMOD contains the actual enhancements and CMOD is the grouping of those SMOD enhancements.

    User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a function module. The code for the function module is written by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

    The naming standard of function modules for function module exits is: EXIT_

    The call to a functionmodule exit is implemented as: CALL CUSTOMER.-FUNCTION

    For Example:

    The program for transaction VA01 Create salesorder is SAPMV45A

    1. If you search for CALL CUSTOMER-FUNCTION program SAPMV45A you will find ( Among other user exits):

  • CALL CUSTOMER-FUNCTION '003' exporting xvbak = vbak xvbuk = vbuk xkomk = tkomk importing lvf_subrc = lvf_subrc tables xvbfa = xvbfa xvbap = xvbap xvbup = xvbup.

    The exit calls function module EXIT_SAPMV45A_003

    2. How to find user exits

    Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

    If you know the Exit name, go to transaction CMOD. Choose menu Utillities->SAP Enhancements.

    Enter the exit name and press enter.

    You will now come to a screen that shows the function module exits for the exit.

    or use this ABAP program to search for user exits :-

    Finding the user-exits of a SAP transaction code

    3. Using Project management of SAP Enhancements

    You want to create a project to enhance transaction VA01

    - Go to transaction CMOD - Create a project called ZVA01 - Choose the Enhancement assign radio button and press the Change button In the first column enter V45A0002 Predefine sold-to party in sales document . Note that an enhancement can only be used for 1 project. If the enhancement is allready in use, and error message will be displayed - Press Save - Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. - Double Click on the exit. Now the function module is displayed. Double click on include ZXVVAU04 in the

  • function module Insert the following code into the include: E_KUNNR = '2155'.

    Activate the include program. Go back to CMOD and activate the project. Goto transaction VA01 and create a salesorder. Note that Sold-to-party now automatically is "2155"

    Field exits (SMOD/CMOD) Questions and Answers 1. Field exit was created with CMOD, but is not processed when calling the screen.

    o Since the field exit is not processed until PAI, an action must be triggered on the screen (Return, Save, ...).

    o Set profile parameter abap/fieldexit to YES and restart the system.

    o After activating the function module FIELD_EXIT... and the field exit, leave the transaction on whose screen the field exit is to be executed. The screen is not generated until the transaction is started.

    o Do not work on different application servers since there may be some delay before the field exit is activated.

    o The profile parameter must be set on all or none of the application servers.

    o If the field exit is to only be active on specific screens, check whether you chose the correct program and the correct screen number (take care with subscreens).

    o Using SE51 -> Field list, check that the screen field does have a reference to a data element. In the name of the field exit use the name of the data element and not the field name.

    o After transport, field exits are marked as active but will not be processed. Tip: First try deactivating the field exit once more and then afterwards, activate it again.

    2. How is performance affected by setting abap/fieldexit?

    o If a screen is generated and the profile parameter is set, a check is run on 2 tables (TDDIR, TDDIRS) to see whether a field exit must be generated for the respective field. In practice, the screen load is not generated until the screen is selected after an

  • update. The user should not notice any difference because screen generation is very fast.

    3. Can you read the contents of other screen fields in the field exit?

    o In principle, every field exit can store its value in the global variables of the function group (TOP) and hence make them available to other field exits. Note here that field exits are always called and not only if an entry is made in the field or if the field is empty. In addition, it is not possible to make any assumptions about the order in which the field exits will be called in the future.

    4. How does the field exit behave on step loop fields ?

    o After the user has entered data, the field exit is called in PAI as often as there are visible fields in the step loop. The system variable SY-STEPL is incremented each time. If a new value is assigned to the field, it is displayed in the module between LOOP and ENDLOOP. This module is also called once for each visible step loop line.

    5. Can field exits be debugged ?

    o No. Field exits must be tested separately in the ABAP/4 Development Workbench. For errors which only occur in the screen environment, it is helpful to write interesting variable to the file system using TRANSFER... . These can then be analysed there.

    6. What can you do if the field contents are no longer transported to to ABAP/4.

    o Check whether a value is assigned to the field OUTPUT.

    7. When is the field exit called if a conversion exit is attached to the data element ?

    o The field exit is called after the conversion exit. This means that the INPUT field receives the data in the same format as the ABAP/4 program also receives it.

    8. Although a global field exit is inactive, a function module is called which does not exist (for example FIELD_EXIT_PROGRAMM_@)

    o This is an error in the kernel which no longer occurs as of 3.0C. As a temporary measure, it is useful to assign a program and a

  • screen which do not exist to the field exit and then activate the field exit.

    9. Field exit is not visible in CMOD, although created.

    o If you want to create a field exit for a data element, a function module is proposed with the name FIELD_EXIT_. This function module must exist for the field exit to work. If you do not create this function module, but do create one with a suffix, the data element is not displayed in CMOD.

    10.Field exit is not executed although it is active.

    o Fields which do not have the 'Input field' attribute usually do not trigger a field exit. The field exit is designed to allow an extended input check. It is therefore only called for input fields - even if they are not ready for input at runtime of the application by LOOP AT SCREEN. This rule does not apply, however, if the field is located within a steploop. Here the field will be always activated, even if it is invisible.

    o Field exits can only be executed for fields that are directly related tothe dictionary. If the relation is indirect, i.e. via an ABAP declaration ( LIKE ), no field exit can be executed.

    11.Field exits on check buttons do not work

    o Field exits are only intended for input fields. As check buttons count as graphical elements, you cannot install field exits on them.

    12.Field exits do not work on selection screens

    Difference Between BADI and User Exits Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

    As with customer exits two different views are available:

    In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

  • In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

    In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

    SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

    The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).

    All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.

    The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects.

    Checking User Authorizations in your ABAP Program How to set Authorization to an ABAP Programs?

    Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.

    If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.

    This means you have to allocate an authorization object in the definition of the transaction.

    For example:

  • program an AUTHORITY-CHECK.

    AUTHORITY-CHECK OBJECT ID FIELD . ID FIELD . ... ID FIELD .

    The OBJECT parameter specifies the authorization object.

    The ID parameter specifies an authorization field (in the authorization object).

    The FIELD parameter specifies a value for the authorization field.

    The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.

    Regarding Runtime creation of Check Boxes For this...

    Create an Internal table as :

    data: Begin itab occurs 0, cb_field type char1, matnr like mara-matnr, ..... end of itab.

    Now you fetch the data into the internal table of itab using some query...

    select * ......

    Now you are going to display it as....

    Loop at itab. write:/ cb_field as checkbox... ...... at this time only write the Hide statement.... as...

    HIDE: values.... u want...

    Endloop..

  • Now capturing of selected data process...

    This can be done by clicking on some USER Command button...

    for suppose you're clicking F8 means...

    AT pf8. IF SY-LSIND = 1. describe table itab lines VARIABLE NAME. cnt = 3. " Initiate value for Count 3 if you're including page header. do VARIABLE NAME times. read line cnt. " Above counter.... if sy-lisel(1) = 'X'. WRITE:/ 'SELECTED RECORDS:', itab-cb_field,..... endif. COUNTER = COUNTER - 1. cnt = cnt + 1. enddo. ENDIF.

    Finding out a projection views In addition to CLUSTER and POOLED tables ABAP forbids joins with projection views.

    This type of data is also defined in DD02L, as tabclass = 'VIEW' and VIEWCLASS = 'P'.

    Projection views are used to hide fields of a table. This can minimize interfaces; for example when you access the database, you only read and write the field contents actually needed.

    A projection view contains exactly one table. You cannot define selection conditions for projection views.

    There is no corresponding object in the database for a projection view. The R/3 System maps the access to a projection view to the corresponding access to its base table. You can also access pooled tables and cluster tables with a projection view.

    What's the purpose of using PACKAGE SIZE in select statement? Package size can be used if you for example only want to finish processing a limited amount of data at a time due to lack of memory.

    The example below read 50 records at a time from VBAK into an internal table, and selects the corresponding entries from vbap into an internal table. Then the two internal

  • tables can be processed, and the next 50 records from VBAk can be read. Remember to reinitialize tha tables before the next read.

    REPORT z_test.

    TYPES: BEGIN OF t_vbak, vbeln LIKE vbak-vbeln, erdat LIKE vbak-erdat, END OF t_vbak,

    BEGIN OF t_vbap, posnr LIKE vbap-posnr, matnr LIKE vbap-matnr, meins LIKE vbap-meins, END OF t_vbap,

    BEGIN OF t_report, vbeln LIKE vbak-vbeln, erdat LIKE vbak-erdat, posnr LIKE vbap-posnr, matnr LIKE vbap-matnr, meins LIKE vbap-meins, END OF t_report.

    DATA: li_vbak TYPE t_vbak OCCURS 0, l_vbak TYPE t_vbak, li_vbap TYPE t_vbap OCCURS 0, l_vbap TYPE t_vbap, li_report TYPE t_report OCCURS 0, l_report TYPE t_report.

    START-OF-SELECTION. SELECT vbeln erdat FROM vbak INTO TABLE li_vbak PACKAGE SIZE 50. SELECT posnr matnr meins FROM vbap INTO TABLE li_vbap FOR ALL ENTRIES IN li_vbak WHERE vbeln = li_vbak-vbeln. IF sy-subrc = 0. * Now you have the two internal tables li_vbak and li_vbap filled * with data. * Do something with the data - remember to reinitialize internal

  • * tables ENDIF. ENDSELECT.

    *-- End of Program

    Difference Between SAP and ABAP Memory Can any one tell me what is the difference between ABAP Memory and SAP Memory?

    Answers 1:-

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

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

    Neelima

    Answers 2:-

    SAP Memory SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens

    ABAP/4 Memory ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.

  • SAP memory The SAP memory, otherwise known as the global memory, is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions. The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.

    ABAP/4 memory The contents of the ABAP/4 memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

    Scrolling in Table Control -----Original Message----- Subject: Scrolling in Table Control From: Amit Purohit

    Hey,

    I have defined a table control and scrolling is not possible in that even if the number of entries exceeds the window height. Below is the flow logic which I have attached

    PROCESS BEFORE OUTPUT. MODULE STATUS_0300. LOOP AT IT1 CURSOR ZTR0300-CURRENT_LINE. ENDLOOP. * PROCESS AFTER INPUT. LOOP AT IT1. MODULE USER_COMMAND_0300. ENDLOOP.

    What could I have done wrong ?

    Thanks in advance.

    Amit.

    -----Reply Message----- Subject: RE: Scrolling in Table Control From: K.Hariprasad

    Try defining the table control lines in PBO.

  • PROCESS BEFORE OUTPUT. ZTR0300-CURRENT_LINE = 100.

    -----Reply Message----- Subject: RE: Scrolling in Table Control From: K.Hariprasad

    Iam sorry, i have typed ZTR0300-LINES as ZTR0300-CURRENT_LINE in previous mail.

    PROCESS BEFORE OUTPUT. ZTR0300-LINES = 100

    -----Reply Message----- Subject: RE: Scrolling in Table Control From amit.purohit

    That worked.

    Thank you for prompt reply.

    Amit.

    -----End of Reply Message-----

    Interview Question on BAPI, RFC, ABAP Objects, Tables Content Author: Rashi agnihotri

    1) What is the difference between RFC and BAPI ? What are subclasses and super classes in BAPI and also what are the methods in BAPI ? 2) Is it possible to connect SAP to Non-SAP systems to retrieve data using RFC alone with out using BAPI ? 3) What is the difference between Function module and BAPI ? 4) What are the types of tables? 5) What are pooled table ? 6) What are Hashed Tables ? 7) What are advantages of using ABAP objects? 8) What is the advantage of using ABAP objects in Reports ?

  • 1)BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.

    The following standardized BAPIs are provided: Reading instances of SAP business objects GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.

    The BAPI GetList() is a class method. GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type

    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.

    Create( ) and CreateFromData! ( ) The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.

    Change( ) The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.

    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.

    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.

    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.

  • Add ( ) and Remove ( ) The BAPI Add adds a subobject to an existing object inst! ance and the BAPI and Remove removes a subobject from an object instance. These BAPIs are instance methods.

    2) No it is not possible to connect SAP to Non-SAP systems to retrieve data using RFC alone. RFC can acces the SAP from outside only through BAPI and same is for vice versa access.

    3) Each Bapi Object has Interface, Key Fields, Attributes,Methods and Events. Bapi Function Modules can be attached to these Bapi objects .Function module has a single bound functionality while a BAPI object can contain many functionalities

    4) Transparent table, Pool table and cluster table are data dictionary table objects sorted table, indexed table and hash table are internal tables.

    5)Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. The data from several different tables can be stored together in a table pool or table cluster. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables.

    A table in the database in which all records from the pooled tables assigned to the table pool are stored corresponds to a table pool.

    The definition of a pool consists essentially of two key fields (Tabname and Varkey) and a long argument field (Vardata). Table Clusters Several logical data records from different cluster tables can be stored together in one physical record in a table cluster.

    A cluster key consists of a series of freely definable key fields and a field (Pageno) for distinguishing continuation records. A cluster also contains a long field (Vardata) that contains the contents of the data fields of the cluster tables for this key. If the data does not fit into the long field, continuation records are created. Control information on the structure of the data string is still written at the beginning of the Vardata field.

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

    Sample Prog: This does nothing. REPORT Z_1 .

  • tables: mara. data: i type hashed table of mara with unique key matnr

    7) and 8) ABAP objects are root for your program and reports.

    If you need to find out the Okcodes for BDC sessions, look for program RSBDCCUA and run it for any platform say 'WN' for windows or MC for Mac and it will generate list of function codes

    **********

    If you want to protect a program against debugging, you just have to set the STATUS = S in the attributes view of the main program.

    **********

    **********

    Find the Table Name For a Field.

    I know couple of ways to find the table name for a field. like. 1. Part the cursor at the field and press F1 & F9. 2. se84 or se15 3. st05 (sql trace). 4. Setting Break point in ABAP.

    **********

    Given a transaction code, how can I find the menu path?

    In 4.6c, you can used tcode search_sap_menu to find the SAP MENU tcode.

    Please note that there are no tcode available to find the path of the IMG transaction.

    **********

    Can line-size of abap report large than 255?

    You can have line-size upto 1023. Along with Report statement pass the line-size as 1023. Ex. Report xyz line-size 1023.

    **********

    How to find out the number of days between a given date, excluding Saturdays and Sundays and public holidays?

  • Try functions, => DATE_CONVERT_TO_FACTORYDATE => HR_HK_DIFF_BT_2_DATES

    **********

    How to call one report to another? Here ZREP2 CALLS report ZREP1 when you click on output of report ZREP2.

    REPORT ZREP1.

    parameter : paramet(18) type c.

    write : paramet.

    REPORT ZREP2 NO STANDARD PAGE HEADING. tables: qals.

    RANGES seltab for qals-prueflos.

    WRITE: 'Select a Selection!', / '--------------------'. SKIP.

    FORMAT HOTSPOT COLOR 5 INVERSE ON. WRITE: 'Selection 1', / 'Selection 2'.

    AT LINE-SELECTION. CASE SY-LILLI. WHEN 4. SUBMIT zrep1 VIA SELECTION-SCREEN WITH PARAMET EQ 'Selection 1' WITH SELECTO IN SELTAB WITH SELECTO NE 3 AND RETURN. WHEN 5.

    SUBMIT zrep1 VIA SELECTION-SCREEN WITH PARAMET EQ 'Selection 1'

  • AND RETURN. ENDCASE.

    SAP R/3 Programming TOP

    Indeed these powerful ABAP/4 functions are very interesting and can bring some advantages. Improve your home development easily. They belong to standard objects and should never be changed.

    Bp_event_raise Trigger an event from ABAP/4 program.

    Bp_joblog_read Fetch job log executions filling the structure TBTC5.

    G_set_get_all_values Fetch values from a set filling the structure RGSB4.

    Popup_to_confirm_loss_of_data Create a dialog box in which you make a question whether the user wishes to perform a processing step with loss of data.

    Popup_to_confirm_step Create a dialog box in which you make a question whether the user wishes to perform the step.

    Popup_to_confirm_with_message Create a dialog box in which you inform the user about a specific decision point during an action.

    Popup_to_confirm_with_value Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.

    Popup_to_decide Create a dialog box in which you require the user between the two processing alternatives, or to cancel the action.

    Popup_to_decide_with_message Create a dialog box in which you inform the user about a specific decision point

  • via a diagnosis text.

    Popup_to_display_text Create a dialog box in which you display a two-line message.

    Rfc_system_info Fetch information from the current instance filling the structure FRCSI.

    Rs_send_mail_for_spoollist Send messages from ABAP/4 programs to SAPoffice. The structure SOLI may contain the message.

    Rzl_sleep Hang the current application from 1 to 5 seconds.

    Rzl_submit Submit a remote report.

    Sapgui_progress_indicator Set progress indicator on the left lower corner of the current window.

    Sd_print_terms_of_payment Format terms of payment according to base line date and payment terms.

    So_wind_spool_list Browse printer spool numbers according to user informed.

    So_spool_read Fetch printer spool according to the spool number informed.

    So_user_list_read List of all users filling the structure SOUD3.

    Spell_amount Return the amount in words filling the structure SPELL.

    Th_saprel Gather information from the current system including upgrade activities. It completes fields from the structure KKS03.

    Th_server_list Gather information of all instances filling the structure MSXXLIST.

    Th_user_list List of logged users filling the structure UINFO.

  • Th_user_info Information about the current user. It completes fields from the structure KKS03.

    Th_wpinfo List of work processes filling the structure WPINFO.

    Ws_upload Transfer files from the frontend to the application server.

    Ws_download Transfer files from the application server to the frontend.

    Ws_excel Download files at the frontend in excel format.

    Ws_execute Execute an external program on the presentation server.

    Ws_file_delete Delete file at the frontend.

    Ws_volume_get Get the label from a frontend device.

    Ws_msg Create a dialog box in which you display an one-line message.

    SAP R/3 Glossary TOP

    Information Technology has many key words and SAP R/3 has introduced many others. In order to understand even better this field you should keep in mind those terms.

    ALE (Application Link Enabling) It provides integration for separate R/3 systems, keeping full interaction. This makes possible distributed enterprise applications.

    Application server The application server is used to run the business application programs in the R/3 client/server concept. The application modules are loaded from the data base server to the application server as required. Thus the application server requires only storage capacity to accommodate UNIX, Swapping and the SAP runtime environment.

    Batch Input A technique to input data safely. It ensures application data integrity for background interfaces. It pretends to be someone typing. See also direct input.

    CATT (Computer Aided Test Tool) It allows you to combine and automate sequences of repeatable transactions in test procedures. CATT reduces the number of manual tests, and forces you to test systematically, defining input values and expected test results.

  • CCMS (Computer Center Management System) It allows you to monitor, control and configure your R/3 system. This toolset lets you analyze and distribute client workloads and report on resource consumption for system components.

    Central System In an R/3 central system, both application and data base software are run on one computer.

    Client In commercial, organizational and technical terms, a self-contained unit in an R/3 system with separate master records and its owns set of tables.

    Client/Server System Client/server systems are structured modularly, with components working in a sender/receiver relationship. Software components can also be used in a client/server relationship.

    Communication Server It provides the connection between local area and wide area networks and may be either a router, a bridge or a gateway. In R/3 installations, the communication server must support the TCP/IP protocol over wide area networks.

    Company code The smallest organizational unit for which a complete self-contained set of accounts can be drawn up for purposes of external reporting. This involves recording all relevant transactions and generating all supporting documents for legally-required financial statements, such as balance sheets and profit and loss statements.

    Computer type The R/3 system supports various computer types of SAP's platform partners, such as Bull, DEC, IBM and HP. The suitability of a particular computer type depends on sufficient CPU performance.

    CPI-C (Common Programming Interface-Communications) Common Programming Interface of Communication has been introduced by IBM as a high-level interface to SNA/LU6-2. CPI-C has become the subject of the X/Open stardarlization and is used by SAP to facilitate program-to-program communication between R/3 and external system. SAP offers CPI-C libraries based on TCP/IP.

    Correction It contains all the objects that a developer has changed or created. It also controls customizing that has been maintained.

    CSP A system to help SAP employees to give comprehensive support to their clients.

    Data base server The data base server stores the SAP application programs and data in the R/3 client/server concept. It also handles the SAP update program and batch jobs.

    Direct Input A recent technique to input data safely. It ensures application data integrity for background interfaces. See also batch input.

    Dispatcher The system R/3 agent that identifies the type of task (on-line, update, batch, etc.) and sends the job to an idle work process.

    EarlyWatch It is a service that entails having your R/3 installation regularly inspected by SAP employees, in other to ensure high system availability and high data throughput at all time.

    Ethernet It is a LAN architecture using bus topology. The transmission speed is 10 MBit/s.

    FDDI (Fiber Distributed Data Interchange) It is a local high-speed network with ring topology based on light wave conductors. The transmission speed is 100 MBit/s.

  • Field status Indicator that specifies whether a field can take an entry in the entry screen or if it must be filled.

    Firewall It is a means of controlling access through a public network to a private network.

    FTP (File Transfer Protocol) It is the most commonly used file transmission protocol of the TCP/IP protocol family.

    GUI (Graphic User Interface) A graphical interface used by SAP environment as part of the three tiers. It is normally called user frontend.

    IDES (International Demonstration and Education System) It is a model of an international firm. It is a separate demonstration and education system for speeding up the pilot process.

    IMG (Implementation Management Guide) It is a hierarchical structure that reflects the R/3 component hierarchy and contains every configuration activity. Released from version 3.0 onwards.

    Instance It means application server and each one has its own set of work processes.

    IDoc (Intermediate Document) An IDoc is a data container for data exchange between SAP systems or between an SAP system and an external system.

    ITS (Internet Transaction Server) It links the R/3 application server with one or more Web servers, thus enabling the R/3 to communicate with the Internet.

    Kernel It means a standard core previously configured. A set of default parameters delivered with the system.

    LAN (Local Area Network) It is a network foa a tightly limited area with high level data transmission performance. Common LANs include Ethernet, Token Ring and FDDI. These LANs support different transport protocols, such as TCP/IP and IPX.

    Matchcode A tool for finding specific record. It is made up of search terms. It is used to find possible entries for an input field.

    Number range A range of numbers that are laid down per file for the assignment of document numbers. It can be internal (carried out automatically by the system) or external (carried out manually by the user).

    OLE It is a technique introduced by Microsoft to incorporate objects of one application into another.

    OSS (Online Service System) SAP's Online Service System offers fast and effective help for R/3 System problems. It is also the basic element of communications between customers, partners, and SAP.

    Repair It contains all the objects that a developer has changed but the originals of the objects are located in another system.

    RFC A way to implement communication between application programs via Abap/4 function call.

    Semaphores When a work process locks a resource, it sets a semaphore. Another work process that also wants to access it must then wait.

  • SysID A set of three letters or number that identify a system. Some sets are not allowed because they are used by SAP. They are informed when the system is installed.

    TCP/IP It is the most widely used transport protocol for open systems. R/3 clients and servers communicate using TCP/IP.

    Telnet It provides terminal access to hosts using TCP/IP protocol. It is a well-known command among Systems Administrators.

    Token Ring It is a LAN architecture with ring topology. The transmission speed is 4 MBit/s or 16 MBit/s. This involves a 'free token' which circles the loop picking up transmissions. The receiver station places a confirmation bit into the busy token. As soon as the busy token reaches the sender station again, it is converted back to a free token and sent on to the next station.

    Transport It is a request to transport objects from the software development environment, identified as the source system, to the specified target system.

    WAN (Wide Area Networks) They are normally operated either by the telephone company or by private companies that offer leased lines, switched lines or packet lines.

    Work process Work processes perform the bulk of the processing carried out by SAP systems. They perform dialog steps in user transactions and carry out updates, lock management, printing services, and so on.

    Workbench The ABAP/4 Workbench, a graphical programming environment, is used to create application programs. The programming tools are accessed using buttons, dialogs and windows.

    Workflow It consists of time and logical sequence of work items, which are precessed by human agents or mechanical processing units.

    X.25 It is a standardized network access protocol for the packet switching network. The maximum transmission speed is 64 KBit/s.

    SAP R/3 Troubleshooting TOP

    System gets stuck It happens mostly when archive area is overloaded. Run the program brarchive with deletion option to release disk space.

    Short dump Not always the problem is technical. Try to create all SAPoffice users through transaction SO32 (create all SAPoffice users) and review your application data carefully.

    Field exits are completely ignored Make sure your SAP profile parameter contains the option abap/fieldexit = yes.

    Transaction SE16 (table contents) does not work properly Make usage of the menu option to regenerate the display program. You can also try changing key words according to field names. Choose Option -> Parameters users.

    Rollback segments are too small Before increasing up the rollback segment size you should verify your programs. Very often the problem belongs to them.

  • Files for rollback segments are already enormous Check the rollback segments configuration. It has to match the allocated area on tablespaces. Changes have to be done using Oracle tools.

    Extended help under windows does not link correctly Check the file sapdoccd.ini under your presentation server. It must be present in the main windows directory and should assign to help files directory.

    Release procedure with classification does not work As a matter of fact you are not the only one to notice it. It hardly works. Before using release strategy you should apply all notes on OSS. Pray might be useful too.

    Transport area is overloaded The command tp clearold SysID cleans up the transport area according to parameters previously set on the plain file TPPARAM.

    Instance does not establish communication Shutdown the whole system and check the Interprocess Communication Facilities. Any references should be found. Either the command IPCS (UNIX) or showipc INSTANCE NUMBER (SAP) show all message queue, semaphore set and shared memory identifier. Before trying again you have to remove them using the command IPCRM (UNIX) or cleanipc INSTANCE NUMBER (SAP).

    SAP R/3 Tips & Tricks TOP

    Logging on without being authorized Client 066 usually exists in a SAP system because of EarlyWatch services. Often this client does not have master users. If it is true, anyone can log into the system using the client 066, user SAP*, and password PASS. Enjoy yourself.

    Special copy and paste Click on the area and press CTRL+Y. It allows you to copy many lines at once and paste them afterwards.

    Long messages on footer Click on the message and hold the mouse button. After moving the mouse to the left side.

    Direct input logs The transaction BMV0 (direct input logs) shows all direct input logs.

    Graphics on SAPscript The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into individual standard text.

    Adding icons The include ICON can be easily used in your programs. All icons can be checked through the transaction ICON. Sequences of characters begin and finish with the symbol @. Even plain files under operating system can contain those strings.

    Adding symbols The include SYMBOL can be easily used in your programs. It makes available

  • a great number of symbols.

    Filling up an empty date field quickly Strike the key F4 (or click on matchcode symbol) and press ESCAPE. The current date is automaticly set.

    Setting up module FI/CO without using IMG Almost all parameters can be set using the transactions ORFA (Asset Accounting), ORFB (Financial Accounting), and ORKS (Cost Center Accounting).

    Deleting cost elements and cost centers Since they have no postings you can use the transaction KA04 for deleting cost elements and KS04 for deleting cost centers.

    Displaying check object when not authorized Soon after the lock try to access the transaction SU53. It reports the last objects verified and also the respective values.

    Table analyses between two systems The contents of a table between two systems can be checked through the transaction OY19.

    Correction and transport system The transaction SE10 provides the easiest way to manage any request/transport and corrections.

    General command field formats

    /n Skip to the next record if you are processing one batch input session /bend Cancel a batch input foreground process /nend Close all R/3 sessions and logoff /nxxxx Call the transaction xxxx in the same session /o Generate a session list /oxxxx Call the transaction xxxx in an additional session /i Delete the current session /h Turn the debug mode on /$tab Reset all buffers (for System Administrators) /$sync Synchronize instances buffers (for System Administrators)

    Report command field formats

    %pri Print the current report %pc Download the current report %sc Call the find function p+ Go to the next page

  • p- Go to the previous page p++ Go to the last page p-- Go to the first page

    Helpful reports

    RSCLTCOP Copy tables across clients RSAVGL00 Table adjustment across clients RSINCL00 Extended program list RSBDCSUB Release batch-input sessions automaticly RSTXSCRP Transport SAPscript files across systems RSORAREL Get the Oracle Release RGUGBR00 Substitution/Validation utility RSPARAM Display all instance parameters RSUSR003 Check the passwords of users SAP* and DDIC in all clients RSUSR006 List users last login

    Meaning of info structures' first letter

    A Pricing B Output determination C Account determination D Material determination E Rebates F Index G Listing and Exclusion H Batch determination I Profile determination S Statistics X Statistics extra

    1. What is the typical structure of an ABAP/4 program? ANS:- HEADER ,BODY,FOOTER.

    2. What are field symbols and field groups.? Have you used "component idx of structure" clause with field groups? ANS:- Field symbols:-

    Field groups :-

    3. What should be the approach for writing a BDC program? ANS:- STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal

  • table CALLED "CONVERSION". STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED "SAP DATA TRANSFER". STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity) ii) create sessions (sessions are created and processed.if success data will transfer).

    4. What is a batch input session? ANS:- BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed,program name behind it, and how next screen is processed.

    5. What is the alternative to batch input session? ANS:- Call transaction.

    6. A situation: An ABAP program creates a batch input session. We need to submit the program and the batch session in back ground. How to do it? ANS:- go to SM36 and create background job by giving job name,job class and job steps (JOB SCHEDULING)

    8. What are the problems in processing batch input sessions? How is batch input process different from processing online? ANS:- PROBLEMS:- i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains). However if session is processed we may delete it manually. ii)if session processing fails data will not be transferred to SAP database table.

    10. What are the different types of data dictionary objects? ans:- tables, structures, views, domains, data elements, lock objects, Matchcode objects.

    11. How many types of tables exists and what are they in data dictionary? ans :- 4 types of tables i)Transparent tables - Exists with the same structure both in dictionary as well as in database exactly with the same data and fields. Both Opensql and Nativesql can be used.

    ii)Pool tables & iii)Cluster tables - These are logical tables that are arranged as records of transparent tables.one cannot use

  • native sql on these tables (only opensql).They are not managable directly using database system tools.

    iv)Internal tables - .

    12. What is the step by step process to create a table in data dictionary? ans:- step 1: creating domains(data type,field length,range). step 2: creating data elements(properties and type for a table field). step 3: creating tables(SE11).

    13. Can a transparent table exist in data dictionary but not in the data base physically? ANS:- NO. TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE DICTIONARY AS WELL AS IN THE DATABASE,EXACTLY WITH THE SAME DATA AND FIELDS.

    14. What are the domains and data elements? ANS:- 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.

    15. Can you create a table with fields not referring to data elements? ANS:- YES. eg:- ITAB LIKE SPFLI.here we are referening to a data object(SPFLI) not data element.

    16. What is the advantage of structures? How do you use them in the ABAP programs? ANS:- Adv:- GLOBAL EXISTANCE(these could be used by any other program without creating it again).

    17. What does an extract statement do in the ABAP program? ANS:- Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: EXTRACT .

    When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset

  • EXTRACT HEADER.

    When you extract the data, the record is filled with the current values of the corresponding fields.

    As soon as the system has processed the first EXTRACT statement for a field group , the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs.

    By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.

    18. What is a collect statement? How is it different from append? ANS:- If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.

    19. What is open sql vs native sql? ANS:-

    20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it? ANS:-

    21. What is the meaning of ABAP/4 editor integrated with ABAP/4 data dictionary? ANS:-

    22. What are the events in ABAP/4 language? ANS:- Initialization, At selection-screen,Start-of-selection,end-of-selection,top-of-page,end-of-page, At line-selection,At user-command,At PF,Get,At New,At LAST,AT END, AT FIRST.

    23. What is an interactive report? What is the obvious diff of such report compared with classical type reports? ANS:- An Interactive report is a dynamic drill down report that produces the list on users choice. diff:- a) THE LIST PRODUCED BY CLASSICAL REPORT DOESN'T allow user to interact with the system

  • the list produced by interactive report allows the user to interact with the system. b) ONCE A CLASSICAL REPORT EXECUTED USER LOOSES CONTROL.IR USER HAS CONTROL. c) IN CLASSICAL REPORT DRILLING IS NOT POSSIBLE.IN INTERACTIVE DRILLING IS POSSIBLE.

    24. What is a drill down report? ANS:- Its an Interactive report where in the user can get more relavent data by selecting explicitly.

    25. How do you write a function module in SAP? describe. ANS:- creating function module:- called program - se37-creating funcgrp,funcmodule by assigning attributes,importing,exporting,tables,exceptions. calling program - SE38-in pgm click pattern and write function name- provide export,import,tables,exception values.

    26. What are the exceptions in function module? ANS:- COMMUNICATION_FAILURE SYSTEM_FAILURE

    27. What is a function group? ANS:- GROUP OF ALL RELATED FUNCTIONS.

    28. How are the date and time field values stored in SAP? ANS:- DD.MM.YYYY. HH:MM:SS

    30. Name a few data dictionary objects? //rep// ANS:- TABLES,VIEWS,STRUCTURES,LOCK OBJECTS,MATCHCODE OBJECTS.

    31. What happens when a table is activated in DD? ANS:- It is available for any insertion,modification and updation of records by any user.

    32. What is a check table and what is a value table? Check table will be at field level checking. Value table will be at domain level checking ex: scarr table is check table for carrid.

    33. What are match codes? describe? ans:-

  • It is a similar to table index that gives list of possible values for either primary keys or non-primary keys.

    34. What transactions do you use for data analysis? ANS:-

    35. What is table maintenance generator? ANS:-

    36. What are ranges? What are number ranges? ANS:- max,min values provided in selection screens.

    37. What are select options and what is the diff from parameters? ANS:- select options provide ranges where as parameters do not.

    SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection table.

    SELECT-OPTIONS FOR .

    A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH. The type of LOW and HIGH is the same as that of . The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply) The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern. diff:- PARAMETERS allow users to enter a single value into an internal field within a report. SELECT-OPTIONS allow users to fill an internal table with a range of values.

    For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing Goto - Text elements - Selection texts - Change.

    Eg:- Parameters name(30). when the user executes the ABAP/4 program,an input field for 'name' will appear on the selection screen.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts.

  • 38. How do you validate the selection criteria of a report? And how do you display initial values in a selection screen? ANS:- validate :- by using match code objects. display :- Parameters default 'xxx'. select-options for spfli-carrid.

    39. What are selection texts? ANS:-

    40. What is CTS and what do you know about it? ANS:-

    The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project. For practical information on working with the Change and Transport System, see Change and Transport Organizer and Transport Management System.

    41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it? ANS:-

    42. What is the client concept in SAP? What is the meaning of client independent? ANS:-

    43. Are programs client dependent? ANS:- Yes.Group of users can access these programs with a client no.

    44. Name a few system global variables you can use in ABAP programs? ANS:- SY-SUBRC,SY-DBCNT,SY-LILLI,SY-DATUM,SY-UZEIT,SY-UCOMM,SY-TABIX..... SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED.

    45. What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement? ANS:-

  • i)It is a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need. ii)using SY-DBCNT. iii)The number of memory allocations the system need to allocate for the next record population.

    46. How do you take care of performance issues in your ABAP programs? Performance of ABAPs can be improved by minimizing the amount of data to be transferred. The data set must be transferred through the network to the applications, so reducing the amount OF time and also reduces the network traffic.

    Some measures that can be taken are:

    - Use views defined in the ABAP/4 DDIC (also has the advantage of better reusability). - Use field list (SELECT clause) rather than SELECT *. - Range tables should be avoided (IN operator) - Avoid nested SELECTS.

    i)system tools

    ii)field symbols and field groups. ans:- Field Symbols : Field symbols are placeholders for existing fields. A Field Symbol does not physically reserve space for a field,but points to a field which is not known until runtime of the program. eg:- FIELD-SYMBOL [].

    Field groups : A field group combines several fields under one name.At runtime,the INSERT command is used to define which data fields are assigned to which field group. There should always be a HEADER field group that defines how the extracted data will be sorted,the data is sorted by the fields grouped under the HEADER field group.

    47. What are datasets? ANS:- The sequential files(ON APPLICATION SERVER) are called datasets. They are used for file handling in SAP.

    48. How to find the return code of a statement in ABAP programs? ANS:- Using function modules.

    49. What are interface/conversion programs in SAP? ANS :

  • CONVERSION : LEGACY SYSTEM TO FLAT FILE. INTERFACE : FLAT FILE TO SAP SYSTEM.

    50. Have you used SAP supplied programs to load master data?

    51. What are the techniques involved in using SAP supplied programs? Do you prefer to write your own programs to load master data? Why?

    52. What are logical databases? What are the advantages/disadvantages of logical databases? ANS:- To read data from a database tables we use logical database. A logical database provides read-only access to a group of related tables to an ABAP/4 program.

    adv:- The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data. i)An easy-to-use standard user interface. ii)check functions which check that user input is complete,correct,and plausible. iii)meaningful data selection. iv)central authorization checks for database accesses. v)good read access performance while retaining the hierarchical data view determined by the application logic.

    disadv:- i)If you donot specify a logical database in the program attributes,the GET events never occur. ii)There is no ENDGET command,so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION).

    53. What specific statements do you using when writing a drill down report? ans:- AT LINE-SELECTION,AT USER-COMMAND,AT PF.

    54. What are different tools to report data in SAP? What all have you used? ans:-

    55. What are the advantages and disadvantages of ABAP/4 query tool?

    56. What are the functional areas? User groups? and how does ABAP/4 query work in relation to these?

    57. Is a logical database a requirement/must to write an ABAP/4 query?

  • 59. What are Change header/detail tables? Have you used them?

    60. What do you do when the system crashes in the middle of a BDC batch session? ans:- we will look into the error log file (SM35).

    61. What do you do with errors in BDC batch sessions? ANS:- We look into the list of incorrect session and process it again. To correct incorrect session we analyize the session to determine which screen and value produced the error.For small errors in data we correct them interactively otherwise modify batch input program that has generated the session or many times even the datafile.

    62. How do you set up background jobs in SAP? What are the steps? What are the event driven batch jobs? ans:- go to SM36 and create background job by giving job name,job class and job steps(JOB SCHEDULING)

    63. Is it possible to run host command from SAP environment? How do you run?

    64. What kind of financial periods exist in SAP? What is the relavent table for that?

    65. Does SAP handle multiple currencies? Multiple languages? ans:- Yes.

    66. What is a currency factoring technique?

    67. How do you document ABAP/4 programs? Do you use program documentation menu option?

    68. What is SAPscript and layout set? ans:- The tool which is used to create layout set is called SAPscript. Layout set is a design document.

    69. What are the ABAP/4 commands that link to a layout set? ans:- control commands,system commands,

    70. What is output determination?

  • 71. What are IDOCs? ans:- IDOCs are intermediate documents to hold the messages as a container.

    72. What are screen painter? menu painter? Gui status? ..etc. ans:- dynpro - flow logic + screens. menu painter - GUI Status - It is subset of the interface elements(title bar,menu bar,standard tool bar,push buttons) used for a certain screen. The status comprises those elements that are currently needed by the transaction.

    73. What is screen flow logic? What are the sections in it? Explain PAI and PBO. ans:- The control statements that control the screen flow. PBO - This event is triggered before the screen is displayed. PAI - This event is responsible for processing of screen after the user enters the data and clicks the pushbutton.

    74. Overall how do you write transaction programs in SAP? ans:- Create program-SE93-create transcode-Run it from command field.

    75. Does SAP has a GUI screen painter or not? If yes what operating systems is it available on? What is the other type of screen painter called?

    76. What are step loops? How do you program pagedown pageup in step loops? ans:- step loops are repeated blocks of field in a screen.

    77. Is ABAP a GUI language? ANS:- Yes. ABAP IS AN EVENT DRIVEN LANGUAGE.

    78. Normally how many and what files get created when a transaction program is written? What is the XXXXXTOP program? ans:- ABAP/4 program. DYNPRO

    79. What are the include programs? ANS:- When the same sequence of statements in several programs are to be written repeadly

  • they are coded in include programs (External programs) and are included in ABAP/4 programs.

    80. Can you call a subroutine of one program from another program? ans:- Yes- only external subroutines Using 'SUBMIT' statement.

    81. What are user exits? What is involved in writing them? What precations are needed?

    82. What are RFCs? How do you write RFCs on SAP side?

    83. What are the general naming conventions of ABAP programs? ANS:- Should start with Y or Z.

    84. How do you find if a logical database exists for your program requrements? ans:- SLDB-F4.

    85. How do you find the tables to report from when the user just tell you the transaction he uses? And all the underlying data is from SAP structures? ans:- Transcode is entered in command field to open the table.Utilities-Table contents-display.

    86. How do you find the menu path for a given transaction in SAP? ans:-

    87. What are the different modules of SAP? ans:- FI,CO,SD,MM,PP,HR.

    89. How do you get help in ABAP? ans:- HELP-SAP LIBRARY,by pressing F1 on a keyword.

    90. What are different ABAP/4 editors? What are the differences? ans:-

    91. What are the different elements in layout sets? ans:- PAGES,Page windows,Header,Paragraph,Character String,Windows.

    92. Can you use if then else, perform ..etc statements in sap script? ans:- yes.

  • 93. What type of variables normally used in sap script to output data?

    94. How do you number pages in sapscript layout outputs?

    95. What takes most time in SAP script programming? ANS:- LAYOUT DESIGN AND LOGO INSERTION.

    96. How do you use tab sets in layout sets?

    97. How do you backup sapscript layout sets? Can you download and upload? How?

    98. What are presentation and application servers in SAP? ANS:- The application layer of an R/3 System is made up of the application servers and the message server. Application programs in an R/3 System are run on application servers. The application servers communicate with the presentation components, the database, and also with each other, using the message server.

    99. In an ABAP/4 program how do you access data that exists on a presentation server vs on an application server? ans:- i)using loop statements. ii)flat

    100. What are different data types in ABAP/4? ans:- Elementary - predefined C,D,F,I,N,P,T,X. userdefined TYPES. ex: see in intel book page no 35/65

    Structured - predefined TABLES. userdefined Field Strings and internal tables.

    101. What is difference between session method and Call Transaction? ans:-

    102. Setting up a BDC program where you find information from? ans:-

    103. What has to be done to the packed fields before submitting to a BDC session. ans:- fields converted into character type.

  • 104. What is the structure of a BDC sessions. ans:- BDCDATA (standard structure).

    105. What are the fields in a BDC_Tab Table. ans:- program,dynpro,dynbegin,fnam,fval.

    106. What do you define in the domain and data element. Technical details like

    107. What is the difference between a pool table and a transparent table and how they are stor