Sunday, 23 February 2014

General ABAP

SAP DATA DICTIONARY QUESTIONS:



  1. What are the layers of data description in R/3?
·            The external layer.
·            The ABAP/4 layer.
·            The database layer.
  1. Define external layer?
The external layer is the plane at which the user sees and interacts with the data, that is, the data format in the user interface.  This data format is independent of the database system used.
 
  1. Define ABAP/4 layer?
The ABAP/4 layer describes the data formats used by the ABAP/4 processor.
 
  1. Define Database layer?
      The database layer describes the data formats used in the database.
 
  1. What is a Data Class?
The Data class determines in which table space the table is stored when it is created in the database.
 
  1. What is a Size Category?
The Size category describes the probable space requirement of the table in the database.
 
  1. How many types of size categories and data classes are there?
There are five size categories (0-4) and 11 data classes only three of which are appropriate for application tables:
·        APPL0- Master data (data frequently accessed but rarely updated).
·        APPL1- Transaction data (data that is changed frequently).
·        APPL2- Organizational data (customizing data that is entered when system is configured and then rarely changed).
The other two types are:
·            USR
·            USR1 – Intended for customer’s own developments.
 
  1. What are control tables?
The values specified for the size category and data class are mapped to database-specific values via control tables.
 
  1. What is the function of the transport system and workbench organizer?
The function of the transport system and the Workbench Organizer is to manage any changes made to objects of the ABAP/4 Development Workbench and to transport these changes between different SAP systems.
 
  1. What is a table pool?
A table pool (or pool) is used to combine several logical tables in the ABAP/4 Dictionary.  The definition of a pool consists of at least two key fields and a long argument field (VARDATA).
 
  1. What are pooled tables?
These are logical tables, which must be assigned to a table pool when they are defined.  Pooled tables can be used to store control data (such as screen sequences or program parameters).
 
  1. What is a table cluster?
A table cluster combines several logical tables in the ABAP/4 Dictionary.  Several logical rows from different cluster tables are brought together in a single physical record.  The records from the cluster tables assigned to a cluster are thus stored in a single common table in the database.
 
  1. How can we access the correction and transport system?
Each time you create a new object or change an existing object in the ABAP/4 Dictionary, you branch automatically to the Workbench Organizer or correction and transport system.
 
  1. Which objects are independent transport objects?
Domains, Data elements, Tables, Technical settings for tables, Secondary indexes for transparent tables, Structures, Views, Matchcode objects, Matchcode Ids, Lock objects.
 
  1. How is conversion of data types done between ABAP/4 & DB layer?
Conversion between ABAP/4 data types and the database layer is done within the database interface.
 
  1. How is conversion of data types done between ABAP/4 & external level?
Conversion between the external layer and the ABAP/4 layer is done in the SAP dialog manager DYNP.
 
  1. What are the Data types of the external layer?
ACCP, Char, CLNT, CUKY, CURR, DATS, DESC, FLTP, INT1, INT2, INT4, LANG, LCHR, LRAW, NUMC, PREC, QUAN, RAW, TIMS, UNIT,VARC.
 
  1. What are the Data types of the ABAP/4 layer?
Possible ABAP/4 data types:
C: Character.
D: Date, format YYYYMMDD.
F: Floating-point number in DOUBLE PRECISION (8 bytes).
I: Integer.
N: Numerical character string of arbitrary length.
P: Amount of counter field (packed; implementation depends on h/w platform).
S: Time Stamp YYYYMMDDHHMMSS.
V: Character string of variable length, length is given in the first two bytes.
X: Hexadecimal (binary) storage.
 
  1. How can we set the table spaces and extent sizes?
You can specify the extent sizes and the table space (physical storage area in the database) in which a transparent table is to be stored by setting the size category and data class.
 
  1. What is the function of the correction system?
The correction system manages changes to internal system components. Such as objects of the ABAP/4 Dictionary.
 
  1. What are local objects?
Local objects (Dev class$TMP) are independent of correction and transport system.
 
  1. What is a Development class?
Related objects from the ABAP/4 repository are assigned to the same development class.  This enables you to correct and transport related objects as a unit.
 
  1. What is a data dictionary?
Data Dictionary is a central source of data in a data management system.  Its main function is to support the creation and management of data definitions.  It has details about
·            what data is contained?
·            What are the attributes of the data?
·            What is the relationship existing between the various data elements?
 
  1. What functions does a data dictionary perform?
In a data management system, the principal functions performed by the data dictionary are
·            Management of data definitions.
·            Provision of information for evaluation.
·            Support for s/w development.
·            Support form documentation.
·            Ensuring that the data definitions are flexible and up-to-date.
 
  1. What are the features of ABAP/4 Dictionary?
The most important features are:
·            Integrated to aABAP/4 Development Workbench.
·            Active in the runtime environment.
 
  1. What are the uses of the information in the Data dictionary?
The following information is directly taken from the Data dictionary:
·            Information on fields displayed with F1 help.
·            Possible entries for fields displayed with F4 help.
·            Matchcode and help views search utilities.
 
  1. What are the basic objects of the data dictionary?
·            Tables
·            Domains
·            Data elements
·            Structures
·            Foreign Keys
 
  1. What are the aggregate objects in the data dictionary?
·            Views
·            Match codes
·            Lock objects.
 
  1. In the ABAP/4 Dictionary Tables can be defined independent of the underlying database (T/F).
True.
  1. ABAP/4 Dictionary contains the Logical definition of the table.
  2. A field containing currency amounts (data type CURR) must be assigned to a reference table and a reference field. Explain.
As a reference table, a system containing all the valid currencies is assigned or any other table, which contains a field with the currency key format.  This field is called as reference field.  The assignment of the field containing currency amounts to the reference field is made at runtime.  The value in the reference field determines the currency of the amount.
 
  1. A field containing quantity amounts (data type QUAN) must be assigned to a reference table and a reference field. Explain?
As a reference table, a system table containing all the valid quantity units is assigned or any other table, which contains a field with the format or quantity units (data type UNIT).  This field is called as reference field.
The assignment of the field containing quantity amounts to the reference field is made at runtime.  The value in the reference field determines the quantity unit of the amount.
 
  1. What is the significance of Technical settings (specified while creating a table in the data dictionary)?  By specifying technical settings we can control how database tables are created in the database.  The technical settings allows us to
·            Optimize storage space requirements.
·            Table access behavior.
·            Buffering required.
·            Changes to entries logged.
 
  1. What is a Table attribute?
