You are on page 1of 20

ABAP Questionnaire

1.What are the different ways you would access data from the database? Ans : Select-endselect, select using join, select into ITAB, using LDB. 2.Which of the above modes of Data base access would u prefer in your coding and why? Ans : Using LDB, Select into Itab, select using join last and the least is select-endselect. 3.a) How would you speed up database access? Ans : Create database views and Indexes 3.b)What is a database index? Ans : An index is a DB object that can be created so that records from the data base can be accessed faster. Database index is by default created for a primary key. For other conditions in where clause of a select statement, we have to create a database index and these are called secondary indexes. 4.Under what conditions a database index would be accessed? Ans : The order of creating the index field should 100% match with the where condition in the select. 5.What are the different methods of called one program from another Ans : Submit, Call transaction, Calling an external subroutine 6.How do u pass variables between two subroutines and what are the difference between the two methods Ans : Passing by value and Passing by reference. In passing by value the value of the parameter will not be changed by the sub routine while in the passing by reference method the value of the passed parameter will be changed. 7.How do u pass values between two programs? Ans : SPA/GPA parameter, Import/Export parameter, use INDX cluster table 8.What are table controls and what is the difference between table control and step loops? Ans : Table controls one block of rows, step loops multiple blocks of rows. A step loop defines a kind of table, which contains the elements in a number of repeated lines or blocks. You can define a step loop as fixed or variable. Step loops are similar to table controls, but have less functional scope. You can convert step loops to table controls. If you have a step loop in your screen, you can place the cursor on a particular element in the step loop block. Use the LINE parameter, entering the line of the loop block where you want to place the cursor: SET CURSOR FIELD <fieldname> LINE <line>. If you want, you can use the OFFSET and LINE parameters together. A step loop is a repeated series of field-blocks in a screen. Each block can contain one or more fields, and can extend over more than one line on the screen. Step loops as structures in a screen do not have individual names. The screen can contain more than one step loop, but if so, you must program the LOOP...ENDLOOPs in the flow logic accordingly. The ordering of the LOOP...ENDLOOPs must exactly parallel the order of the step loops in the screen. The ordering tells the system which loop processing to apply to which loop. Step loops in a screen are ordered primarily by screen row, and secondarily by screen column.

Transaction TZ61 (development class SDWA) implements a step loop version of the table you saw in transaction TZ60. Screen 200 for TZ61, shows the following step loop: See the TZ61 code for a demonstration of how to use step loops. Static and Dynamic Step Loops Step loops fall into two classes: static and dynamic. Static step loops have a fixed size that cannot be changed at runtime. Dynamic step loops are variable in size. If the user re-sizes the window, the system automatically increases or decreases the number of step loop blocks displayed. In any given screen, you can define any number of static step loops, but only a single dynamic one. You specify the class for a step loop in the Screen Painter. Each loop in a screen has the attributes Looptype (fixed=static, variable=dynamic) and Loopcount. If a loop is fixed, the Loopcount tells the number of loop-blocks displayed for the loop. This number can never change. Programming with static and dynamic step loops is essentially the same. You can use both the LOOP and LOOP AT statements for both types. Looping in a Step Loop When you use LOOP AT <internal-table> with a step loop, the system automatically displays the step loop with vertical scroll bars. The scroll bars, and the updated (scrolled) table display, are managed by the system. Use the following additional parameters if desired: FROM <line1> and TO <line2> These parameters limit the parts of the internal table that can be displayed or processed in the step loop. If you use one or both of these, declare <line1> and <line2> in ABAP with LIKE SYTABIX. If you dont use them, the system simply uses the beginning and/or end of the internal table as the limit. CURSOR <scroll-var> The CURSOR parameter tells which internal table row should be the first in the screen display. <Scroll-var> is a local program variable that can be set either by your program or automatically by the system. The value of <scroll-var> is absolute with respect to the internal table (that is, not relative to the FROM or TO values). The CURSOR <scroll-var> parameter is required in the PBO event to tell the system where to start displaying. 9) What you will do while writing BDC explain the process of BDC? Ans.: 1. Analyze the Data. 2. Generate SAP structure. 3. Develop transfer program 4. Create sequential file. 5. Create batch input program. 6. Process batch input data 10) Write statement if I want to remove the leading zeros how is it possible in reports? Use the decimals addition and give the specification. 11) What is the difference between transparent tables and pooled tables? 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 pool or table cluster should be used exclusively for storing internal control information

(screen sequences, program parameters, temporary data, continuous texts such as documentation). All data of commercial relevance is stored exclusively in transparent tables! Basically a transparent table is existent in the data base while the pooled table exists only in the dictionary. 12) What are the different types of events? The following are the different types of events. Initialization, Start-of-selection, End-of-selection, Selection-screen, Value-request, Top-of-page, End-of-page. 13) How to find the secondary Lists? The level of the secondary list can be found by looking at the system variable SY-LSIND. 14) How many secondary lists you can drill down? 20 15) Explain Get and Get Late event GET:- This is the most important event for executable programs that use a logical database. It occurs when the logical database has read a line from the node <table> and made it available to the program in the work area declared using the statement NODES <table>. When you call a logical database using the function module LDB_PROCESS, its selection screen is not displayed. Instead, you fill the selections using the interface parameters of the function module. The logical database does not trigger any GET events in the calling program, but passes the data back to the caller in callback routines. Calling a logical database using LDB_PROCESS thus decouples the actual data retrieval from the preceding selection screen processing and the subsequent data processing. There is no need to adapt a logical database for use with LDB_PROCESS, except in the following cases: If you do not adapt a logical database, it is not possible to use the function module to call the same logical database more than once. The PAI subroutine is not called when you use LDB_PROCESS. This means that none of the checks for selections programmed in it are performed. You can work around these restrictions by including the subroutines LDB_PROCESS_INIT and LDB_PROCESS_CHECK_SELECTIONS in the database program. Read Depth and Callback Routines When you link a logical database with an executable program, the GET statements determine the depth to which the logical database is read. When you call the function module LDB_PROCESS, you determine the depth by specifying a node name in the CALLBACK parameter. For each node for which you request data, a callback routine can be executed at two points. These correspond to the GET and GET LATE events in executable programs. In the table parameter CALLBACK, you specify the name of the callback routine and the required execution point for each node. A callback routine is a subroutine in the calling program or another program that is to be executed at the required point. For the GET event, the callback routine is executed directly after the data has been read for the node, and before the subordinate nodes are processed. For the GET_LATE event, the callback routine is processed after the subordinate nodes have been processed. The line type of the table parameter CALLBACK is the flat structure LDBCB from the ABAP Dictionary. It has the following components: LDBNODE Name of the node of the logical database to be read. GET A flag (contents X or SPACE), to call the corresponding callback routine at the GET event.