The table’s attributes determine who is responsible for maintaining a table and which types of access are allowed for the table.  The most important table attributes are:
·            Delivery class.
·            Table maintenance allowed.
·            Activation type.
 
  1. What is the significance of Delivery Class?
·            The delivery class controls the degree to which the SAP or the customer is responsible for table maintenance.
·            Whether SAP provides the table with or without contents.
·            Determines the table type.
·            Determines how the table behaves when it is first installed, at upgrade, when it is transported, and when a client copy is performed.
  1. What is the max. no. Of structures that can be included in a table or structure.
Nine.
 
  1. What are two methods of modifying SAP standard tables?
·            Append Structures and
·            Customizing Includes.
 
  1. What is the difference between a Substructure and an Append Structure?
·            In case of a substructure, the reference originates in the table itself, in the form of a statement include….
·            In case of an append structure, the table itself remains unchanged and the reference originates in the append structure.
 
  1. To how many tables can an append structure be assigned ?
One.
  1. If a table that is to be extended contains a long field, we cannot use append structures why?
Long fields in a table must always be located in the end, as the last field of the table.  If a table has an append structure the append line must also be on the last field of the table.
 
  1. Can we include customizing include or an append structure with Pooled or Cluster tables?
No.
  1. What are the two ways for restricting the value range for a domain?
·            By specifying fixed values.
·            By stipulating a value table.
 
  1. Structures can contain data only during the runtime of a program (T/F)
True.
  1. What are the aggregate objects in the Dictionary?
·            Views
·            Match Code.
·            Lock Object.
 
  1. What are base tables of an aggregate object?
      The tables making up an aggregate object (primary and secondary) are called aggregate object.
 
  1. The data of a view is not physically stored, but derived from one or more tables (t/f)
True.
 
  1. What are the 2 other types of Views, which are not allowed in Release 3.0?
·            Structure Views.
·            Entity Views.
 
  1. What is a Match Code?
      Match code is a tool to help us to search for data records in the system. Match Codes are an efficient and user-friendly search aid where key of a record is unknown.
 
  1. What are the two levels in defining a Match Code?
·            Match Code Object.
·            Match Code Id.
 
  1. What is the max no of match code Id’s that can be defined for one Match code object?
A match code Id is a one character ID that can be a letter or a number.
 
  1. Can we define our own Match Code ID’s for SAP Matchcodes?
Yes, the number 0 to 9 are reserved for us to create our own Match Code Ids for a SAP defined Matchcode object.
 
  1. What is an Update type with reference to a Match code ID?
If the data in one of the base tables of a matchcode ID changes, the matchcode data has to be updated.  The update type stipulates when the matchcode is to be updated and how it is to be done.  The update type also specifies which method is to be used for Building matchcodes.  You must specify the update type when you define a matchcode ID.
 
  1. Can matchcode object contain Ids with different update types?
Yes.
 
  1. What are the update types possible?
The following update types are possible:
·            Update type A: The matchcode data is updated asynchronously to database changes.
·            Update type S: The matchcode data is updated synchronously to database changes.
·            Update type P: The matchcode data is updated by the application program.
·            Update type I: Access to the matchcode data is managed using a database view.
·            Update type L: Access to the matchcode is achieved by calling a function module.
 
  1. What are the two different ways of building a match code object?
A match code can be built in two different ways:
·            Logical structure: The matchcode data is set up temporarily at the moment when the match code is accessed. (Update type I, k).
·            Physical Structure: The match code data is physically stored in a separate table in the database. (Update type A, S, P).
 
  1. What are the differences between a Database index and a match code?
·            Match code can contain fields from several tables whereas an index can contain fields from only one table.
·            Match code objects can be built on transparent tables and pooled and cluster tables.
 
  1. What is the function of a Domain?
·            A domain describes the technical settings of a table field.
·            A domain defines a value range, which sets the permissible data values for the fields, which refers to this domain.
·            A single domain can be used as basis for any number of fields that are identical in structure.
 
  1. Can you delete a domain, which is being used by data elements?
No.
  1. What are conversion routines?
·            Non-standard conversions from display format to sap internal format and vice-versa are implemented with so called conversion routines.
 
  1. What is the function of a data element?
A data element describes the role played by a domain in a technical context.  A data element contains semantic information.
 
  1. Can a domain, assigned to a data element be changed?
Yes.  We can do so by just overwriting the entry in the field domain.
 
  1. Can you delete data element, which is being used by table fields.
No.
 
  1. Can you define a field without a data element?
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.
 
  1. What are null values?
If the value of a field in a table is undefined or unknown, it is called a null value.
 
  1. What is the difference between a structure and a table?
Structures are constructed the almost the same way as tables, the only difference using that no database table is generated from them.
 
  1. What is a view?
A view is a logical view on one or more tables.  A view on one or more tables i.e., the data from a view is not actually physically stored instead being derived from one or more tables.
 
  1. How many types of Views are there?
·            Database View
·            Help View
·            Projection View
·            Maintenance View
 
  1. What is Locking?
When two users simultaneously attempt to access the same data record, this is synchronized by a lock mechanism.
 
  1. What is database utility?
Database utility is the interface between the ABAP/4 Dictionary and the underlying the SAP system.
 
  1. What are the basic functions of Database utility?
The basic functions of database utility are:
·            Create database objects.
·            Delete database objects.
·            Adjust database objects to changed ABAP/4 dictionary definition.
 
  1. What is Repository Info. Systems?
It is a tool with which you can make data stored in the ABAP/4 Dictionary available.


SAP ABAP interview questions: 


Important 

Question 1: What is the difference between User Exit and Function Exit?

User Exit
Customer Exit
User exit is implemented in the form of a Subroutine i.e. PERFORM xxx.
Example: INCLUDE MVF5AFZZ
à
PERFORM userexit_save_document_prepare.  
A customer exit can be implemented as:
·         Function exit
·         Screen Exit
·         Menu Exit
·         Field Exit
Example: CALL Customer function ‘xxx’
INCLUDE xxx.
You modify this include.
In case of a PERFORM, you have access to almost all the data. So you have better control, but more risk of making the system unstable.
You have access only to the importing, exporting, changing and tables parameter of the Function Module. So you have limited access to data.
User exit is considered a modification and not an enhancement.
A customer exit is considered an enhancement.
You need Access Key for User Exit.
You do not need access key.
Changes are lost in case of an upgrade.
Changes are upgrade compatible.
User exit is the earliest form of change option offered by SAP.
Customer exits came later and they overcome the shortcomings of User Exit.
No such thing is required here.
To activate a function exit, you need to create a project in SMOD and activate the project.



  
 What is the difference between RFC and BAPI?
BAPI
RFC
Just as Google offers Image/Chart/Map APIs OR Facebook offers APIs for Comment/Like, SAP offers APIs in the form of BAPIs. BAPI is a library of function modules released by SAP to the public so that they can interface with SAP.
RFC is nothing but a remote enabled function module. So if there is a Function Module in SAP system 1 on server X , it can be called from a SAP system 2 residing on server Y.
There is a Business Object Associated with a BAPI. So a BAPI has an Interface, Key Field, Attributes, Methods, and Events.
No Business Object is associated with a RFC.
Outside world (JAVA, VB, .Net or any Non SAP system) can connect to SAP using a BAPI.
Non–SAP world cannot connect to SAP using RFC.
Error or Success messages are returned in a RETURN table.
RFC does not have a return table.



Question 3:
What is the difference between SAPSCRIPT and SMARTFORM? 
SAPSCRIPT
SMARTFORM
SAPSCRIPT is client dependent.
SMARTFORM is client independent.
SAPSCRIPT does not generate any Function module.
SMARTFORM generates a Function Module when activated.
Main Window is must.
You can create a SMARTFORM without a Main Window.
SAPSCRIPT can be converted to SMARTFORMS. Use Program SF_MIGRATE.
SMARTFORMS cannot be converted to SCRIPT.
Only one Page format is possible
Multiple page formats are possible.
Such thing is not possible in SCRIPT.
You can create multiple copies of a SMARTFORM using the Copies Window.
PROTECT … ENDPROTECT command is used for Page protection.
The Protect Checkbox can be ticked for Page Protection.

The way SMARTFORM is developed and the way in which SCRIPT is developed is entirely different. Not listing down those here. That would be too much. 


Question 4:What is the difference between Call Transaction Method and the Session method ?
Session Method
Call Transaction
Session method id generally used when the data volume is huge.
Call transaction method is when the data volume is   low
Session method is slow as compared to Call transaction.
Call Transaction method is relatively faster than Session method.
SAP Database is updated when you process the sessions. You need to process the sessions separately via SM35.
SAP Database is updated during the execution of the batch input program.
Errors are automatically handled during the processing of the batch input session.
Errors should be handled in the batch input program.


Question 5: What is the difference between BDC and BAPI?

BAPI
BDC
BAPI is faster than BDC.
BDC is relatively slower than BAPI.
BAPI directly updates database.
BDC goes through all the screens as a normal user would do and hence it is slower.
No such processing options are available in BAPI.
Background and Foreground processing options are available for BDC.
BAPI would generally used for small data uploads.
BDCs would be preferred for large volumes of data upload since background processing option is available.
For processing errors, the Return Parameters for BAPI should be used.This parameter returns exception messages or success messages to the calling program.
Errors can be processed in SM35 for session method and in the batch input program for Call Transaction method.


Question 6: What is the difference between macro and subroutine?

Macro
Subroutine
Macro can be called only in the program it is defined.
Subroutine can be called from other programs also.
Macro can have maximum 9 parameters.
Can have any number of parameters.
Macro can be called only after its definition.
This is not true for Subroutine.
A macro is defined inside:
DEFINE …
….
END-OF-DEFINITION.
Subroutine is defined inside:
FORM …..
…..
ENDFORM.
Macro is used when same thing is to be done in a program a number of times.
Subroutine is used for modularization.



Question 7: What is the difference between SAP memory and ABAP memory?

SAP Memory
ABAP Memory
When you are using the SET/GET Parameter ID command, you are using the SAP Memory.
When you are using the EXPORT IMPORT Statements, you are using the ABAP Memory.
SAP Memory is User Specific.
What does this mean?
àThe data stored in SAP memory can be accesses via any session from a terminal. 
ABAP Memory is User and Transaction Specific.What does this mean?à The data stored in ABAP memory can be accessed only in one session. If you are creating another session, you cannot use ABAP memory.


Important
Question 8:
What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT?
AT SELECTION-SCREEN is the PAI of the selection screen whereas
AT SELECTION-SCREEN OUTPUT is the PBO of the selection screen.



Question 9: What is the difference between SY-INDEX and SY-TABIX?
Remember it this way
à TABIX = Table.
So when you are looping over an internal table, you use SY-TABIX.
When you use DO … ENDDO / WHILE for looping, there is no table involved.
So you use SY-INDEX.

For READ statement, SY-INDEX is used.

Question 10: What is the difference between VIEW and a TABLE?A table physically stores data.
A view does not store any data on its own. It can contain data from multiple tables and it just accesses/reads data from those tables.

Question 11:
What is the difference between Customizing and Workbench request?A workbench request is client independent whereas a Customizing request is client dependent.
Changes to development objects such as Reports, Function Modules, Data Dictionary objects etc. fall under Workbench requests.

Changes in SPRO / IMG that define system behavior fall under customizing requests.
An example would be ‘defining number ranges’ in SPRO.

In short, generally a developer would end up creating a Workbench request and a Functional Consultant would create a Customizing request.

Workbench vs Customizing work request

Question 12: What is the difference between PASS BY VALUE and PASS BY REFERENCE?These concepts are generally used for Function modules or Subroutines etc. and their meaning can be taken literally.

Say we are passing a variable lv_var:
CALL FUNCTION 'DEMO_FM'
   EXPORTING
     VAR  = lv_var.

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


Question 13: What is the difference between Master data and Transaction data?Master data is data that doesn’t change often and is always needed in the same way by business.
Ex: One time activities like creating Company Codes, Materials, Vendors, Customers etc.

Transaction data keeps on changing and deals with day to day activities carried out in business.
Transactions done by or with Customers, Vendors, and Materials etc. generate Transaction Data. So data related to Sales, Purchases, Deliveries, Invoices etc. represent transaction data

Some important transactions here for Master Data:
Material: MM01 MM02 MM03
Vendor: XK01 , XK02 , XK03
Customer: Xd01 , XD02 , XD03

Some Important transactions for Transaction data:
Purchase Order: ME21n , ME22n , ME23n
Sales Order: VA01 , VA02 , VA03
Goods Receipt: MIGO
Invoices: MIRO



Important
Question 14: What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
There is great confusion over this in the SAP arena.
If you Google, you will see lots of results that will say SELECT SINGLE is faster and efficient than SELECT UPTO 1 ROWS.
But that is 100% incorrect.