GET_LATE A flag (contents X or SPACE), to call the corresponding callback routine at the GET LATE event. CB_PROG Name of the ABAP program in which the callback routine is defined. CB_FORM Name of the callback routine. If you pass an internal table to the CALLBACK parameter, you must fill at least one of the GET or GET_LATE columns with X for each node (you may also fill both with X). A callback routine is a subroutine that must be defined with the following parameter interface: FORM <subr> USING <node> LIKE LDBCB-LDBNODE <wa> [TYPE <t>] <evt> <check>. The parameters are filled by the function module LDB_PROCESS. They have the following meaning: <node> contains the name of the node. <wa> is the work area of the data read for the node. The program that calls the function module LDB_PROCESS and the program containing the callback routine do not have to declare interface work areas using NODES or TABLES. If the callback routine is only used for one node, you can use a TYPE reference to refer to the data type of the node in the ABAP Dictionary. Only then can you address the individual components of structured nodes directly in the subroutine. If you use the callback routine for more than one node, you cannot use a TYPE reference. In this case, you would have to address the components of structured nodes by assigning them one by one to a field symbol. <evt> contains G or L, for GET or GET LATE respectively. This means that the subroutine can direct the program flow using the contents of <evt>. <check> allows the callback routine to influence how the program is processed further (but only if <evt> contains the value G). The value X is assigned to the parameter when the subroutine is called. If it has the value SPACE when the subroutine ends, this flags that the subordinate nodes of the logical database should not be processed in the function module LDB_PROCESS. This is the same as leaving a GET event block using CHECK in an executable program. If this prevents unnecessary data from being read, it will improve the performance of your program. 16) How to create Logical database? The following is the procedure to create a Logical Database. 1. Enter a name on the initial screen of the Logical Database Builder and choose Create. 2. A dialog box appears. Enter a short text. You can change this later by choosing Extras Short text or Administration info. 3. Once you have entered the short text, you must define the root node of the logical database. Enter the node name and its attributes. There are three different types of nodes: Database tables. The table must be active in the ABAP Dictionary. Tables always have a flat structure. The name of the node must correspond with the name of the table. Data types from the ABAP Dictionary: The node may refer to any data type in the ABAP Dictionary. The node name and the name of the data type do not have to be the same. You can use deep data types as nodes.

Data types from type groups: The node can also refer to a data type from a type group in the ABAP Dictionary. Enter the name of the type group in the corresponding field. You must choose Other types before specifying this type. Data types in type groups were the forerunners of real data types in the ABAP Dictionary. Wherever possible, you should use ABAP Dictionary data types. They have all of the semantic properties of their underlying data elements. This is useful, for example, when you use a logical database to create ABAP Queries. You can use the Text from Dictionary function to adopt the text stored in the ABAP Dictionary for the relevant table or data type. The structure editor of the Logical Database Builder appears. On the left is the name of the root node, followed by a code for the node type: T for a database table, S for a ABAP Dictionary type, and C for a type from a type group. The new logical database now has a structure with a single node. You can now extend the structure as described in Editing the Structure. If you choose Next screen (right arrow in the application toolbar), a screen appears on which you can enter a search help for the logical database as described under Editing Search Helps. If you choose Next screen (right arrow in the application toolbar), a dialog box appears, asking you whether the system should generate the selections for the logical database. When you have confirmed the dialog box, a list appears, on which you can select all of the nodes that you want to use for field selections or dynamic selections. The fields that you select are included in the source code generated by the system for the selection include. The generated selection include is displayed in the ABAP Editor. You can change it as described in Editing Selections. If you choose Next screen (right arrow in the application toolbar), a dialog box appears, asking you whether the system should generate the database program for the logical database. The database program is generated from the structure and the selection include. It has a modular structure, consisting of several include programs and all of the necessary subroutines, with proposals for the statements that will read the data. The generated database program is displayed in the ABAP Editor. You can change it as described in Editing the Database Program. If you repeatedly choose Previous screen (left arrow in the application toolbar), you can display and change the general attributes of the logical database. Finally, you can maintain optional selection texts and documentation. 17) When would an at-line-selection trigger? When the user triggers the function code PICK, AT LINE-SELECTION is always triggered if the cursor is positioned on a list line. If you assign PICK to other function keys or menu entries, AT LINE-SELECTION is also triggered when the user chooses then. You should avoid this for the sake of the semantics. 18) In at-line-selection event each time top-of-page event is executed or not? No. Top-of-page during line-selection would be triggered. 19) When top-of-page event is executed? The TOP-OF-PAGE event occurs as soon as the system starts processing a new page of a list. The system processes the statements following TOP-OF-PAGE before outputting the first line on a new page. 20) How to define message error in Report?