SELECT UPTO 1 ROWS is faster than SELECT SINGLE.
If for a WHERE condition, only one record is present in DB, then both are more or less same.
However, If for a WHERE condition multiple records are present in DB, SELECT UPTO 1 ROWS will perform better than SELECT SINGLE. 

 
Question 15: What is the difference between .Include Structure and .Append structure? 
I have seen ridiculous answers for this at many places on the Web.
The true answer is this:

Let’s say you want to use the Structure X in your table Y.
With .Include X, you can include this structure in multiple tables.
With .Append X, you specify that structure X has been used in table Y and that this cannot be used in any other table now.  So you restrict structure X only to Table Y.
Important
Question 16: Can you describe the events in ABAP?

LOAD-OF-PROGRAM:
INITIALIZATION: If you want to initialize some values before selection screen is called
AT SELECTION SCREEN OUTPUT: PBO for Selection Screen
AT SELECTION SCREEN: PAI for Selection Screen
START-OF-SELECTION
END-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE

AT USER-COMMAND: When user click on say buttons in application toolbar. SY-UCOMM
AT LINE SELECTION:
Double click by user on basic list. SY-LISEL
AT PF##: When User Presses any of the Function Keys
TOP-OF-PAGE DURING LINE SELECTION


Question 17:

What events do you know in Module Pool Programming?
PBO:
you know this . If not you should know this . That's basic.
PAI: You know this. If not you should know this . That's basic.
POV: Process on Value request … i.e. when you press F4.
POH: Process on help request … i.e. when you press F1.
Question 18: Can you show multiple ALVs on a Single Screen?
Yes, there are multiple ways of doing this:
·         If you are using OOALV, you can create multiple custom containers  
   (cl_gui_custom_container)
& put an ALV control (cl_gui_alv_grid) in each of those.
·         You can even use a Splitter container control and place multiple ALVs in each of
    the split container.
·         If you are using Normal ALV, You can use the following FMS:
1.      REUSE_ALV_BLOCK_LIST_INIT
2.      REUSE_ALV_BLOCK_LIST_APPEND
3.      REUSE_ALV_BLOCK_LIST_DISPLAY
Question 19: A system has two clients 100 and 500 on the same application server. If you make changes to a SAPSCRIPT on client 100, will the changes be available in client 500?

No. SAPSCRIPT is client dependent. You will have to transport changes from client 100 to client 500. However, for SMARTFORMS, Changes will be made both for client 100 and client 500.
Question 20: There are 1000’s of IDOCs in your system and say you no longer need some of them? How will you get rid of those IDOCs?

One way is to archive the IDOCs using transaction SARA.
But what the interviewer was expecting was ‘How do you change IDoc Status’?
There are different ways of doing this:
A) Use FM IDOC_STATUS_WRITE_TO_DATABASE
B) USE FMs:
     EDI_DOCUMENT_OPEN_FOR_PROCESS and
     EDI_DOCUMENT_CLOSE_PROCESS


Question 21: What is the difference between CHAIN … ENDCHAIN and FIELD commands in Module Pool?

If you want to validate a single field in Module Pool, you use the FIELD Command.
On error, this single filed is kept open for input.

If you however want to validate multiple fields, you can use the CHAIN … ENDCHAIN command. You specify multiple fields between CHAIN and ENDCHAIN.
On error, all fields between CHAIN …… ENDCHAIN are kept open for input.



Question 22:
What are the types of Function Modules? What is an UPDATE function module?There are three types of Function Modules: Normal , RFC , UPDATE.
The aim of the Update function module is either to COMMIT all changes to database at once or to ROLLBACK all the changes. By definition, an update function module is used to bundle all the updates in your system in one LUW (logical unit of work).

This FM is called whenever COMMIT WORK statement is encountered in the calling program and the way you call it is CALL FUNCTION XXX IN UPDATE TASK. 

Have a look at FM EDI_DOCUMENT_CLOSE_PROCESS_UPD and do a where used.
This FM is used as Update FM in case you make changes to IDoc contents/status via your program.

Question 23: How is the table sorted when you do not specify field name and Ascending or Descending? On what criteria will the table be sorted? Do internal table have keys?

Yes, internal table have keys.
The default key is made up of the non-numeric fields of the table line in the order in which they occur.



Question 24: Explain what is a foreign key relationship?Explain this with the help of an example.
Let’s discuss about tables EKKO (PO header) and EKPO (PO line item).
Can you have an entry in table EKPO without having an entry in table EKKO?
In other words can you have PO line items without the PO header?

How does this happen? The answer is foreign key relationship.
So foreign keys come into picture when you define relationship between two tables.


Foreign key relationship in ABAP

 
Foreign keys are defined at field level.
Check the foreign key relation for field EBELN of table EKPO.
The check table is EKKO. This just means that whenever an entry is made in EKPO, it is checked whether the entered value for EBELN already exists in EKKO. If not, entry cannot be made to EKPO table.
 

Question 25 : What is the difference between a value table and a check table?Check table is maintained when you define foreign key relationships.
For Check table, read question above.
.
Value table is defined and maintained at a domain level.
At a domain level, you can mention allowed values in the form of:
1) Single values
2) Ranges
3) Value table
For example, have a look at domain SHKZG. Only allowed values are S and H for Debit/Credit indicator. Whenever and wherever you use this domain, the system will force you to use only these two values: S and H.

Another example is domain MATNR. For this domain the value table is MARA.
So whenever and wherever, you use this domain the system will force you to use values for MATNR in table MARA.


Question 26: How do you find BAPI?Approach1:
You can go to Transaction BAPI and then search for your desired object.
Say you want to find a BAPI for creating users in the system, in such case you can search for the ‘User’ and find the relevant BAPIs.

Approach2:
Another way is to find a Business Object. Say you want to find a BAPI for creating Material in SAP and you know the BO for Material is BUS1001006. You can go to Transaction SWO1 and enter the BO BUS1001006 in the BOR. Then have a look at the methods for this BO.
How to Find a BAPI ?



Important
Question 27: How do you find BADI?
Approach1:

Go to Class CL_EXITHANDLER in SE24 ---> Put a breakpoint in method GET_INSTANCE.Now go and execute your transaction code for which you want to find BADI.
You will find the BADI in the changing parameter exit_name:

How to find a BADI in ABAP ?

Approach 2:
Go to Tcode SE84 à Enhancements àBADIs à Definitions.
Find the package for the Tcode for which you are finding the BADI.
Enter it as shown and hit execute:


How do you find a BADI ?

Find BADI in SAP




SAP Script







ABAP Scripts Interview Questions

What is sap script and layout set?
Ans - SAPscript is the integrated text management system of the SAP R/3 System. SAPscript is tightly integrated into the SAP System. It is used for many different word-processing tasks all over the SAP System.

What is layout set?
A layout set in SAPscript is used for page layout. The layout set contains various elements, which are used for layout control of the individual pages and also contain layout information for texts which are to be output on the individual pages.

The layot of a document is defined in a layot set.
A layout set specified the appearance and structure of a document.

Layout sets contain predefined text modules with space reserved for variable data.  You can use these text modules for different application.

Every SAPscript document uses a layout set.

To make changes to your documents, such as moving a piece of text, or changing fonts, paragraph formats, and tabs, you only need to change the layout set.

There are two ways of formatting texts using layout sets:
The text is entered and output in standard text maintenance.  You can  assign any layout set.  Text can also be entered via the layout set  a  letter header, for example.
The text is formatted via an ABAP/4 program using a layout set.  The  program can either dynamically output individual predefined text modules, text elements or transfer entire texts, which are to be output in the layout set.

You can use Styles to define the formatting of the text in your documents.  A style
determines text formatting by setting the paragraph and character formats used in a
document.  You can, for example, use a style to highlight character strings or whole
paragraphs.  You can assign a style to any text.  Typically, however, you’ll use styles
primarily in the main windows of layout sets, where users type or enter text directly
in documents.


Header data is found  in both style and layout set maintenance.
In style maintenance, it is used primarily to present important information -  designed to make it easier for the end user to select a style.  The header data in layout set maintenance, on the other hand, is used for information and control purposes.

Windows are defined in layout set maintenance.  They represent areas
which are positioned on pages  as page windows and in which text is
later output.  At least one window must be defined for each layout set.  If
not, a text cannot be formatted by SAP script.

The following window types can be used:
MAIN – Main window in which continuous text is output.  This is the window used by dialog users of a print program and layout set.  For example the body text of a letter would be entered in MAIN.

VAR – Window with variable contents.  The text can vary on each page in which the window is positioned.  Variable windows are formatted for each page.

CONST – Window with constant contents which is only formatted once.

A layout set has the following elements:
Header data  - Data related to development (created by, development class, etc.)  and layout set information (which elements are used) are both stored in the header data.  A start page must be entered here.

Paragraph formats - Paragraph formats are required in layout sets -  as in styles - in order to format texts.  However, they are also used for word processing in layout sets, for example, to format  text elements.

Character formats - You can also use character formats to format texts or paragraphs. Unlike paragraph formats, however, they are used to format text within a paragraph.

Windows  - Windows are names and window types, which are not physically positioned until they are allocated to pages and units of measurement are specified.

Pages - Pages are defined to provide the system with a start and end point  in text formatting.

Page windows - Page windows are the combination of windows and pages, where the dimensions of a window and its position on a page are specified.

The purpose of SAP script control commands is to allow control of the
output formatting.  These commands are not interpreted by the SAPscript
editor, but are passed through to the SAPscript Composer for processing.  The
composer is the program that converts text from the form displayed in the editor to
the form used for printing.

What is SAPscript and explain its purpose?
SAP Script is the SAP system’s own text-proessing system.  You’ll find that it looks and feels a lot like other leading text-processing system that you may use on your personal computer.

Every company needs to output documents with a uniformly defined layout (eg. Invoices, delivery notes, etc..) all the time.

The basic layout of the document is pre-defined , but in many cases, other data has to be merged with it, such as address data or purchase order items.  This data might be entered manually by a employee, or retrieved from a database table.

Large quantities of these documents have to be produced.  From printing is usually a mattter of large print runs of documents such as payslips, checks, order confirmation, reminders etc.

SAPscript has been developed to meet the above requirements.  IT is an integrated tool for text entry and form printing in  R/3 applications.

These documents are normally provided by SAP but every organization have their unique waqys of these documents so to customize these and for creating newer ones if required; SAP script is used.

What are components of SAPscript?
Layout set, SAPscript Text, ABAP Print program , symbols, function modules like open_form, close_From, Read_text etc,.

What are the ABAP/4 Commands that link to a layout set?
Call function OPEN-form.
Call function WRITE-from.
Call function CLOSE-from

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

Other useful programs for SAPScript
RSTXFCON - Converts page format
RSTXSCRP - Upload/Download layout sets
RSTXDBUG - SAPScript debugger