MESSAGE E005(ME) WITH S_BWKEY. This is the definition of the message error in the report bue message class has to be declared before it can be used. 21) When at user command will execute? If the user chooses a function code during list processing that is neither processed by the system, or PICK or PF<nn>, the system triggers the event AT USER-COMMAND. 22) What are Client Independent and Client dependent? In commercial, organizational and technical terms, a self-contained unit in an R/3 System with separate master records and its own set of tables. Some features are different for different clients, which are called client dependent and some features are uniform over the different clients such features are called client dependent. 23) What are the standard paragraph attributes? In the Standard attribute group, you find the general attributes that can be defined in paragraph formats: Description, left/right margin, indent first line, space before/after, alignment, line spacing, no blank lines, page protection, next paragraph same page. 24) What protect command will do? In the SAP Script editor the text between the PROTECT and ENDPROTECT commands will be adjusted so that the text is not broken by the page break. 25) What are the different types of tables? The following are the different types of tables: - transparent tables, cluster tables, pool tables, check tables etc. 26) What is cluster database? Cluster databases are special relational databases in the ABAP Dictionary that you can use to store data clusters. Their line structure is divided into a standard section, containing several fields, and one large field for the data cluster. The rules for the structure of a cluster database are listed below. The fields listed in steps 1 to 4 must be created as key fields. The data types listed are ABAP Dictionary types. 1. If the table is client-dependent, the first field must have the name MANDT, type CHAR, and length 3 bytes. It is used for the client number. The system fills the MANDT field when you save a data cluster - either automatically with the current client or with a client that you explicitly specify in the EXPORT statement. 2. The next field (the first field in the case of client-independent tables) must have the name RELID, type CHAR, and length 2 bytes. This contains an area ID. Cluster databases are divided into different areas. The system fills the field RELID with the area ID specified in the EXPORT statement when it saves a data cluster. 3. The next field has type CHAR and variable length. It contains the name <key> of the cluster, specified in the program with the addition ID in the EXPORT statement. Since the next field is aligned, the system may fill out the field RELID with up to three unused bytes. When you create your own cluster databases, you should plan for the length of this field. 4. The next field must have the name SRTF2, the type INT4, and length 4. Single data clusters can extend over several lines of the database table. Theoretically, up to 2**31 lines are possible. The field SRTF2 contains the current line number within the data cluster. Its value can be from 0 to 2**31 -1. The field is filled automatically by the system when you save a data cluster (see step 7). 5. After SRTF2, you can include any number of user data fields of any name and type. The

system does not automatically fill these fields when you save a cluster. Instead, you must assign values to them explicitly in the program before the EXPORT statement. These fields normally contain administrative information such as program name and user ID. 6. The penultimate field of a line must have the name CLUSTR and the type INT2 with length 2. This contains the length of the data in the following field CLUSTD. The field is filled automatically by the system when you save a data cluster. 7. The last field in the line must have the name CLUSTD and the type VARC. You can define it with any length. It is usually around 1000 bytes long. This is the field in which the system saves the actual data in the data cluster. The data is saved in compressed form. If CLUSTD is not long enough to accommodate a data cluster, it is split across two or more lines. The lines are numbered in field SRTF2 (see step 4). You can either create your own cluster databases by following the above rules (for further information, refer to the ABAP Dictionary documentation), or you can use the system cluster database INDX. 27) What is match code object? A match code object is an object that can be used to get the information regarding another object faster. It is like an index that will help in faster access of information.You first define the relevant tables and fields for the search in a matchcode object. A matchcode object describes the set of all possible search paths for a search string. You then create one or more matchcode IDs for a matchcode object. A matchcode ID describes a special search path for a search string. The matchcode ID defines the fields or field combinations to be used in the search. 28) What are the different types of BDC? The different types of BDC that can be carried out are Call Transaction Call Dialog and Batch input session. 29) How to find out error messages in call transaction? MESSAGE E005(ME) WITH S_BWKEY can be used at the location where we have to declare the error message. 30) What are the different mode parameters in call transaction using of the BDC thing ? You can use the MODE parameter to specify whether data transfer processing should be displayed as it happens. You can choose between three modes: A Display all. All screens and the data that goes in them appear when you run your program. N No display. All screens are processed invisibly, regardless of whether there are errors or not. Control returns to your program as soon as transaction processing is finished. E Display errors only. The transaction goes into display mode as soon as an error in one of the screens is detected. You can then correct the error.The display modes are the same as those that are available for processing batch input sessions. 31) What is Synchronous and Asynchronous? Synchronous means getting the data in the front end processing while asynchronous means getting data into the SAP system in the back ground processing methodin the former we would know what is happening while the data is being loaded and in the back ground processing an error log is created. Asynchronous processing is faster. 32) In call Transaction how will you identify message-IDs ? The MESSAGES specification indicates that all system messages issued during a CALL TRANSACTION USING are written into the internal table <MESSTAB> 33) What is cluster table & how is it used? The data of several cluster tables is stored together in a table cluster in the database. A cluster