Debug SAPScript
You can debug a SAPScript: Use Tools - Word Processing - Layout Set.
Enter name of layout set and then Utilities - Activate Debugger.
It is of no consequence which layout  set you enter when selecting the SAPscript debugger. (Menu path: Tools-Word-processing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger. This is quite handy when verifying which layoutset is being called (Verifying customizing settings).
Another way to set the SAPScript debugger is to run program RSTXDBUG.

When a Form is copied from one client to another .And If U try to display or change the form in the copied client .The  possible error message cud be :
1.Form not found
Try coping again specifing the language .

2.IF IT dispalys an error message saying That the text file is inconsistent .
Then go to SE38 and Run “RSTXCHKO” .
It will ask for the form name ,then check all the checkboxes and then run the program.
Note : all Script related problems can be solved using Program ‘RSTX*’.

How to take a back up of script layout  into U’r hard disk and load it later
Use Program RSTXSCRP.
Use EXPORT mode, when downloading and IMPORT when uploading a script. Don’t forget to give the form  name in the object field. This will create a script with the same name as that of the original script . If a script with the same name exists in the same client ,then it will give an error ‘Object cannot be overwritten ’ .

I want to copy table across clients
Use Program RSCLTCOP

To transfer script files across systems (Not Clients)  - RSTXSCRP

To compare the contents of a table across clients: RSTBSERV

To change the development class of any object - RSWBO052

What type of variables normally used in sap script to output data?
&Tables name- fields&.

How do you number pages in sap script layout outputs?
& page &
&next Page &

What takes most time in SAP script programming?
Defining layout set up / sets.

How do you use tab sets in layout sets?
Define paragraph with defined tabs.

How do you backup sap script layout sets? Can you download and upload? How?
SAP script backup :- In transaction SE71 goto Utilities -> Copy from client -> Give source form name, source client (000 default), Target form name.
Download :- SE71, type form name -> Display -> Utilities -> form info -> List -> Save to PC file.
Upload :- Create form with page, window, pagewindow with the help of downloaded PC file. Text elements for Page windows to be copied from PC file.

What is Compare Tool in SAP Script ?
SAP Script offers  tools for comparing objects across clients. We can compare or copy the following kinds of objects.
Styles
Layout sets
Documents
With the Compare tool we can do the following :
Check whether an object exists in both clients
Display the differences between the versions of an object
Layout Sets  are used to control page layout and text formatting in documents .
SAP Standard styles and layout sets are always held in Client 000.

In what format does  SAP Script store text ?
SAPscript texts are stored in Interchange Text Format (ITF).  SAPscript offers conversion programs for the text file formats Rich Text Format (RTF) and ASCII as an interface to other word processors.

The various window types in SAP Script are
Main, Variable and Constant.


The New-Page command is used to force a Page break in the text at any point.

Protect ... Endprotect command pairs can be nested (True / False).
False.

Delimiter &  must be used immediately before and after the symbol.

What does the composer do?
The final appearance of your documednt depends on interaction between the print program and the layout set.

The SAPscript print program initializes the printing process.  Every command entered using the SAPscript programming interfaces is transferred to the composer.

The composer received layout information from the layout set specified by the print program.  The documents are formatted according to this layout information.

If the documents contain variables, the compoer replaces these variables with data from the R/3 system, such as the current date, or with the userdata selected by the print program.

The print program controls the completion of thelayout set.  Once this is done, the composer places the completed document in the spool.

Where do we define Tab space for data in SAPScript?
When defining the paragraph for the text element we can define the TABS then.  There is parameter called TABS to be defined in paragraph definition.

what is difference between Window & a Page Window?
Window: An area that is predefined in the layout set.  Windows are text modules, which are positioned on a document page.

We define the window type, Default Paragraph, specify the text elements or a SAPscript text to be included etc in the Windcow Component.

PageWindow: we define the parameters of the earlier defined Window, appearance on the document like left or right margins, Width & Height.

What are symboles & state their different types with E.g.
A Symbol is a constant, which can be inserted in a document.  It saves the user unnecessary work when replacing sections of text, phrases, etc.  Each symbol has a name which is encloses by &.

Eg. &variable name &
System symbols eg &Date&, &time& etc.

Standard symbols :Standard symbols are user-defined.  They are maintained centrally in table TTDTG. Eg. &SGDH& for the opening salutation : “dear sir/madam”.
&MFG& for the closing salutation :”yours Faithfully”.

Program Symbols : Program symbols display data from the ABAP/4 program which has called the word processing function Eg. Itab-connid.

Text symbols: You can define a text symbol for any text module.   This symbol is valid only in the text module for which you have defined it.  Eg. Define &Symbol& = ‘value’.

How do we define Text symbols?
Using the control command DEFINE &x1& = ‘56’.

State few control commands?.
Protect .. endprotect, define, new-page, include.. if… endif.

what is the purpose  of “Protect and EndProtect”?.
You can specify either in the style or in the layout set that a particular paragraph should not be slit in two by a page beak. If the page protect attribute is set then the complete paragraph is always output ona single page.  This property applies only to that particular paragraph.   SAPScript provides the PROTECT… ENDPROTECT command pair to allow you to define the areas to be protected against a page beak on an individual basis.  Thus the PROTECT/ENDPROTECT commands may be regarded as a kind of conditional NEW-PAGE command, the condition being whether or not the lines enclosed between the two commands fit in the space remaining in the current main window.

How do we set the date, time format?
SET TIME MASK : CONROLS THE TIME FIELD FORMAT.
SET DATE MASK : CONTRLS THE DATE FIELD FORMAT.

EG. Set Time Mask = “ HH:MM:SS”.

what is the role of an ABAP progrm in SAPScript?
Retrieves R/3 application data from the database.

Defines the layout set processing logic ( The order and repetition of text elements).

Chooses a layout set for printing.

Selects the output device, such as printer,monitor, or fax.

Sets print attributes such as immediate output, number of copies ,and pages to beprinted.

How to reuse some components of the script layout to other program?
Is this script layout is standard for all the printer? If not then y  we are going for script layout?

Give me couple of methods that I will take standard script layout printout for different printer.

How u will analysis script program? ( which goes to main and how many windows etc….)

Can V  inserted logo on your program?. Give me the program name which uploads my logo and syntax for logo inserting in sap script.
Yes u can insert a logo on your script layout.
Use this Report “RSTXLDMC” which will uploads the logo.
Use the following statement which includes the logo on your script prog.
/: INCLUDE 'ZHEX-MACRO-XXX' OBJECT TEXT ID ST LANGUAGE 'E'.

XXX – object name, u will gives @ runtime in rstxldmc program.

Give me syntax for box command.
BOX XPOS 2 MM  WIDTH 0 CM HEIGHT '9.5' CM FRAME 10 TW - 



***************************************************************

1. Can we write the code both call transaction and session method in single program?
Ans. Yes it is possible to write call transaction and session in one program.
2. Which BDC you prefer?
Ans. If we want to transfer large amount of data and when we need to use more than one transaction code we prefer session method. For small or less amount of data and for single transaction use call transaction.
(This is more genric answer but you can add more on to this if you have worked on  BDC)
3. When u prefer LSMW?
Ans. When we need to update medium amount of data we use LSMW. LSMW is also used when the person like functional consultant has less programming language.
5. Difference between .include and  .append?
Ans.
Include structure allows to add one or more structure into structure or table.Also placed positioning anywhere. Upto 6 include structure can be used in a table.
Append structure can be placed only at the end of a structure or table which also stops further insertion of fields.Only one append structure can be used
6. Preformance techniques
Ans.
1. The sequence of fields must be same as per database table
2. During writing select query write all fields in sequence as per database table.
3. Never write select statements inside loop….endloop.
4. Use st05 SQL trace, se30 run time analysis, code inspector, slin,etc.
5. Use select single * statement instead of select *
6. Always use primary key
7. Use binary search but before using binary search sort that table.
7. How to debug sapscripts ?
Ans.
Two ways to debug sapscript . first way is goto SE 71 and from menu bar select Utilities->activate debugger .then goto SE38 execute the print program ,it automatically goes to debugging mode …..the other way is , run the program RSTXDBUG in se 38 . execute it . a message will show that debugger is activated .now open the print program in se 38 …u vll notice that the print prgm is automatically diverted to debugging mode.
8. What is partner selection?
Ans. This concept is mainly used in IDOC where u select the partner profile using Tcode We20 .with  Tcode SM59 you create RFC(remote function call) to create communication link to a remote system.
10. What is occurs in internal table?
Ans. Occurs addition to the Declaration will give initial size to that table.occur statement allocates 8kb of memory to the internal table.
11. What is page window?
Ans : page window is nothing but a container of a page ,which uniquely identifies a set of data …for example while creating invoice …we create logo window , billing document header window , customer window , terms and condition window etc …
12. What is the difference between scrolling a table horizontally and vertically..??
Ans: In table control when you scroll a table vertically presentation server needs to call application server to fetch the next record and display in the table while in case of horizontal scroll there is no need to call application server.
13. What are Field Groups?
Ans: A group that combines several fields fewer than one name, at runtime, the INSERT command is used to define which data fields are assigned to which field group are called Field Groups. It should always be a HEADER field group that defines how the extracted data will be sorted; the fields grouped under the HEADER field group sort the data.
14. List the events in ABAP/4 Language?
Ans: The events in ABAP/4 are load of program ,Initialization, Selection Screen, Start of Selection, End of Selection, Top of page, Line selection, User command, End, First.
15.How the values will be passed to RFC Function module PassbyValue or Passbyreference?
Ans: always Pass by Value.
RFC is Remote Function call so it can’t access the values with Pass by reference.
16. Buffering concept usage?
Ans: There are three type of buffer
1 single record
2 generic buffer
3 full buffer
Buffering is use for improve performance. it improves performance  10 to 100 times more
17. Select up to 1 row and select single difference ?
Ans:  Select single fetches first matching record. If more than one matching records are there then only the first matching record will be considered other records will not be taken into account. Where as select up to 1 rows will fetch all the matching records from the database.(Again it will assign only One Record to the internal table/Work area)
18. What are the different buffering methods?
There are two different buffering methods
The system ensures that data transfer between the R/3 System and the database system is as efficient as possible. To do this, it uses the following techniques:
Table buffering: The program accesses data from the buffer of the application server.
Database request buffering: Individual database entries are not read or passed to the database until required by an OPEN SQL statement.
19. Different types of locks?
v  Read lock (shared lock)
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.
v  o 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.
v  o Enhanced write lock (exclusive lock without cumulation)
Works like a write lock except that the enhanced write lock also protects from further accesses from the same transaction.
20. CHAIN END CHAIN?
Ans: Chain and end chain are used for multiple field validation in Module pool programming .It is written inside the screen flow logic.
21.How to Debug RFC Function module?
Ans:
SE38 –> Utilities –> Settings –> ABAP Editor –> Debugging
Activate the external debugging and choose the New Debugger option in ABAP debugger.
Go to the particular place in the code and put break point, pop will appear then choose the HTTP break point.
If you are triggering the RFC from SAP portal make sure that both the user ID should be same
If the users are different then provide the XI/Portal User ID in the users field.
22.Why sapscripts are client dependent and smartforms are client independent.?
Ans-: Smartforms create its own function module so it doesn’t need to transport the request through SCC1.As all the Development Object are stored in client independent tables. Whereas Script doesn’t generate  any function module while executing so we need to transport the request number through SCC1.Sap script is stroed in side the client depended table as a TEXT.so sapscripts are client dependent and smartforms are client independent.
23. Difference between user exit and BADIs?
Ans: User exit is for single implementation and it is procedural approach while BADIs are for multiple implementation and object oriented approach.
Multiple implementation means Reusability… because we use OOps Concepts for BADI.
24. Control break events in ABAP:-
1. AT-FIRST: This is used when we want to execute the statements before records are processed.
2. AT-LAST: This event is used when we want to execute the statements after all records are processed.
3. AT-NEW: This event is used when we want to execute the statement before group of records are processed.
4. AT-END: This event is used when we want to execute the statements after processing of group of records.
25.I am uploading 100 records out of which say 59th record has error so what will happen if i am using synchronous or asynchronous method of BDC? Can we update the database using local update mode how?
26. Suppose i am writing following code then what will be output?
LOAD-OF-PROGRAM.
WRITE:/”HELLO”.
Ans:  HELLO
(Explain the importance of LOAD-OF-PROGRAM Event.If you dont know Tell the interviewer as this event is used in such cases when you want to clear sum buffers or something Before calling that Program)
27. What is TMG?
Ans. TMG stands for Table Maintenance generator. It is a tool available in abap by which we can add or delete multiple records at a time and it is executed or triggered by the transaction code SM30.
28. Difference between select option and ranges ?
Ans. The main difference between select option and ranges is that ranges implicitly or automatically creates internal table with fields like OPTION,LOW,HIGH,SIGN,etc . Where as in case of select option we have to explicitly create internal table.
When u declares a select options it will implicitly declare an internal table (ranges) for you.
While using RANGES syntax u can declare internal table explicitly.
The only need of declaring ranges is when you r not taking input from the user but you want make limit based selection at that time it will be use full e.g. SELECT ** from ** where MATNR in val_range.
here u can use select-option or ranges : val_range.

29. is it possible to bring select option in module pool screens?
Ans.Create a SELECT-OPTIONS in module pool screen using two methods as shown.
Method 1:—-
a) Create a subscreen area in your screen layout where you want to create the select options.
b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
select-options s_matnr for mara-matnr.
SELECTION-SCREEN END OF SCREEN.
c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
CALL SUBCREEN sub_area INCLUDING <program> <screen>
This CALL SUBSCREEN statement is necessary for transport of values between screen and program.
Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
Method 2:——-
a) Create 2 separate fields in your screen layout – one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
continued ……
struc_tab_and_field-fieldname = con_cust. ” ‘KUNNR’
struc_tab_and_field-tablename = con_kna1. ” ‘KNA1′.
CALL FUNCTION ‘COMPLEX_SELECTIONS_DIALOG’ EXPORTING*
TITLE = ‘ ‘
text = g_titl1 ” ‘Customers’
tab_and_field = struc_tab_and_field
TABLES RANGE = rng_kunnr
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
INVALID_FIELDNAME = 4
OTHERS = 5.
IF NOT rng_kunnr[] IS INITIAL.
* Read the very first entry of the range table and pass it to
* dynpro screen field
*READ TABLE rng_kunnr INDEX 1.
IF sy-subrc = 0.
g_cust = rng_kunnr-low.
ENDIF.
ENDIF.
You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.
30.how we can retrive data using secondary index.explain with simple example
Ans:  First create secondary indexes on required fields of a particular database table.
We can create one primary index and 15 secondary indexes.Once the respective secondary indexes are created write select queries and within select queries specify secondary indexes field name with where clause.
31.How can we handle table control in BDC?
Ans.We can handle table control using line index
Line index indicates which line of Table control is to be use for BDC transaction
Ex -
perform bdc_field using ‘RC29K-AUSKZ(01)’
Indicates 1st line of table control is going to be used for transaction which is Line index of Table Control
32. If i want to execute a BDC program only in background not in foreground is there any option for this?
Ans.The sm37 transaction can be used for running a program in the background. Also in the session method while processing the session you can specify the processing type as background or foreground.
33.How Can We upload a text file having Delimiters in to Legacy System
Ans.For up loading text file we use the pre-defined FM gui_upload. in that FM we have the parameter has_field_seperator for that we assign the default delimiter ‘x’.
HAS_FIELD_SEPERATOR ‘X’
‘X’ can provide the Whatever delimiter we used in flat file for separation.
34. What is the land scape in sap.
Ans. In every organisation sap landscape involves three servers viz, Development server, Quality server and Production server. Whatever new development we do as per clients requirement is done in development server. Later to test the developed object we move it to quality server for testing and finally once everything goes clear then the object is moved to production server ,production server data is ready for final business use.
35. Workbench request are client dependent or client independent
Ans. Workbench request are client independent.
(Common Man Workbench request holds the Program , FM etc…. How it can be Client Dependent!!!!)
36. Tell me about workbench request and customization requests.
Ans.Workbench (ABAP Dev) request is client independent when you import it into one system it reflact it in all client in same system, but customized request has to import in that client perticular client where it is created, actually it is client dependent.




Reports and Transactions:

1. What is LDB. Disadvantages of LDB and also advantages.
Logical Database is special ABAP program. It’s nested select statements.
Advantages: If you use LDB, it retrieves data as per foreign key relations from different tables. You need not know the relations among tables.
Disadvantages: Runtime will be increased if you use LDB.

2. What are the events associated with LDB and their purpose.
GET and GET LAST. GET will be triggered for each record and retrieves a record. GET LAST will be triggered at end of each record.

3. In which order they will be triggered.
First Get and then Get last of same table.

4. How will you change the selection screen of a LDB.
Selection screen can be changed through you add selection screen option in the program, these will be automatically added to LDB selection screen for this program.

5. Where you attach the LDB to a report.
One is Attributes, two at report header.

6. How many LDBs you can use in a Report.
Only one.

7. Order of events triggered during execution of report program.
Initialization, selection-screen, at selection-screen, start-of-selection etc

8. How to get help and/or possible values for selection screen fields
Events AT SELECTION-SCREEN ON HELP REQUEST and AT SELECTION-SCREEN ON VALUE REQUEST.

9. How many secondary lists you can have in a report.
20 secondary list and 1 basic list.

10. What are events, which triggers secondary lists.
At line-selection, At PFnn, At User-command.

11. What is the purpose of HIDE statement.
Any other methods other than HIDE for same purpose.Hide will help in transferring data from basic list to secondary list or one list to other list. Other methods are GET CURSOR and SY-LISEL.