table is thus known only in the ABAP Dictionary, but not in the database. 34) What are events are use in sap scripts? All the events that are used in interactive programming are used in the 35) What is pool table, transparent table, value table? A transparent table is that table which literally exists in the database. In some cases you can see when you define a domain that all the table fields or structure components referring to this domain should be checked against a certain table. This information can be stored in the domain by entering a value table. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables. 36) What is logical database? Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs. 37) What is Report & transaction explain it? A report a program that displays a set of data depending on a set of inputs given by the user and in the transaction depending on the input given by the user a set of transactions is carried out 38) What is Flow logic? Flow logic decides what should be carried out after what in the module pool programs it consists of the PAI and PBO processing. In the PAI processing we have the process that has to be carried out just after the input should be used for the validations and the processing after the press of a button this could be checked by using the ok_code. 39) What are events are used in BDC? The following are the events that are used in BDC:40) What is ABAP/4 memory? Area of memory assigned to a particular transaction and any modules called from there. ABAP memory does not depend on the ABAP program that generates it during a transaction. This means that any object stored there can be read by any ABAP program during the same transaction. Also there is another set of memory that has been allocated at the global level and can be used beyond the transaction limits. 41) What is Dynpro ? Dynpro is a member of the bdc data structure that is a number character data type that is of length 4 which is used to identify the Screen number that the current bdc is being carried out in. 42) What is Buffering? Area of memory assigned to a particular transaction and any modules called from there.ABAP memory does not depend on the ABAP program that generates it during a transaction. This means that any object stored there can be read by any ABAP program during the same transaction. 43) What is extraction? 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 <fg>. 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.

44) What is a variant? Can you transfer a variant? A variant is a set of input data that is given on a particular selection screen and has all the set of input data that has been given by the user which will stored in the database and will be presented to the user when the user requests for it. 45) What is module Pool? Module pool is the term used to describe the collection of ABAP language entities that drive a transaction. 46) How many types are messages are there? Error warning and information are the various types of messages. 47) What is SQL Trace? Performance trace function for monitoring and analyzing SQL statements used in reports and transactions. 48) What is open SQL and Native SQL? Open SQL consists of a set of ABAP statements that perform operations on the central database in the R/3 System. The results of the operations and any error messages are independent of the database system in use. Open SQL thus provides a uniform syntax and semantics for all of the database systems supported by SAP. ABAP programs that only use Open SQL statements will work in any R/3 System, regardless of the database system in use. Open SQL statements can only work with database tables that have been created in the ABAP Dictionary. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System. To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows: EXEC SQL [PERFORMING <form>]. <Native SQL statement> ENDEXEC. 49) What are Views and How many types are there? Application-specific view on different tables in the ABAP Dictionary.When you create a table, a key is assigned as required by the program. The fields contained there could be superfluous when solving a task or they might not be sufficient. In this case you can create a view on several tables or on parts of tables. 50) What are the events used in interactive reporting? The following are the events that are used in interactive reporting Initialization, AT Selection Screen, Start of Selection, End of Selection, Top of Page, End of Page,Interactive Reports Events, AT Line Selection, AT PF nn, AT user Command, Top of Page during Line Selection.In that order. 51) What is the difference between sy-tabix and sy-index Sy-tabix signifies the current row in the internal table while sy-index signifies the the current number of loop that the programs loop is in. 52) Which system variable stores the secondary list numbers? Sy-Lsind 53) How many Main Windows you can call in a single Form?99 54) How many secondary lists can be in Report? 20

55) How many message you can keep in a message ID? 999 56) Can you call a sub routine from a script Editor? Yes 57) What is the syntax of it? Perform P1 in Program <ProgramName> using P1 P2 Changing P3 P4 58) What is control break processing? When one level has been processed and a new level is started, a control break occurs. To define control levels in an ABAP program, you use ABAP keywords like AT NEW. Control breaks always correspond to a change in the content of a particular field. It is a process in which data in the specific fields are manipulated. 59) Name few control breaks. AT First AT New AT Last , On Change of 60) What is the use of Protect and End Protect statements. If you are going to Print the entire content of the paragraph without break in a single page. 61) What is Session? Set of Action managed sequentially. 62) What is the difference between Batch Input Session and Call transaction Methods? The following is the difference between batch input session and the Call transaction methods.in the call transaction method the processing can be carried out both in the fore ground and the back ground while in the batch input session method the processing is carried out only in the back ground and an error log is created if there is any error. 63) What is Data Class and Delivery Class? If you choose the data class correctly, your table is automatically assigned to the correct area (tablespace or DBspace) of the database when it is created. Each data class corresponds to a physical area in which all the tables assigned to this data class are stored. There are the following data classes: APPL0 (master data): Data which is seldomly changed. An example of master data is the data contained in an address file, such as the name, address and telephone number. APPL1 (transaction data): Data that is frequently changed. An example of transaction data is the goods in a warehouse, which change after each purchase order. APPL2 (organizational data): Customizing data that is defined when the system is installed and seldomly changed. An example is the table with country codes. Two further data classes, USR and USR1, are provided for the customer. These are for user developments. The tables assigned to these data classes are stored in a tablespace for user developments. Delivery Class determines the owner of the data in the table. 64) How do you fetch n number of rows from a data base table? Select * from table upto n rows. 65) What are the different methods of Buffering? Single Record Buffering Generic Full These are the properties, which are to be during creation of Table in technical settings. 66) What will happen when you are using Call function in Update Mask? You can also put the CALL FUNCTION IN UPDATE TASK into a subroutine and call the

10