12. What are the different techniques for Data processing/refining in ABAP reports.
1. Internal Tables. 2. Extracts (Field Groups)

13. Can you put a SQL Join statement in ABAP? If yes, How
Through alias (only in 4.0 and above versions)

14. What is the system variable, which tells about number database records handled.
SY-DBCNT

15. What are different techniques available for modularization.
Internal Subroutines, External Subroutines, Macros, Function modules and Include programs.

16. What are different types of internal tables and their usage.

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


17. One of my users has access to SE38 transaction, and so he can run the program developed by you. You have attached this report/transactional program to a particular Z* transaction. To restrict the users to Execute this program, what you do it from programming side?

Check for Authorization object S_TCODE with value “Z----” in initialization event.
(Code:
Authority-check object 'S_TCODE'
id 'TCD' field 'ZBC_REQ'.)

18. We need to download an internal table to the Presentation Server (local workstation).
Whenever we run the program, the same file has to be saved as a separate file in sequential order. Ex: 0001.txt, 0002.txt etc. Where can we store the last file number?


SAP has a table TVARV for storing the variants.
A record may be created in TVARV for all the programs that require these kind of incremental records.
For Ex: the record could be 010ZBC_TEST MM sequence rec where first part consists of client code and the program being run. Client code is required because TVARV does not have a field for client code. The second part is the description indicating the purpose what the record is created. This entire string may be posted in the Name field (char - 30).
The Type field (char- 1) may be populated with P or S (Parameter or Selection)
Low field (char- 45) may be populated with '0001' when run first time and increment it by one in your program for downloading of the internal table.

19. When we create a customer the information is updated in structure RF02D and the
Some tables like KNA1 are updated. How can we find the tables for master data transactions?
Go to ABAP Workbench -> Overview -> application hierarchy - SAP -> (or SE81 transaction code) follow the customizing based tree for your application. Double click on a lowest level to get for the correct marked development class. Then, here you can find all the tables, views, logical databases etc..,



What is a report?
Report is a program used to fetch data from the database tables and display it on the screen. It has 2 screens selection screen(optional) and list or output screen.
When the TOP-OF-PAGE event does get triggered?
TOP-OF-PAGE event will be triggered when the first ULINE, WRITE or SKIP statement occurs in a program.
What is the difference between SKIP and RESERVE?
SKIP provides empty space between lines, while RESERVE executes a page break on the current page if the number of lines between current line and the page footer is less than the number specified in RESERVE statement.
What is the difference between SKIP and NEW-LINE?
SKIP generates a blank line, while the NEW-LINE causes the control to move to next line.
What is hotspot?
Hotspot is an area on the list where the mouse pointer turns into an upright hand symbol. A single click on the hotspot does the same thing as a double-click.
What does HIDE statement do?
The HIDE statement hides the contents of the line along with the line numbers in a system defined HIDE area. This is used in interactive reporting.
What are the events in classical reports?
  • INITIALIZATION
  • AT SELECTION-SCREEN
  • START-OF-SELECTION
  • END-OF-SELECTION
  • TOP-OF-PAGE
  • END-OF-PAGE
How many detail lists can be created in interactive reporting?
20
What is the name of the system variable that holds the contents of the selected line in interactive reporting?
SY-LISEL
Can we set page headers to details lists?
Yes. Use TOP-OF-PAGE DURING LINE-SELECTION event..

No comments:

Post a Comment