subroutine with: PERFORM SUBROUT ON COMMIT. If you choose this method, the subroutine is executed at the commit. Thus the request to run the function in the update task is also logged during commit processing. As a result, the parameter values logged with the request are those current at the time of the commit. 67) Various events for a screen? When push button pressed, Function Keys ( Standard toolbars like back,cancel,exit,save etc) & Menu options. 68) What are reports and how do you set up reports? A report program reads and analyzes data from one or more database tables without modifying the database. Usually, the result of such a report program is in the form of a list which is output to the screen or sent to a printer. 69) What are user exits and transactions? One of the tools to modify and enhance the SAP standard applications to suit customer-specific criteria. SAP creates user exits for specific programs, screens and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the user exits act as hooks. You can hang your own add-on functionality onto these hooks. 70) Why user exits? To extend the functionality of your R/3 System, you should take advantage of the user exits available within the standard R/3 applications at least for two points. Do not affect standard SAP source code. Do not affect software upgrades. Transactions: A transaction is a program that conducts a dialog with the user. In a typical dialog, the system displays a screen on which the user can enter or request information. Based on the the user input or request, the program executes the appropriate actions like, it branches to the next screen, displays an output, or changes the database. 71) What table is used for BDC? BDCDATA. Stucture of BDCDATA: PROGRAM: Module pool DYNPRO: screen number DYNBEGIN: starting a dynpro FNAM: field name FVAL: field value 72) How do you set up batch process? Data analysis: Analyze the data that is to be transferred to the SAP System. Generate SAP structures: Generate SAP data structures for incorporation into your data export program. Develop transfer program: You can write the program in ABAP/4 or as an external program. Create sequential file: Export the data that is to be transferred, to a sequential file. Create batch input program: ABAP/4 batch input program that will read the data to be transferred from the sequential file. Process batch input data: Process the data and add it to the SAP System. You can do this either by: batch-input session method or Call transaction method. Analyse results: Check that all data has been successfully processed. Analyse Error session: Correct and re-process erroneous data. 73) What are the different types of programs? I Include Program M Module Pool

11

F S 1

Function Modules External Subroutines Online program

74) What does GET LATE do? If we want to process the database tables of a logical database that are hierarchically inferior to a specific database table, then we have to use the event GET as Get <table> Late. eg: If we want to know the total luggage weight on a particular date of a particular flight sectors we can use GET SFLIGHT LATE in F1S logical database. 75) What does CHAIN ....END CHAIN do? Sometimes you want to check several fields as a group. To do this, include the fields in a FIELD statement, and enclose everything in a CHAIN-ENDCHAIN block. Example **** Screen flow logic: **** CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled. 76) What are the differences between SELECT-OPTIONS,VARIANTS AND PARAMETERS? To enter values for variables on the selection screen, you must define the variables using the PARAMETERS statement. To enter a range of values for the variables on the selection screen we use SELECT-OPTIONS statement. If you want to run the same report program with the same selections at regular intervals (for example, for monthly sales statistics), In, ABAP/4 offers you combine the desired values for all these selections in one selection set. Such a selection set is called a VARIANTS. 77) What are the advantages of variants? Saves user work. Minimizes input error. Resulting list is more precise and fast. Entering exact values improves the runtime. For back ground processing, variant is the only way to pass values for the selection. 78) What is variable selection with variants? If you use variable values, you do not have to create a new variant for each change of the value set. Using variable date calculations (see Using Variable Date Calculations) If, in a variant, you want to use, for example, the date of the day or the last day of last month, you can use variable date calculation. Using user-specific values (see Using User-Specific Values). To fill certain selections with values that differ from user to user, you use a variant with user- specific values Using variables defined in Table TVARV (see Using Table TVARV). To fill certain selections with values that change according to the application, you use a variant which takes the variable values from Table TVARV. 79) How do you run programs with variants? To execute a report program with a variant, enter the name of the report on the initial screen of the ABAP/4 Editor and choose Execute with variant. A dialog window appears, on which you must enter the name of the desired variant.

12

80) What is SPA / GPA? When do you use it? To fill the input fields of a called transaction with data from the report, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-related SAP memory. You use the SAP memory to transfer values between programs beyond the borders of transactions. A user can access the values stored in the SAP memory during one terminal session for all modes used in parallel. Usually, the input fields on the initial screen of a transaction are connected to SPA/GPA parameters. If you fill these parameters from within your program before calling the transaction, the system fills the input fields with the corresponding values. 81) What are PBO and PAI? PBO modules: modules that are called before displaying the screen(process before output). PAI modules: modules that are called in response to the user input (process after input). 82) What is Screen painter and what are steps involved in writing scripts for command modules? The Screen Painter is a tool to develop a transaction's screens. Steps involved in using command modules: Define function codes Include ok_code in field list Declare ok-code in the Abap4 module pool program. using ok-code write flow control statements. 83) How can you test flow logic? Check function checks the syntax, data-consistency and screen layout of the screen. To test the syntax, from the menu path choose screen---->check-------> syntax. To test the data consistency, from the menu path choose screen---->check------> consistency. To check the layout, from the menu path choose screen----->check----->layout. 84) What happens if you choose hold data option in screen attributes? To retain data entered by a user. The system automatically displays this data if the user returns to this screen. 85) What happens if you enter 0 in NEXT screen attribute? In ABAP/4 each stackable sequence of screens is a "call mode". This is important because of the way you return from a given current sequence. To terminate a call mode and return to a suspended chain, set the "next screen" to 0 and leave to it: When you return to the suspended chain, execution resumes with the statement directly following the original CALL SCREEN statement. The original sequence of screens in a transaction is itself a calling mode. The original sequence of screens in a transaction is itself a calling mode. If you LEAVE TO SCREEN 0 in this sequence (that is, without having stacked any additional call modes), you return from the transaction altogether. 86) Where do you use pop-up windows? The user is to be warned of potential data loss The user should answer a question about further processing with Yes/no The user is to be warned about potential data loss, and decide whether he or she wants to continue with the action The user must choose between further processing alternatives The user must continue the current action or cancel The user is to input data (with or without check against a value table) Data is to be displayed to the user The user is to receive detailed information The user is to be able to scroll in a displayed list The user is to print data from a table or a table view

13

87) How many menu titles you can have in a main menu? You can have six menus in a menu bar.In addition to this system provides two more menus i.e. system and help. You can have only one menu bar for a status. You can maintain 15 entries in a menu and upto three levels. 88) Why and how do you display a message? What are the message types? An ABAP/4 module lets the system know that an error has occurred by issuing information, error or warning messages. you can also use success messages when a particular action is performed successfully. When the user presses ENTER, the current process is interrupted. The system returns the user to the SAP main menu using Abend message. Message is displayed using MESSAGE Xnnn, where X is the type of the message and nnn is the number of the message. You have to declare the Id of the message class in the program using MESSAGE-ID cc, where cc is the message class. 89) How and where do You create Message class? You can create a message class from two places in the system:from an Object class object list (in the Object Browser)from an ABAP/4 module (in the ABAP/4 editor)The most easy method is from the ABAP/4 module containing the PROGRAM statement. 1. Enter the MESSAGE-ID parameter value:

PROGRAM SAPMTZ31 MESSAGE-ID A&. 2. Double-click on the message-id name (here "A&"). The system responds with a dialog window asking whether you want to create the message class. Press Yes. You jump to the message-class screen. Then you create the message class. 90) What is BDC? Batch data communication or Batch input is the technique provided by SAP for transferring data from SAP systems and non SAP systems in to the system. 91) Where do you use it? Transferring data from another system when you install your SAP System regularly transferring data that is captured by a non-SAP system in your company into the SAP System. Assume, for example, that data collection in some areas of your company is still performed by a non-SAP system. You can still consolidate all of your data in the SAP System by exporting the data from the other system and reading it into the SAP System with batch input. You can also use batch input to transfer data between two R/3 Systems. However, there are more direct methods for doing this, such as RFC (remote function calls). 92) What has to be done to the packed fields before submitting to a BDC session? Declare these fields in the internal table as characters and the length of the field should be same as the field length of the field's data element. This internal table is used to hold the data fetched from the sequential file using WS-upload function module. 93) How do you find the string length of a variable? To determine the length of a character string up to the last character other than the leading SPACE, use the built-in function STRLEN as follows: Syntax [COMPUTE] <n> = STRLEN( <c> ). 94) What is the difference between the "change on-input" and "Change on request" in the PAI of a screen? ON INPUT The ABAP/4 module is called only if the field contains a value other than its initial value. This

14

initial value is determined by the field's data type: blanks for character fields, zeroes for numerics. ON REQUEST The ABAP/4 module is called only if the user has entered a value in the field value since the last screen display. The value counts as changed even if the user simply types in the value that was already there. 95) Where do you define Text elements in a Program? From Abap/4 editor(se38), choose object component text elements and change. You can choose either Text symbols or Selection Texts or Title and Headers and create. 96) What do you define in the Data element and Domain? For Data Element: The information includes the field's representation on the screen in the form of FIELD TEXTS, COLUMN CAPTIONS in list outputs of the table contents and the format of the output via PARAMETER IDS and Online field documentation. For Domain: Data Type, Field Length and the allowed data values are defined . 97) What is the typical structure of ABAP/4 Program? ABAP/4 is a fourth-generation language, which supports structured programming. It incorporates all the usual control structures (Flow control statements such as if and case) and modularization concepts (subroutines and function modules). 98) What are field symbols and field groups? Have you used component idx of structure with field groups? 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. Field symbols are comparable to the concept of pointers as used in the programming language C. An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement. 99) What is batch input session? What is the alternative to Batch input session? One of the two recommended ways to process batch input data is to store the data in a batch input session. This session can then be run in the SAP System to enter the batch input data into the system. Another way is CALL TRANSACTION USING METHOD. 100) A situation: an abap program creates batch input session. we need to submit the program and the batch session in background. How to do it? Schedule both the batch input program and RSBDCSUB in the background. If you designate the batch input job as the predecessor for RSBDCSUB, then RSBDCSUB will be started automatically when the batch input job successfully completes. 101) What are the problems in processing batch input sessions and how is batch input process different from processing online? The batch input methods work by carrying out normal SAP transactions, just as a user would. However, batch-input can execute the transactions automatically and is therefore suitable for entering large amounts of data that are already available in electronic form. 102) What are the different types of data dictionary objects? Basic objects such as Tables, structures, data elements and domains. Aggregate objects such as Lock objects, matchcode objects and views. 40) What is the step-by-step process to create a table in data dictionary? 1. Selecting the table fields 2. Maintaining foreign keys 3. Creating secondary indexes (optional)

15

4. 5.

Maintaining technical settings Activating a table

103) Can a transparent table exist in a data dictionary but not in the data base physically? No 104) Can you create a table with fields not referring to data elements? Yes. If you want to specify no data element and therefore no domain for a field, you can enter data type and field length and a short text directly in the table maintenance. This option is intended for fields, which do not appear on screens, above all for fields for interface structures. 105) What is the advantage of structures and how do you use them in Abap4 programs? A structure is defined in the ABAP/4 Dictionary like a table and can be accessed from ABAP/4 programs. Any change to the definition of the structure in the ABAP/4 Dictionary is automatically implemented in all programs. While data in tables is stored permanently in the database, structures contain data only during the runtime of a program. Structures are used in abap/4 programs to transfer data between programs, as it is globally defined. Structures are used in particular for defining data at the interface between module pools and screens and for standardizing parameters for function modules. 106) What does an extract statement do in the Abap/4 program? With the first EXTRACT statement of a report, the system creates the extract dataset and adds the first extract record. With each subsequent EXTRACT statement, the system adds another extract record to the extract dataset. 107) What is a collect statement and how is it different from the append statement? To fill an internal table with lines, which have unique standard keys, we use the COLLECT statement.If an entry with the same key already exists, the COLLECT statement does not append a new line as APPEND statement, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry. 108) What is an open SQL vs. Native SQL? Open SQL allows you to access all database tables known to the SAP system, regardless of the database manufacturer. Sometimes, however, we may want to use database-specific SQL statements called Native SQL in your ABAP/4 program.To avoid incompatibilities between different database tables and also to make ABAP/4 programs independent of the database system in use, SAP has created a set of separate SQL statements called Open SQL. Open SQL contains a subset of standard SQL statements as well as some enhancements, which are specific to SAP. A database interface translates SAP's Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly. 109) What does an EXEC SQL statement do in ABAP? What is the disadvantage of using it? To use a Native SQL statement, it must be preceded by an EXEC SQL statement and concluded by an ENDEXEC statement. An ABAP/4 program with Native SQL statements does not generally run with different databases. 110) What are the events used in ABAP4? The events are START-OF-SELECTION, END-OF-SELECTION, AT SELECTION-SCREEN TOP-OF-PAGE, TOP-OF-PAGE DURING LINE SELECTION, END-OF-PAGE, INITIALIZATION, AT USER-COMMAND, AT LINE-SELECTION, AT PF<NN>, GET,GET LATE. 111) What are interactive reports ? What is the obvious difference of such reports with HTML type reports? Interactive reporting allows the user to participate actively in retrieving and presenting data during the session. Instead of one extensive and detailed list, with interactive reporting you create a

16

condensed basic list from which the user can call detailed information by positioning the cursor and entering commands. Interactive reporting thus reduces information retrieval to the data actually required. Detailed information is presented in secondary lists. A secondary list may either overlay the basic list completely or appear in an additional dialog window on the same screen. The secondary list can itself be interactive again. Apart from creating secondary lists, interactive reporting also allows to call transactions or other reports from lists. These programs then use values displayed in the list as input values. The user can, for example, call a transaction from within a list to change the database table whose data is displayed in the list. 112) What are drill down reports? Drill down reports are interactive reports. 113) How do you write a function module in SAP? Function modules are special external subroutines which performs specific tasks and are stored in the central library.From ABAP4 programs these function modules are accessed using CALL FUNCTION STATEMENT. 114) What are the exceptions in function module? Exceptions are used to handle error scenarios which can occur in function modules. The calling program checks whether any errors have occurred and then takes action accordingly.eg.,Notfound,not-valid,communication failure etc 115) What is a function group? A function group combines all the function modules that are logically belongs together. 116) What is the meaning of Abap/4 editor integrated with Data dictionary? What ever changes have been made in the data dictionary would be visible in the abapedotor and any changes wich are not consistent with the programs would not be allowed.. 117) How are the date and time field values stored in SAP? Date fields are stored in SAP as characters of length 8 and time fields are stored as characters of length 6. 118) Name a few data dictionary objects? Tables ,structures, domains, data elements,matchcode objects, lock objects,views. 119) What happens when a table is activated in DD? When the table is activated, a physical table definition in the database is added to the table definition stored in the ABAP/4 Dictionary. The database-independent table definition from the ABAP/4 Dictionary is translated into a definition of the relevant database. 120) What is a check table and What is a value table? The relational data model contains not only tables, but also relationships between tables. These relationships are defined in the ABAP/4 Dictionary by foreign keys. An important function of foreign keys is to support data integrity in the relational data model. Foreign key fields may assume only those values allowed by the check table, in other words, values occurring in the primary key of the check table. A foreign key provides a link between two tables, for eg.,T1 and T2 by including a reference in table T1 to the primary key of table T2. For this purpose, Foreign key fields assigned to the primary key fields of T2 are included in T1. Table T1, which is the one being checked, is called a foreign key table, and table T2 is called a check table. The terms dependent (foreign key) table and referenced (check) table are also used.VALUE TABLE:If the domain of the check field has a value table, this is proposed by the system as check table in the foreign field maintenance. The key fields of the value table are in this case assigned fields of the foreign key table with the same domain. These fields may assume only those values allowed by the value table.The value range of the domain can be defined by specifying value table.All table fields referring to this domain can then be checked against the corresponding field of this value

17

table.In order the check can be executed, a foreign key must be defined for the value table. 121) What are matchcodes? Describe? A matchcode is a tool to search for data records in the system. Matchcodes are an efficient and user-friendly search aid for cases where the key of a record is unknown. It consists of two stages one is Match code object and the other is Matchcode ID.A matchcode object describes the set of all possible search paths for a search term. Matchcode ID describes a special search path for a search term. 122) What transactions do you use for data analysis? The following are the transactions that we use for the data analysis : se16 se11 se17. 123) What are ranges? What are number ranges? It is often necessary to directly access individual records in a data structure. This is done using unique keys. Number ranges are used to assign numbers to individual database records for a commercial object, to complete the key. Such numbers are e.g. order numbers or material master numbers. 124) What are selection texts? Selection texts are text elements used to change the text on the selection screen. 125) How do you validate the selection criteria of a report? And how do you display initial values in a selection screen? The selection criteria is validated in the processing block of the AT SELECTION SCREEN event for the input values on the screen and respective messages can be sent. To display initial values in the selection screen: Use INITIALIZATION EVENT Use DEFAULT VALUE option of PARAMETERS Statement Use SPA/GPA Parameters (PIDs). 126) What is the Client concept in SAP? What is the meaning of Client independent? In commercial, organizational and technical terms, the client is a self-contained unit in the R3 system, with separate set of Master data and its own set of Tables. When a change is made in one client all other clients are affected in the system - this type of objects are called Client independent objects. 127) Are programs client dependent? No. Programs are not client dependent man!!! 128) Name a few system global variables you can use in ABAP programs? SY-UNAME, SY-DATUM, SY-UZEIT, SY-SUBRC, SY-TABIX, SY-UCOMM. 129) What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement? Data structure exists only during the runtime of the program. It contains a number of identically structured table lines with or without header line. DESCRIBE TABLE <ITAB> LINES <L>. L gives the no. of filled lines. DESCRIBE TABLE <ITAB> OCCURS <OC>. OC gives the no. of defined while declaring the internal table. (The no.of lines defined in the OCCURS statement.) 130) How do you take care of performance issues in ABAP/4 programs? Using RUNTIME ANALYSIS TOOL and SQL TRACE. 131) What are extract datasets? An extract dataset is a sequential dataset in the report's storage area. It consists of sequence of records of predefined structure. Structure need not be identical for all the records. It can be

18

accessed only within LOOPS. 132) How to find a return code of a statement in ABAP program. Get the return code from the system field SY-SUBRC. 0 is success. 133) What is Internal table? BC Basis Components--ABAP workbench--BC ABAP reporting tutorial--Structures and internal tables. Internal tables are table objects that only exist for the runtime of the program. There are several ABAP statements for working with internal tables, for example, append, insert, delete, or find lines.The number of lines of an internal table is extended dynamically at runtime as required. You can use internal tables for table calculations on subsets of database tables. For example, you can read a part of one or more database tables into an internal table. They also allow you to reorganize their contents to suit the needs of your program. You can, for example, read particular entries from one or more large customer tables into an internal table, and then use them to create a list. When you run your program, you can access this data directly, instead of having to search for each record in the database. 134) What is BDC and how you use it? BC Basis Components--ABAP workbench--BC Basis Programming interfaces--Data transfer. During data transfer, data is transferred from an external system into the SAP R/3 System. Transfer data from an external system into an R/3 System as it is installed. Transfer data regularly from an external system into an R/3 System. Example: If data for some departments in your company is input using a system other than the R/3 System, you can still integrate this data in the R/3 System. To do this, you export the data from the external system and use a data transfer method to import it into the R/3 System. Batch input with batch input sessions : Data consistency check with the help of screen logic. With the batch input method, an ABAP program reads the external data that is to be entered in the R/3 System and stores the data in a "batch input session". The session records the actions that are required to transfer data into the system using normal SAP transactions. When the program has generated the session, you can run the session to execute the SAP transactions in it. You can explicitly start and monitor a session with the batch input management function (by choosing System Services Batch input), or have the session run in the background processing system. Use the BDC_OPEN_GROUP function module to create a new session. Once you have created a session, then you can insert batch input data into it with BDC_INSERT. Use the BDC_INSERT function module to add a transaction to a batch input session. Use the BDC_CLOSE_GROUP function module to close a session after you have inserted all of your batch input data into it. 135) What is Dataset and how you use it? ABAP/4 provides three statements for handling files: The OPEN DATASET statement opens a file.The CLOSE DATASET statement closes a file. The DELETE DATASET statement deletes a file. To open a file for read access, use the FOR INPUT option of the OPEN DATASET statement. To open a file for write access, use the FOR OUTPUT option of the OPEN DATASET statement. To open a file for appending data to the file, use the FOR APPENDING option of the OPEN DATASET statement To process a file in binary mode, use the IN BINARY MODE option of the OPEN DATASET statement. To process a file in text mode, use the IN TEXT MODE option of the OPEN DATASET statement. To open a file at a specific position, use the AT POSITION option of the OPEN DATASET statement. When you work with the operating systems UNIX or WINDOWS NT, you can send an operating system command with the statement OPEN DATASET. To do so, use the option FILTER To receive the operating system message after trying to open a file, use the MESSAGE option of the OPEN DATASET statement. To close a file on the application server, use the CLOSE DATASET statement. To delete a file on the application server, use the DELETE DATASET statement. To write data to a file on the application server, use the TRANSFER statement. To read data from a file on the application server, use the READ DATASET statement.

19

136) What is a variant and where do you use it? If you want to run a report program with same selections at regular intervals (for example, for monthly sales statistics), you would not want to enter the same values each time. So, ABAP/4 offers you a possibility to combine the desired values for all these selections in one selection set. You can create as many different selection sets as you like for each report program and they remain assigned only to the report program in question. Such a selection set is called a variant. Using Variants Online. Using Variants in Background Processing Online, starting a report via variant saves the user work and minimizes input errors. In background processing, a variant is the only possibility you have to pass values for the selections. 137) What is set parameter and get parameter? We can pass data to a called program using SPA/GPA parameters. SPA/GPA parameters are field values saved globally in memory. Each parameter is identified by a three-character code: you can define these parameters in the object browser by selecting Other objects on the first screen. The SPA/GPA storage is user-specific and valid throughout all the user's sessions. by using the SET PARAMETER or GET PARAMETER statements These statements let you store and retrieve SPA/GPA values from an ABAP/4 program. If the selection screens for the two transactions do not share the same required fields, use these statements to store screen fields explicitly by name. Before calling the new transaction from a PAI module, store the caller transaction's fields under one name: SET PARAMETER ID 'RID' FIELD <FIELD NAME1>. The system stores the value in <field name1> in the SPA parameter 'RID'. The three-character identifier 'RID' must be defined in the SAP table TPARA. If the SPA parameter 'RID' already contains a value, the SET PARAMETER statement overwrites it (with the contents of <FIELD NAME1>). In the PBO module for the called transaction, retrieve the fields under the other name: GET PARAMTER ID 'RID' FIELD <FIELD NAME2>. 138) What is field symbol? 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. Sometimes you only know which field you want to process, and how you want to process it, at runtime. For this purpose, you can create field symbols in your program. At runtime, you can assign real fields to such field symbols. All operations that you have programmed with the field symbol are then carried out with the assigned field. After successful assignment, there is no difference in ABAP/4 whether you reference the field symbol or the field itself. 139) What is menu painter and how do you use it in your application? Menu Painter is used to generate the system status programs that can be used generate the menu items that can be used in the transactions. 140) What is CTS and what do you know about it? CTS is Change and Transport System 141) What is a logical unit of work? It is a set of statements which are made together as a set and would be executed as set i.e. if one is not executed then all the previous statements are to be reverted.

20

You might also like