Thursday, 5 April 2012

Most frequently asked interview DIFFERENCES

1.sapscript and smartforms

    Sap script is client dependent and smart form is client independent.
    Smartforms has Only 1 main window while Sap script has 99 main windows
    You can not print labels using smart forms

2.BDC and LSMW

    In BDC we have to take care of field mapping whereas field mapping is taken care by sap in lsmw.
    BDC is mostly used for customised data upload while LSMW is used for uploading Master data.
    In BDC we need to write large code but in LSMW small coding is needed.

3. BADI and BAPI

    BADI is business add ins, it is used to customize the standard business flow
    BAPI is Business application programming interface. It is nothing but Remote enabled function module which can be called from outside the SAP System.

4.user exit and customer exit

    User exit is an include program given by SAP in that you can write your code , It needs Access key from SAP while key is not required in case of customer exit

5. Select single and select up to one row

    Select single will fetch only one record while select up to n row. Will fetch n rows from database

6. Normal (Classical) report and ALV report

    To display the output in classical report you use WRITE Statement.
    To display the output in ALV we have different function modules and class like REUSE_ALV_GRID_DISPLAY , REUSE_ALV_LIST_DISPLAY and CL_SALV_TABLE.
    If you run the classical report in background after JOB finished you can see it’s output which stored in spool, While in case of ALV you need code extra to store the output as it will not generate the spool.

7. ALV list display and ALV grid display

    You cannot retrieve the output for the report which is displayed using ALV GRID Display.As spool Request will not be created for the same. While in case of list display Report out put will be there in spool request.

8. Classical and drill down report

    In classical report user cannot interact with report whereas in drill down report user can interact with report.
    Drill down facility is not provided in classical report while in drill down it is provided.
    If they ask you in detail then tell the interviewer that interact with the report means in drill down report we have one basic list and 20 secondary lists so we can directly go to 5th list or 10th list as per our requirement similarly we can come back to any list. Drill down means showing data in basic list first and when we double click on any field we get summarised list. NOTE:- to go to next list in drill down report use following syntax SY-LSIND = < list number> example: to go to 15th list SY-LSIND = 15 to come to 5th list from 15th list use F3 KEY OR PRESS BACK BUTTON

9. BAPI and RFC function module

    BAPI is nothing but remote enabled function module
    BAPI is provided as a method of business objects

10.sap 4.7 and ECC 6.0

    SAP 4.7 is based on Web AS
    ECC 6.0 is based of Netweaver 7.0.

11. get cursor and hide in interactive report

    Get cursor will provide the location cursor position in the report
    While hide is use to pass the data from basic list to secondary list

12.normal function module and RFC

    You cannot call normal function module from outside the current system while RFC function module can be called from outside the SAP system.

13. Subroutine and function modules.

    Subroutine is local to the program while function module is global.
    To call subroutine from outside its main program you need to write its main program name in the bracket

14.At selection screen and At selection screen output.

    At selection screen output is called first
    All dynamic commands and screen modification is done in AT selection screen output.

15.direct input and batch input

    The basic difference is validation is not done in direct input by pre defined function while in batch input it is coved.

16.synchronous and asynchronous in BDC

    Synchronous mode will wait until the BDC session gets over while asynchronous mode will not wait for that

17.at selection screen and at selection on field name

    At selection screen is used to validate the whole screen elements while at selection field is used to validate the particular field.
    When you display the error message in at selection on field the focus will be on that particular field while in case of At selection screen the focus will not be on any particular field.

18. PBO and PAI event in module pool

    Process Before Output and Process after input.
    PBO will be called before the screen is displayed to the user while process after input is called once user interact with screen.

19. Stop , check and exit

    If you use the STOP statement within an event block, the system stops processing the block Immediately.
    If you use the EXIT statement within an event block but not in a loop, the system stops Processing the block immediately
    If you use the CHECK <expr> statement within an event block but not within a loop, and the Condition <expr> is not fulfilled, the system exits the processing block immediately. <expr> can be any logical expression or the name of a selection table. If you specify a selection table and the contents of the corresponding table work are do.

stop_check_exit

20.free and refresh in internal table

    You can use FREE to initialize an internal table (along with header line ) and release its memory space.
    REFRESH will only initialize an internal table (along with header line)

21.clear and delete.

    The major difference is clear is used with internal table while delete is used with database table.

22. collect and sum

    COLLECT <line> INTO <itab>. The statement first checks whether the internal table contains an entry with the same key. If not,it acts like INSERT. If there is already a table entry with the same key, COLLECT does not inserta new line. Instead, it adds the values from the numeric fields of the work area <line> to thevalues in the corresponding fields of the existing table entry.
    SUM.Can only be used in loops through internal tables. Calculates the sums of the numeric fields in alllines of the current control level and writes the results to the corresponding fields in the workarea.

23. call transaction and session method

    Call transaction is Synchronous Processing while session (classical) method is Asynchronous Processing
    In call transaction we can update the database both synchronously and asynchronously. We can specify the mode in the program. While in session method it is Synchronous Database update.
    In call transaction No batch input processing log is maintained while in session method details log is maintained.
    Call Transaction method is faster than the session method.

24. at first and at last control break event

    As the name suggest AT FIRST executed for the first time while AT LAST executed in last.

25. Enhancement point and Enhancement Section

    Both the enhancement-point and section are available for you to change standard SAP code. Difference is in fact that you use Enhancement-point to add ABAP code to standard SAP and enhancement-section to replace/extend standard SAP code.

26.end of page and top of page

    Top of page trigger when report encounter the first write, skip or new-line statements.
    End of page trigger when page size is over or report display gets over.

27. Table and structure

    Table has physical definition into the underline database while structure does exist physically in the data base.

28. table and views

    Table has data init while view does not contain data in it. Both exist in the data base. when u run the view it queries the database and gives the respective data.

29.inner joins and for all entries

    Inner join joins the table at database level whereas For..All..Entries joins the table at application level.
    In For..All..Entries when the condition gets satisfied data is fetched in one single shot from database table whereas in inner join data is fetched iteration by iteration
    It is always good programming practice to join tables at application level because if we join tables at database level then there might be performance issue

30. Transparent table pool table and cluster table

    Transparent Table: Exists with the same structure both in the dictionary and database exactly with same data and fields. it’s to store transaction data. It’s one to one Relation table
    Pool tables: These are logical tables must be assigned to a table pool when they are defined. Its use to store control data. its many to one relation table
    Clustered tables: these also logical tables and must be assigned to table cluster when they are defined. It’s also used to store control data, temporary data or text ex., documentation. It’s also many to one relation table.

31. Top of page and top of page during line selection

    Top of page is triggered for the basic list while top of page at line selection triggers at secondary list.

32. Start_form and End_form in sap script

    start_form function module is called if we want to use different forms with similar characteristics in a single spool request ,it must be closed by END_FORM function module

33. open dataset and close dataset

    Open dataset is use to read / write file into application server while close dataset is use to close that file.

34. data element and domains

    Domain gives technical details like length , decimal etc..while data elements gives description and business details

35. set screen and call screen

    Set screen <no> set the next screen value and temporarily override the next screen value in screen attribute. While call screen <no> jump to the screen specified in <no>.

36. Internal Session and External Session

    External session is nothing but the window you have opened in your screen .By Default you can open 6 external sessions( 6 windows = you can increase it via basis’s setting). Internal session is created when you call any Functional module or any other task in your program. counts for internal sessions are 9.

37. Elementary and collective search help

    An Elementary Search help defines the flow of a standard input help. It is composed of a selection method that defines where to get the data that will make up the hit list, An interface consisting of search help parameters that define the exchange of data between the screen and the selection method and a dialog type that controls how the hit list will be displayed.
    A Collective Search help is a combination of several elementary search helps giving the user a different search paths. The interface parameters of the elementary search help are assigned to the parameters of the collective search.

38. What is the difference between Clustered Tables and Pooled Tables?

    A pooled table is used to combine several logical tables in the ABAP/4 dictionary. Pooled tables are logical tables that must be assigned to a table pool when they are defined.
    Cluster table are logical tables that must be assigned to a table cluster when they are defined.
    Cluster table can be used to store control data they can also used to store temporary data or text such as documentation.

39. user exits and customer exit.

    User exit is sap defined includes so to modify it we need key from SAP.while customer exit like function exit , screen exit we don’t need any key.

40. sapscript smart forms and adobe forms

    Sapscript is client dependent whereas smartform is client independent.
    Main window is compulsory in scripts whereas main window not compulsory in form.
    Smartform output can be seen in web while in scripts it is not possible.
    smartform generates function module while scripts dont generate function module.

41. screen and subscreens in module pool.

    Screen has it’s own gui status while subscreen does not have any gui status.Subscreens are part of main screen.

42. standard table and hashed tables.

    Standard table can be accessed by key as well as index while You can only access hashed tables by specifying the key. The system has its own hash algorithm for managing the table.

ABAP Dictionary

TABLE TYPES IN SAP:

Choosing a Table Type
The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
Standard tables
This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
Sorted tables
This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
Hashed tables
This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
Table type
The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.

ALV Report Generator

Thursday, 17 November 2011

ABAP FAQ - 2


ABAP FAQ's


What is the difference between SAP memory and ABAP memory?
Answer1:
data sending between main sessions using get parameter and set parameter is sap memory
data sending between internal sessions using import or export parameters is abap memory

What is the difference between Table and Template?
table is a dynamic and template is a static

When do we use End-of-selection?
End-of-selection event are mostly used when we are writing HR-ABAP code. In the HR-ABAP code, data is retrived in the Start-of-selection event and Printing on the list and all will be done in End-of-selection event.

What is table buffer? Which type of tables used this buffer?
buffer is nothing but a memory area. table is buffered means that table information is available on application server. when you call data from database table it will come from application server.transperent and pooled tables are buffered. cluster tables can not buffered.


What is the difference between SAP memory and ABAP memory?
Answer1:
data sending between main sessions using get parameter and set parameter is sap memory
data sending between internal sessions using import or export parameters is abap memory

Answer2:
sap memory is a global memory whereas abap memory is local memory.

For example, we have four programs in abap memory and assigned some varibles to a particular program in abap memory then those varibles can't be used by anyother program in abap memory i.e., the variables are only for that program and also local to that memory,whereas sap memory can access all the abap memory or else it can perform any kind of modifications.

Answer3:
SAP memory is available to the user during the entire terminal session.
ABAP memory is available to the user during life time of external session.


What is the difference between Type and Like?
Answer1:
TYPE, you assign datatype directly to the data object while declaring.
LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.

Answer2:
Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.

Answer3:
type refers the existing data type
like refers the existing data object


What is difference between dialog program and a report?
Report is a excecutable program
Dialog is a module pool program.It has to be executed via a transaction only.
Dialog programming is used for customization ofscreens



What is Field sysmbol ?
Answer1:
You can use field symbols to make the program more dynamic. In this exanmple the name of a table control is substituted by a field symbol. Thus you cal call the form with any internal table, using the name of the tablæe control as a parameter.
Example
form insert_row
using p_tc_name.
field-symbols type cxtab_control. "Table control
assign (p_tc_name) to .
* insert 100 lines in table control
-lines = 100.


Why BAPI need then BDC ?
BAPI"S provide the standard interface to other applications apart from SAP and within differnt vesions of SAP too. Also it is OOD bases so dosen"t depends on screen flow. BDC gets failed if we make changes for screen changes through IMG customization

What are the advantages and disadvantages of using views in ABAP porgramming ?
advantages:
view is used to retrieve the data very fastly from the database tables
*memory wastage is reduced
*faster than joins to retrieve the data from database tables
disadvantages:
view is not a container,it will not hold the data
*view memory is not permanent memory

How can you debugg a script form?
SE71 -&gt; give the form name -&gt; utilities -&gt; activate debugger

Wednesday, 16 November 2011

GET & SET Parameter


ABAP/4 memory 

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


ABAP memory - Transfer data from program to program.
SAP Memory - transfer data from program to Transaction.

When you see 'Export and Import ' and it is ABAP memory'

When you see Set parameter id and get Parameter id and it is called SAP Memory

  1. SAP Memory is a global memory area which all sessions within a
    SAPgui have access to. This allows for passing data between
    sessions. The SET PARAMETER ID and GET PARAMETER ID statements are
    used to manipulate the SAP Memory.

    SET PARAMETER ID 'MAT' field p_matnr.
    GET PARAMETER ID 'MAT' field p_matnr.
     
  2. ABAP Memory is a memory area, which all programs in the call stack within the same internal session can access. The EXPORT and IMPORT
    statements are used here.

    export p_matnr = p_matnr to memory id 'ZTESTMAT'.
    import p_matnr = p_matnr from memory id 'ZTESTMAT'.

ABAP FAQ - 1


ABAP Frequently Asked Question
 
ABAP/4
Q: 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?
A: Go to ABAP Workbench -> Overview -> application hierarchy - SAP -> follow the customizing based tree for your application. Double click on a lowest hierarchy level to get for the correct marked development class. Here you can find all the tables, views, logical databases etc. used for a system operation. 


R F C 
Q: We want to move a SAP table to an Access table using TABLE_EXPORT_TO_MSACCESS_RFC
Importing parameters are
DBNAME
DEST
FLG_APPEND
FLG_POPUP
LANGU
The table has three columns: 
TABNAM
MANDT
SDATA
We have no Exporting parameters. 
How shall we set the parameters? 
A: Install the PS utilities, which are part of SAPGUI install CD. You may run report RIACCESS from SE38. Go to SALE -> Communication -> Define RFC Destination. Setup two RFC destinations PS_ACCESS_1 and PS_ACCESS_2 and will have to get them to point to wdpsastr.exe and wdpsatab.exe respectively. Then execute RIACCESS and choose PS_ACCESS_1 to generate access tables. Please note that Access only supports tables with up 255 fields.
Q: We want an RFC do the following transactions - MB1A, MB1C, >MB01 (Goods receipt/issue)
A: Call the RFC INBOUND_IDOC_PROCESS with IDOC_CONTROL and IDOC_DATA. The structure in the field sdata in the IDOC_DATA is e1mbxyh and e1mbxyi.

Transports
Q: In a Dev instance, we want to transport a modification to a layout set from one client to another. What is the best way?
A: use transaction SE71. Choose Utilities->Copy from Client. Layout sets need not be transported between clients, via transport requests DEVKxxxxxx.
Q: We need to keep track of the transports that need to flow through to other systems (i.e., DEV, TST, TRN, PRD etc). Is there a way do this?
A: SAPCRAFT enables you to control the CTS from DEV system. This keeps track of all transports at all stages and enables you to allocate Import, export and Authorization functions to specific user. 

E D I / IDOC
Q: 1 we created an EDI Vendor and created all required output conditions. However no IDOC is generated when PO is printed. Why?
A: Go to Header->output for the PO. The output type shall be '6'. The status shall be '1'. If the status is '0' check the timing. If the status is '2' , go to 'GOTO->Processing Log' and the explanation for non-generation of IDOC can be seen.
Q: How can we create / upload IDOC's from legacy system to SAP?
A: Third party tool Mercator may be used to convert Legacy files to Idoc format. Mercator provides an IDOC tree import facility, SAP provides the export facility. You can transfer the Idoc layouts from SAP to Mercator automatically and then map. 
Q: We want to receive an outbound EDI 855 IDOC only if E2EDP20 -scheduling confirmation segment is present. Else get an "error" status preventing triggering the EDI subsystem.
A: User exit logic has to be added in function IDOC_INPUT_ORDRSP.
# Set up a test flag and set it off when the IDOC header is read. 
# Turn the flag ON when the EDP20 segment is read. 
# Interrogate this flag when the next segment after EDP20 in the same IDOC comes in. If it is on, you have an EDP20 coming in. 
# Issue an error status 51 with suitable message for whichever condition you don't want the IDOC to be processed, This will stop the IDOC from posting.
Q: Wherever PO is sent to the vendor via EDI, we want an acknowledgement of the PO by vendor. Which fields are updated and what should be my procedure?
A: Execute Program: IDOC_INPUT_ORDRSP
Process code: ORDR
Message type: ORDRSP
IDOC: ORDERS01
The confirmation process allows the supplier to return an acknowledgment. Only Dates and quantities can be changed the information is stored in the PO and can be viewed via Item->Confirmation->Overview. The PO can be flagged as 'confirmation required' so that Pos without acknowledgement receipt can be monitored. Control keys and tolerances (days and quantities) have to be customized.

A L E
Q: Our IDOC remains in status 51 (not posted) while testing ALE setup by passing DEBMAS02 Idocs. The message 'Field KNA1-BRSCH is not an input field'. This is the Industry key. What are we missing?
A: Go to IMG - menu path IMG->Logistics General-> Logistics Basic Data: Business partners->Customers-> Control->Define Account groups and field selection for customer.
Select sold-to or ship-to. Select General Data. Select control and double click. Industry key is found here. Change the option to 'Optional Entry'.
Check OSS 5599. You may have to update view V_T078D also.

Batch In-put/ Direct In-put
Q: We are calling transaction VL01 in batch input to create deliveries using a program for delivery due list. How ever we are unable to create deliveries for transport stock orders. Why?
a: Batch-inputs can not be used to fill the "delivery due list" screen because it is not a dynpro. This is a standard SAP report. A SAP report (check with "System -> Status") may be called using SUBMIT sentence with the appropriate options . It is preferred to call a report than create a Batch-input program.
Q: What are some sample Direct input data transfer programs?
A: In MM for Material Master data - RMDATIND
FI - for Accounting Documents - RFBIBL00
PP - for Independent requirements - RM06IN00
CA - for Classification data - RCCLBI03

Handling Tables
Q: We specify the logical database. And we want a field that is not present in any of the tables defaulted in logical database. How can we want to add this additional field from a different table?
A: . Presume you have a 
Logical database 
Table 1
Table 2
Table 3
 
Define the required field as additional field say fld of table 1, table 2 or   table 3  
And then in the code section define.
 
Perform get_f1d (zxxxxxxx) using f1d.
Form zxxxxxxx could be like;
Form get_f1d-using f. 
Select * from where 'conditions'
f = table4 - f1d.
Q: 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?
A: SAP has a table TVARV for storing the variants. 
A record may be created in TVARV for all the programs that require this kind of incremental records. 
For Ex: the record could be 100Zmm10001 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. 

Others
Q: How can we use CAD with SAP?
A: Third party tools from Eigner + Partner provide interfaces to SAP. Another third party software - Fast look Plus from Kamel Software enables you to view all of the Autocad formats.
Q: How can I access SAP through Internet?
A: SAP has its own Internet transaction Server (ITS). Other products include Haht, Web Objects, Net Dynamics etc. Each product has its' own architecture. 
However to access the database, access paths SAP GUI or RFC Channel have to be used.
Q: How can we transport the standard text?
A: Refer note 3355 in OSS for a complete explanation. The SAP script objects that should be transported must be written in a transport request.
The entries are as follows:
R3TR FORM NAME (NAME = Name of the layout set) 
R3TR STYL NAME (NAME = Name of the style) 
R3TR TEXT OBJECT,NAME,ID,L 
(OBJECT = Text object, NAME = Text name, ID = Text ID, L = Text language)
If you want to transport a number of texts, you can use report RSTXTRAN to insert the individual text keys into a correction. The transport request must be entered and released via the transport system. 
Q: How to find what transactions a particular user was running for a given period in the past (Eg: from 1st of a month)
A: You may use the transaction - STAT. 
Q: We want protect/lock a field so that only selected people can change the value while others can only read. How to set the authorizations?
A: Create an authorization object for change mode. Loop at screen in the user exit and set input to 0. Check the user based on sy-uname and the authorization. Decide whether input should be 0 or 1.
Q: How to lock a user-defined transaction for some time during which no user can access the same?
A: Use transaction SM01. Scroll through the transactions and check against the transaction to be locked. And after the maintenance is over, go back to SM01 and uncheck the same to unlock.
ABAP Tips and Tricks
Find out in what all Tables a specified field is available.
You can find out through transaction code SE15.
1) Give SE15 on command prompt.
2) Select ABAP Dictionary
3) Select "fields" folder
4) Click on table fields
5) Then you can enter the desired field name (In your case EKGRP)
6) Run OR press F8.
The system will list out all the tables, which contain your desired field name.
Or
1) Using transaction Code SE11 (ABAP Dictionary)
2) enter the Data table name where in the respective field (EKGRP) is used eg; EKKO
3) Click the where -used list button
4) Check out the box (DB tables) only.
There you can see entire list of tables containing the desired field.
Here the difficulty is that one should know at least the name of the one of the data tables, which contains the desired field.
With Compliment by: Manohar TS & Kotha
**********
Find the Table Name For a Field.
I know couple of ways to find the table name for a field.
Like.
1. Part the cursor at the field and press F1 & F9.
2. Se84 or se15
3. St05 (sql trace).
4. Setting Break point in ABAP.
If you will tell other methods it will be appreciate.
**********
*
* How to print Apostrophe using the write statement
* for e.g. you'll be there.
*
Report zapostrophe message-id z1.
DATA: LINE (20).
CONCATENATE 'You''' 'll be there.' INTO LINE.
WRITE:/ LINE.
**********
 
**********
Given a transaction code, how can I find the menu path?
In 4.6c, you can used tcode search_sap_menu to find the SAP MENU tcode.
Please note that there are no tcode available to find the path of the IMG transaction.
**********
How to un-encrypt SAP user password?
It is not possible to un-encrypt the SAP password, because a one-way encoding (with strong 1024 bit key) is used for this. The result is stored and each time one has entered the password the encoding result is checked.
**********
When you delete an entry from an internal table in ABAP, the system has to re-generate the index for all entries after your delete, slowing the report if you have many records to eliminate.
It is much quicker to do an insert of the correct records into a second table than to delete entries from the first. The reason for this is because the index is only generated for the newest element.
**********
If you want to protect a program against debugging, you just have to set the STATUS = S in the attributes view of the main program.
**********
BDC.
When you use a call transaction, and populate the BDCDATA table.
Make sure you pass the "DATE FIELDS" of any transaction by formatting it as  "XX/XX/YYYY"  cos if you pick this data from database it will be of the format 20030505 or something like that. Make sure you pass this value as character field.
Same is true for the "Rate Fields". Make sure you pass them as "Character Fields" by formatting them.
**********
If you need to find out the Okcodes for BDC sessions, look for program RSBDCCUA and run it for any platform say 'WN' for windows or MC for Mac and it will generate list of function codes
**********
To save the contents of an internal table as a Microsoft Excel Worksheet when debugging code in SAP R/3 Enterprise:
1. Click on the "Table" button
2. Type in the name of your internal table in the "Internal table" field and hit Enter.
3. Hit CTRL + F11 or click on the "Save as Excel Worksheet" button.
4. Type in the record numbers that you want to save. (Ex. From Line: 1 To Line: 10) Hit Enter.
5. Save your file.
**********
Starts with a Z are homegrown program.
You cannot be sure that anything, which starts with a Z, is a homegrown program.
SAP provides a number of correction programs, especially within the archiving area, which start with a Z.
for e.g. ZZSTOCKL from note 202345.
**********
Can line-size of abap report large than 255?
You can have line-size up to 1023.
Along with Report statement pass the line-size as 1023.   Ex. Report xyz line-size 1023.
**********
How to find out the number of days between a given date, excluding Saturdays and Sundays and public holidays?
Try functions,
=> DATE_CONVERT_TO_FACTORYDATE
=> HR_HK_DIFF_BT_2_DATES
Testing and Debugging ABAP Codes, Functions
Could some one help me? I am looking out answers for the following questions:
Explain what sort of testing you would do on your own code?
What steps would you take to debug a function or report in SAP?
Tips by: Kiran
First test your code with '/h' type in command window which shall take you to debug or by putting break points with F8. You test your program from code and then go to se30 performance analysis transaction and there you can know what are the drawbacks. Then go to SLIN transaction and do extended syntax check or from code in menu options where you have debugging -> extended check and the program id ready without error.
Tips by: Harichand Chandunair 
Testing your code.
As mentioned above after doing syntax check and extended syntax check you have to create a TEST PLAN. You have to test all possible Positive & Negative test cases. 
Test for division by zero if it involves calculation or code accordingly. 
Try to test for field overflows. If it involves sap script or smart forms try to print outputs, which have single, page and also multiple pages and which does not have any output at all. 
Test by leaving all parameters in selection screen blank. 
Test by entering wrong values in selection screen and display a pop-up if the user enters wrong selection screen values.
You can also do ABAP trace and SQL trace to make sure that your program is efficient.
Debugging code/program.
As mentioned above type /h in command line and try to execute the program. Another way is to set break point at the function module or the required line and do single step execute or execute.  Once you finished debugging, you can select Delete to clear all the break points.
Testing and Debugging ABAP
Third option in certain cases is to check for sy-subrc <> 0 and proceed from there by making it 0 by updating the sy-subrc in the debug editor and see how the program behaves if the value is what you enterd in the debug screen. For certain case try to use WATCH POINT feature in debug editor. 
Internal table in ABAP
*An internal table is a run time instance.  It gets created when program starts execution.
*It gets destroyed when program terminates. it has two different parts.  Header Line (optional) & Body (Compulsory).
*Any value that comes to or goes from internals table, that travels through header line \
*A related program is.
*Declaration.
Data: begin of inernaltable occurs 0,
 x type c,
 y type I,
 end of itab.
*Initializing header line
 internal table-x = 'd'.
   Internal table-y = 34.
  
*Storing value into internal table
Append internal table. 
Append internal table.
Append internal table.
*Reading internal table
loop at itab.
   Write: / internal table-x, internal table-y.  "Writes to output list
end loop.
ABAP Tips by: Abdul Sayeed
Email: sayeed_mail2005@yahoo.com
Fields of Internal Tables
SY-TABIX
Current line of an internal table. The statements below, but only for index tables set SY-TABIX. The field is either not set or is set to 0 for hashed tables. 
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table. 
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE. 
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry. 
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string are found.
SY-TFILL
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table. 
SY-TLENG
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the length of the lines in the relevant internal table. 
SY-TOCCU
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the initial amount of memory allocated to the relevant internal table.
List Box in ABAP Report
* List Box in ABAP Report
* Written by: SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com
 
REPORT ZLIST.
 
TYPE-POOLS: VRM.
 
DATA: NAME TYPE VRM_ID,
      LIST TYPE VRM_VALUES,
      VALUE LIKE LINE OF LIST.
 
PARAMETERS: PS_PARM (10) AS LISTBOX VISIBLE LENGTH 10.
 
AT SELECTION-SCREEN OUTPUT.
 
NAME = 'PS_PARM'.
VALUE-KEY = '1'.
 
VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.
 
VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.
 
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
 
START-OF-SELECTION.
WRITE: / ‘PARAMETER:’ PS_PARM.
Example Code For Drill Down Report
REPORT zmm_rept_purchorderkkb01 LINE-SIZE 80
                                 LINE-COUNT 65(3)
                                 MESSAGE-ID z_msg_class
                                 NO STANDARD PAGE HEADING.
 
*------------------DECLARING THE STANDARD TABLES---------------------*
TABLES: ekko, "PURCHASE ORDER: HEADER
         ekpo. "PURCHASE ORDER: ITEM
 
*------------------DECLARING THE INTERNAL TABLE----------------------*
DATA: BEGIN OF it_ekko OCCURS 2,
          ebeln LIKE ekko-ebeln, "PURCHASE ORDER NUMBER
          Bukrs LIKE ekko-bukrs, "COMPANY CODE
          Bsart LIKE ekko-bsart, "PURCHASING DOCUMENT TYPE
          Lifnr LIKE ekko-lifnr, "VENDOR
          Spras LIKE ekko-spras, "LANGUAGE KEY
          Zterm LIKE ekko-zterm, "PAYMENT TERMS KEY
        End of it_ekko.
 
DATA: BEGIN OF it_ekpo OCCURS 2,
          Ebeln LIKE ekpo-ebeln, "PURCHASE ORDER NUMBER
          Ebelp LIKE ekpo-ebelp, "PURCHASE ORDER NUMBER
          Werks LIKE ekpo-werks, "PLANT
          Matnr LIKE ekpo-matnr, "MATERIAL NUMBER
          Matkl LIKE ekpo-matkl, "MATERIAL GROUP
        END OF it_ekpo.
 
DATA: it_ebeln LIKE ekko-ebeln OCCURS 0 WITH HEADER LINE.
 
*DATA: it_ebeln_high LIKE ekko-ebeln OCCURS 0 WITH HEADER LINE.
 
DATA: p_ebeln       TYPE i.
 
*------------------Declaring the selection screen--------------------*
 
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
 
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
 
PARAMETER: p_limit TYPE i.
 
SELECTION-SCREEN END OF BLOCK blk1.
 
 
*INCLUDE z_incl_purorderkkb01_sub_f01.
 
 
*--------------------------------------------------------------------*
*  Validation for number of records to be printed                   *
*--------------------------------------------------------------------*
 
*AT SELECTION-SCREEN ON p_limit.
*  IF p_limit IS INITIAL.
*    MESSAGE e011.
*  ENDIF.
 
 
*  IF p_limit GT sy-linct.
*    MESSAGE e010.
*  ENDIF.
 
*----------------------------------------------------------------------*
*        Search help for purchase document number (s_ebeln-low)        *
*----------------------------------------------------------------------*
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebeln-low.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      Input  = s_ebeln-low
    IMPORTING
      Output = s_ebeln-low.
 
  Perform form_search_help.
 
  IF sy-subrc <> 0.
    CASE sy-subrc.
      WHEN 2.
        LEAVE TO SCREEN 1000.
    ENDCASE.
  ELSE.
    LOOP AT it_ebeln.
      IF sy-tabix = p_ebeln.
        S_ebeln-low = it_ebeln.
        EXIT.
      ENDIF.
    ENDLOOP.
  ENDIF.
 
*----------------------------------------------------------------------*
*        Search help for purchase document number (s_ebeln-high)       *
*----------------------------------------------------------------------*
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebeln-high.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      Input  = s_ebeln-high
    IMPORTING
      Output = s_ebeln-high.
 
  Perform form_search_help.
 
  IF sy-subrc <> 0.
    CASE sy-subrc.
      WHEN 2.
        LEAVE TO SCREEN 1000.
    ENDCASE.
  ELSE.
    LOOP AT it_ebeln.
      IF sy-tabix = p_ebeln.
        S_ebeln-high = it_ebeln.
        EXIT.
      ENDIF.
    ENDLOOP.
  ENDIF.
 
*----------------------------------------------------------------------
*                   Start-of-selection event                           
*----------------------------------------------------------------------
 
START-OF-SELECTION.
 
*----------------------To attach a user interface----------------------
 
SET PF-STATUS '0010'.
 
*---------To fetch the data for the basic list-------------------------
 
    SELECT ebeln                   "PURCHASE ORDER NUMBER
           Bukrs                   "COMPANY CODE
           Bsart                   "PURCHASING DOCUMENT TYPE
           Lifnr                   "VENDOR
           Spras                   "LANGUAGE KEY
           Zterm                   "PAYMENT TERMS KEY
     Up to p_limit rows
     Into table it_ekko from ekko
     Where ebeln in s_ebeln.
 
     REFRESH it_ekpo.
 
*---------To fetch the data for the secondary list---------------------
 
If it_ekpo is initial.
 
    SELECT ebeln "PURCHASE ORDER NUMBER
           Ebelp "PURCHASING DOCUMENT TYPE
           Werks "PLANT
           Matnr "MATERIAL NUMBER
           Matkl "MATERIAL GROUP
    FROM ekpo INTO TABLE it_ekpo for all entries in it_ekko
    WHERE ebeln EQ it_ekko-ebeln.
 
Endif.
 
*----------------------------------------------------------------------
*                   End-of-selection event                             
*----------------------------------------------------------------------
 
END-OF-SELECTION.
 
 
*---------To display the data for the basic list-----------------------
 
   Format color 4 intensified off.
  LOOP AT it_ekko.
    WRITE :/ sy-vline, it_ekko-ebeln UNDER text-002, 18 sy-vline,
                                                    "PURCHASE ORDER NUMBER
                       It_ekko-bukrs UNDER text-003, 27 sy-vline,
                                                    "COMPANY CODE
                       It_ekko-bsart UNDER text-004, 38 sy-vline,
                                                    "PURCHASING DOCUMENT TYPE
                       It_ekko-lifnr UNDER text-005, 50 sy-vline,
                                                    "VENDOR
                       It_ekko-spras UNDER text-006, 62 sy-vline,
                                                    "LANGUAGE KEY
                       It_ekko-zterm UNDER text-007, 80 sy-vline.
                                                    "PAYMENT TERMS KEY
 
  Hide: it_ekko-ebeln.
  ENDLOOP.
  WRITE :/ sy-uline (80).
 
*----------------------------------------------------------------------
*                To generate the detailed lists                        
*----------------------------------------------------------------------
AT LINE-SELECTION.
  CASE sy-lsind.
    WHEN 1.
      SET PF-STATUS '0011'.
 
*---------To display the data for the secondary list-----------------------*
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
    Format color 5 intensified off.
  LOOP AT it_ekpo where ebeln = it_ekko-ebeln.
    WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline,
                                                     "PURCHASE ORDER NUMBER
                       It_ekpo-ebelp UNDER text-008, 30 sy-vline,
                                                     "PO ITEM NUMBER
                       It_ekpo-werks UNDER text-009, 45 sy-vline,
                                                     "PLANT
                       It_ekpo-matnr UNDER text-010, 60 sy-vline,
                                                     "MATERIAL NUMBER
                       It_ekpo-matkl UNDER text-011, 80 sy-vline.
                                                     "MATERIAL GROUP
  ENDLOOP.
 
  WRITE :/ sy-uline (80).
 
  ENDCASE.
 
  CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC' OR 'BACK'.
       LEAVE TO SCREEN 0.
  ENDCASE.
 
*----------------------------------------------------------------------
*                    At user-command event                             
*----------------------------------------------------------------------
 
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'SELE' OR 'LIST1'.
      IF sy-lsind = 1.
      SET PF-STATUS '0011'.
 
*---------To display the data for the secondary list-----------------------*
 
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
       Format color 5 intensified off.
 
  LOOP AT it_ekpo where ebeln = it_ekko-ebeln .
    WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline, "PURCHASE ORDER NUMBER
                       It_ekpo-ebelp UNDER text-008, 30 sy-vline, "PO ITEM NUMBER
                       It_ekpo-werks UNDER text-009, 45 sy-vline, "PLANT
                       It_ekpo-matnr UNDER text-010, 60 sy-vline, "MATERIAL NUMBER
                       It_ekpo-matkl UNDER text-011, 80 sy-vline. "MATERIAL GROUP
 
  ENDLOOP.
 
  WRITE :/ sy-uline (80).
  Endif.
 
  ENDCASE.
 
  CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC' OR 'BACK'.
       LEAVE TO SCREEN 0.
 
  ENDCASE.
 
*----------------------------------------------------------------------*
*                    Top-of-page for basic list                        *
*----------------------------------------------------------------------*
 
TOP-OF-PAGE.
 
 Format color 3 intensified off.
 
  WRITE :/ sy-uline (80).
  WRITE :/ sy-vline,
           03 sy-repid,
           60 text-015,
              Sy-uname,
           80 sy-vline.
  WRITE :/ sy-vline, 03 sy-datum,
           35 text-012,
           60 text-014,
              Sy-pagno,
           80 sy-vline.
  WRITE :/ sy-uline (80).
  WRITE :/ sy-vline, text-002, 18 sy-vline, "PURCHASE ORDER NUMBER
                     Text-003, 27 sy-vline, "COMPANY CODE
                     Text-004, 38 sy-vline, "PURCHASING DOCUMENT TYPE
                     Text-005, 50 sy-vline, "VENDOR
                     Text-006, 62 sy-vline, "LANGUAGE KEY
                     Text-007, 80 sy-vline. "PAYMENT TERMS KEY
  WRITE :/ sy-uline (80).
 
*----------------------------------------------------------------------
*              Top-of-page for secondary list                          
*----------------------------------------------------------------------
 
TOP-OF-PAGE DURING LINE-SELECTION.
Format color 2 intensified off.
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
  WRITE :/ sy-uline (80).
  WRITE :/ sy-vline,
          03 sy-repid,
          60 text-015,
             Sy-uname,
          80 sy-vline.
 
  WRITE :/ sy-vline,
          03 sy-datum,
          35 text-013,
          60 text-014,
             Sy-pagno,
          80 sy-vline.
 
  WRITE :/ sy-uline (80).
 
  WRITE :/ sy-vline, text-014, 15 sy-vline, "PURCHASE ORDER NUMBER
                     Text-008, 30 sy-vline, "PO ITEM NUMBER
                     Text-009, 45 sy-vline, "PLANT
                     Text-010, 60 sy-vline, "MATERIAL NUMBER
                     Text-011, 80 sy-vline. "MATERIAL GROUP
 
  WRITE :/ sy-uline (80).
 
*----------------------------------------------------------------------
*                    End-of-page event                                 
*----------------------------------------------------------------------
 
END-OF-PAGE.
  WRITE :/ sy-vline,
           03 text-016,
              P_limit,
           60 text-014,
              Sy-pagno,
           80 sy-vline.
  Write:/ sy-uline(80).
 
INCLUDE Z_INCLUDE_PURCHORDERKKB01.
form form_search_help .
 
REFRESH it_ebeln.
  CLEAR it_ebeln.
  CLEAR P_ebeln.
 
  SELECT ebeln FROM ekko INTO TABLE it_ebeln.
 
  CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
      Endpos_col   = 21
      Endpos_row   = 35
      Startpos_col = 12
      Startpos_row = 1
      Title text    = text-012
 
    IMPORTING
      Choise       = P_ebeln
 
    TABLES
      Valuetab     = it_ebeln
 
    EXCEPTIONS
      break off    = 1
      OTHERS       = 2.
ABAP Interview Questions
1. How data is stored in cluster table? 
Each field of cluster table behaves as tables which contains the no. of entries. 
2. What are client dependant objects in abap/sap? 
SAP Script layout, text element, and some DDIC objects. 
3. On which even we can validate the input fields in module progams? 
In PAI (Write field statement on field you want to validate, if you want to validate group of fields put in chain and End chain statement.) 
4. In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically? 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL. 
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' to get material and material group for the plant. 
5. How do you get output from IDOC? 
Data in IDOc is stored in segments; the output from Idoc is obtained by reading the data stored in its respective segments. 
6. When top of the page event is triggered? 
After excuteing first write statement in start-of-selection event. 
7. Can we create field without data element and how? 
In SE11 one option is available above the fields strip. Data element/ direct type. 
8. How do we debug sap script? 
Go to SE71 give lay set name; go to utilities select debugger mode on.
9. Which transaction code can I used to analyze the performance of ABAP program? 
TCode AL21.
10. How can I copy a standard table to make my own z_table?
Go to transaction SE11. Then there is one option to copy table. Press that button.  Enter the name of the standard table and in the Target table enter Z table name and press enter.
Following are some of the answers, which I gave upto my knowledge.
1. What is the use of ‘outerjoin’ 
Ans: With the use of outer join you can join the tables even there is no entry in all the tables used in the view.
        In case of inner join there should be an entry in al the tables use in the view.
2. When to use logical database?
Ans. Advantage of Logical databases:
 less coding s required to retrieve data compared to normal internel tables.
        Tables used LDB are in hierarchical structure.
3. What is the use of 'table index'?
Ans .Index is used for faster access of data base tables.
4. What is the use of 'FOR ALL ENTRIES'?
Ans. To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.
        If there r more than 10000 records SELECT FOR ALL ENTRIES is used.
        Performance wise SELECT FOR ALL ENTRIES is better to use.
5. Can you set up background processing using CALL TRANSACTION?
       Yes, Using No Screen Mode.
6. What are table buffers?
    Table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed
 directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.
    Buffering is useful if table needs to be accessed more no. of times in a program.
With Compliments from: Pavan
1. How do I set a flag for a field in any table?
Create a char field of length 1. for example field STAS-LKENZ is Deletion Indicator. It means that if the value in the field is 'X' then that record has been deleted.
2. Can I execute user exits? If yes, how?
Yes you can. after finding the user exit, you need to use, goto CMOD add ur user-exit to your project. Then activate the FM which you require. Now go into that function module there will be a Include program wit name ZX* . Double click on it, it will ask to create an object, answer it Yes and then write your code in it. 
3. How do I find the output type of a table or a program?
Table TNAPR / NAST
More than 100 ABAP Interview Faq's
Content Author : Prbabu
Author email : prbabu9@yahoo.co.in
Feel free to contribute to those questions without answers or add-in additional tips for those answers which you think can be further improve by Submitting a ABAP Tips or ABAP Programs
1. What is the typical structure of an ABAP/4 program? 
ANS:-
   HEADER ,BODY,FOOTER.
2. What are field symbols and field groups.? 
    Have you used "component idx of structure" clause with field groups? 
ANS:-
    Field symbols:- 
    Field groups :-
3. What should be the approach for writing a BDC program? 
ANS:-
STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table CALLED "CONVERSION".
STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED "SAP DATA TRANSFER".
STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity)
         ii) create sessions (sessions are created and processed.if success data will transfer).
4. What is a batch input session? 
ANS:-
BATCH INPUT SESSION is an intermediate step between internal table and database table. 
Data along with the action is stored in session ie data for screen fields, to which screen it is passed,program name behind it, and how next screen is processed.
5. What is the alternative to batch input session? 
ANS:-
Call transaction.
6. A situation: An ABAP program creates a batch input session. 
    We need to submit the program and the batch session in back ground. How to do it? 
ANS:-
     go to SM36 and create background job by giving 
     job name,job class and job steps (JOB SCHEDULING) 
8. What are the problems in processing batch input sessions? 
    How is batch input process different from processing online? 
ANS:-
PROBLEMS:-
 i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains).  However if session is processed we may delete it manually.
ii)if session processing fails data will not be transferred to SAP database table.
10. What are the different types of data dictionary objects? 
ans:-
tables, structures, views, domains, data elements, lock objects, Matchcode objects.
11. How many types of tables exists and what are they in data dictionary? 
ans :-
4 types of tables
i)Transparent tables - Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.   Both Opensql and Nativesql can be used.
ii)Pool tables & iii)Cluster tables - 
These are logical tables that are arranged as records of transparent tables.one cannot use native sql on these tables
(only opensql).They are not managable directly using database system tools.
iv)Internal tables - .
12. What is the step by step process to create a table in data dictionary? 
ans:-
   step 1: creating domains(data type,field length,range).
   step 2: creating data elements(properties and type for a table 
field).
   step 3: creating tables(SE11).
13. Can a transparent table exist in data dictionary but not in the data base physically?
ANS:- NO.
TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE DICTIONARY AS WELL AS IN THE DATABASE,EXACTLY WITH THE SAME DATA AND FIELDS.
14. What are the domains and data elements? 
ANS:-
DOMAINS : FORMAL DEFINITION OF THE DATA TYPES.THEY SET ATTRIBUTES SUCH  AS DATA TYPE,LENGTH,RANGE.
DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT.
15. Can you create a table with fields not referring to data elements? 
ANS:- 
YES.  eg:- ITAB LIKE SPFLI.here we are referening to a data object(SPFLI) not data element.
16. What is the advantage of structures? How do you use them in the ABAP programs? 
ANS:-
Adv:- GLOBAL EXISTANCE(these could be used by any other program without creating it again). 
17. What does an extract statement do in the ABAP program? 
ANS:-
Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: 
EXTRACT <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
EXTRACT HEADER.
When you extract the data, the record is filled with the current values of the corresponding fields.
As soon as the system has processed the first EXTRACT statement for a field group <fg>, the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups <fg> and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs. 
By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.
18. What is a collect statement? How is it different from append? 
ANS:-
If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry. 
19. What is open sql vs native sql? 
ANS:- by Madhukar
Open SQL , native SQL are the interfaces to create the database applicatons.
Open SQL is consistant across different types of existing Databases.
Native SQL is the database language specific to database.Its API is specific to the databse.
Open SQL API is consistent across all vendors      
20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it? 
ANS:-
21. What is the meaning of ABAP/4 editor integrated with ABAP/4 data dictionary?
ANS:-
22. What are the events in ABAP/4 language? 
ANS:-
Initialization, At selection-screen,Start-of-selection,end-of-selection,top-of-page,end-of-page, At line-selection,At user-command,At PF,Get,At New,At LAST,AT END, AT FIRST. 
23. What is an interactive report? 
What is the obvious diff of such report compared with classical type reports? 
ANS:- 
An Interactive report is a dynamic drill down report that produces the list on users choice.
diff:-
a)  THE LIST PRODUCED BY CLASSICAL REPORT DOESN'T allow user to interact with the system
    the list produced by interactive report allows the user to interact with the system.
b)  ONCE A CLASSICAL REPORT EXECUTED USER LOOSES CONTROL.IR USER HAS CONTROL.
c)  IN CLASSICAL REPORT DRILLING IS NOT POSSIBLE.IN INTERACTIVE DRILLING IS POSSIBLE.
24. What is a drill down report? 
ANS:-
Its an Interactive report where in the user can get more relavent data by selecting explicitly.
25. How do you write a function module in SAP? describe. 
ANS:-
creating function module:-
called program - se37-creating funcgrp,funcmodule by assigning attributes,importing,exporting,tables,exceptions.
calling program - SE38-in pgm click pattern and write function name- provide export,import,tables,exception values.
26. What are the exceptions in function module? 
ANS:-
COMMUNICATION_FAILURE 
SYSTEM_FAILURE 
27. What is a function group? 
ANS:-
GROUP OF ALL RELATED FUNCTIONS. 
28. How are the date and time field values stored in SAP? 
ANS:-
DD.MM.YYYY.  HH:MM:SS 
30. Name a few data dictionary objects? //rep//
ANS:-
TABLES,VIEWS,STRUCTURES,LOCK OBJECTS,MATCHCODE OBJECTS.
31. What happens when a table is activated in DD? 
ANS:-
It is available for any insertion,modification and updation of records by any user.
32. What is a check table and what is a value table? 
Check table will be at field level checking.
Value table will be at domain level checking ex: scarr table is check table for carrid.
33. What are match codes? describe? 
ans:-
It is a similar to table index that gives list of possible values for either primary keys or non-primary keys.
34. What transactions do you use for data analysis? 
ANS:-
35. What is table maintenance generator? 
ANS:-
36. What are ranges? What are number ranges? 
ANS:-
    max,min values provided in selection screens.
37. What are select options and what is the diff from parameters? 
ANS:-
select options provide ranges where as parameters do not. 
SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges 
of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection table.
SELECT-OPTIONS <SEL> FOR <field>.
A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH. 
The type of LOW and HIGH is the same as that of <field>. 
The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply)
The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less 
than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern.
diff:-
PARAMETERS allow users to enter a single value into an internal field within a report. 
SELECT-OPTIONS allow users to fill an internal table with a range of values. 
For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing 
Goto - Text elements - Selection texts - Change. 
Eg:- Parameters name(30).
when the user executes the ABAP/4 program,an input field for 'name' will appear on the selection screen.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts.
38. How do you validate the selection criteria of a report? 
And how do you display initial values in a selection screen? 
ANS:-
validate :- by using match code objects.
display :- Parameters <name> default 'xxx'.
               select-options <name> for spfli-carrid.
39. What are selection texts? 
ANS:-
40. What is CTS and what do you know about it? 
ANS:-
The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape.
This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.
For practical information on working with the Change and Transport System, see Change and Transport Organizer and Transport Management System.
41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it? 
ANS:-
42. What is the client concept in SAP? What is the meaning of client independent? 
ANS:-
43. Are programs client dependent? 
ANS:-
    Yes.Group of users can access these programs with a client no.
44. Name a few system global variables you can use in ABAP programs? 
ANS:-
SY-SUBRC,SY-DBCNT,SY-LILLI,SY-DATUM,SY-UZEIT,SY-UCOMM,SY-TABIX.....
SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED.
45. What are internal tables? How do you get the number of lines in an internal table? 
How to use a specific number occurs statement? 
ANS:-
 i)It is a standard data type object which exists only during the runtime of the program.
They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
ii)using SY-DBCNT.
iii)The number of memory allocations the system need to allocate for the next record population.
46. How do you take care of performance issues in your ABAP programs? 
Performance of ABAPs can be improved by minimizing the amount of data to be transferred. 
The data set must be transferred through the network to the applications, so reducing the amount OF time and also reduces the network traffic.
Some measures that can be taken are: 
- Use views defined in the ABAP/4  DDIC (also has the advantage of better reusability).
- Use field list (SELECT clause) rather than SELECT *.
- Range tables should be avoided (IN operator)
- Avoid nested SELECTS. 
i)system tools
ii)field symbols and field groups.
ans:-
Field Symbols : Field symbols are placeholders for existing fields. A Field Symbol does not physically reserve space for a field,but points to a field which is not known until runtime of the program.
eg:-  FIELD-SYMBOL <FS> [<TYPE>]. 
Field groups :  A field group combines several fields under one name.At runtime,the INSERT command is used to define which data fields are assigned to which field group.
There should always be a HEADER field group that defines how the extracted data will be sorted,the data is sorted by the fields grouped under the HEADER field group.
47. What are datasets? 
ANS:-
The sequential files(ON APPLICATION SERVER) are called datasets. They are used for file handling in SAP.
48. How to find the return code of a statement in ABAP programs? 
ANS:-
Using function modules.
49. What are interface/conversion programs in SAP? 
ANS : 
CONVERSION : LEGACY SYSTEM TO FLAT FILE.
INTERFACE  : FLAT FILE TO SAP SYSTEM.
50. Have you used SAP supplied programs to load master data? 
51. What are the techniques involved in using SAP supplied programs? 
Do you prefer to write your own programs to load master data? Why? 
52. What are logical databases? What are the advantages/disadvantages of logical databases? 
ANS:-
To read data from a database tables we use logical database.
A logical database provides read-only access to a group of related tables to an ABAP/4 program.
adv:-
The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
i)An easy-to-use standard user interface.
ii)check functions which check that user input is complete,correct,and plausible.
iii)meaningful data selection.
iv)central authorization checks for database accesses.
v)good read access performance while retaining the hierarchical data view determined by the application logic. 
disadv:-
i)If you donot specify a logical database in the program attributes,the GET events never occur.
ii)There is no ENDGET command,so the code block associated with an event ends with the next event 
statement (such as another GET or an END-OF-SELECTION). 
53. What specific statements do you using when writing a drill down report? 
ans:-
AT LINE-SELECTION,AT USER-COMMAND,AT PF.
54. What are different tools to report data in SAP? What all have you used? 
ans:-
55. What are the advantages and disadvantages of ABAP/4 query tool? 
56. What are the functional areas? User groups? and how does ABAP/4 query work in relation to these? 
57. Is a logical database a requirement/must to write an ABAP/4 query? 
59. What are Change header/detail tables? Have you used them? 
60. What do you do when the system crashes in the middle of a BDC batch session? 
ans:-
we will look into the error log file (SM35).
61. What do you do with errors in BDC batch sessions? 
ANS:-
We look into the list of incorrect session and process it again. To correct incorrect session we analyize the session to determine which screen and value produced the error.For small errors in data we correct them interactively otherwise
modify batch input program that has generated the session or many times even the datafile.
62. How do you set up background jobs in SAP? What are the steps? What are the event driven batch jobs? 
ans:-
go to SM36 and create background job by giving job name,job class and job steps(JOB SCHEDULING)
63. Is it possible to run host command from SAP environment? How do you run? 
64. What kind of financial periods exist in SAP? What is the relavent table for that? 
65. Does SAP handle multiple currencies? Multiple languages? 
ans:-
Yes.
66. What is a currency factoring technique? 
67. How do you document ABAP/4 programs? Do you use program documentation menu option? 
68. What is SAPscript and layout set? 
ans:-
The tool which is used to create layout set is called SAPscript. Layout set is a design document.
69. What are the ABAP/4 commands that link to a layout set? 
ans:-
control commands,system commands,
70. What is output determination? 
71. What are IDOCs? 
ans:-
IDOCs are intermediate documents to hold the messages as a container.
72. What are screen painter? menu painter? Gui status? ..etc. 
ans:-
dynpro - flow logic + screens.
menu painter - 
GUI Status - It is subset of the interface elements(title bar,menu bar,standard tool bar,push buttons) used for a certain screen.
The status comprises those elements that are currently needed by the transaction.
73. What is screen flow logic? What are the sections in it? Explain PAI and PBO. 
ans:-
The control statements that control the screen flow.
PBO - This event is triggered before the screen is displayed.
PAI - This event is responsible for processing of screen after the user enters the data and clicks the pushbutton.
74. Overall how do you write transaction programs in SAP? 
ans:- 
Create program-SE93-create transcode-Run it from command field.
75. Does SAP has a GUI screen painter or not? If yes what operating systems is it available on? What is the other type of screen painter called? 
76. What are step loops? How do you program pagedown pageup in step loops? 
ans:-
step loops are repeated blocks of field in a screen.
77. Is ABAP a GUI language? 
ANS:-
Yes.
ABAP IS AN EVENT DRIVEN LANGUAGE.
78. Normally how many and what files get created when a transaction program is written? 
What is the XXXXXTOP program? 
ans:-
ABAP/4 program.
DYNPRO
79. What are the include programs? 
ANS:-
When the same sequence of statements in several programs are to be written repeadly they are coded in include programs (External programs) and  are included in ABAP/4 programs.
80. Can you call a subroutine of one program from another program? 
ans:-  Yes- only external subroutines Using 'SUBMIT' statement.
81. What are user exits? What is involved in writing them? What precations are needed? 
82. What are RFCs? How do you write RFCs on SAP side? 
83. What are the general naming conventions of ABAP programs? 
ANS:-
Should start with Y or Z.
84. How do you find if a logical database exists for your program requrements? 
ans:-
SLDB-F4.
85. How do you find the tables to report from when the user just tell you the transaction he uses? And all the underlying data is from SAP structures? 
ans:-
Transcode is entered in command field to open the table.Utilities-Table contents-display.
86. How do you find the menu path for a given transaction in SAP? 
ans:-
87. What are the different modules of SAP? 
ans:-
FI,CO,SD,MM,PP,HR.
89. How do you get help in ABAP? 
ans:-
HELP-SAP LIBRARY,by pressing F1 on a keyword.
90. What are different ABAP/4 editors? What are the differences? 
ans:-
91. What are the different elements in layout sets? 
ans:-
PAGES,Page windows,Header,Paragraph,Character String,Windows.
92. Can you use if then else, perform ..etc statements in sap script? 
ans:-
yes.
93. What type of variables normally used in sap script to output data? 
94. How do you number pages in sapscript layout outputs? 
95. What takes most time in SAP script programming? 
ANS:-
LAYOUT DESIGN AND LOGO INSERTION.
96. How do you use tab sets in layout sets? 
97. How do you backup sapscript layout sets? Can you download and upload? How? 
98. What are presentation and application servers in SAP? 
ANS:-
The application layer of an R/3 System is made up of the application servers and the message server. Application programs in an R/3 System are run on application servers. The application servers communicate with the presentation components, the database, and also with each other, using the message server.
99. In an ABAP/4 program how do you access data that exists on a presentation server vs on an application server? 
ans:-
i)using loop statements.
ii)flat 
100. What are different data types in ABAP/4? 
ans:-
     Elementary - 
          predefined C,D,F,I,N,P,T,X.
          userdefined TYPES.
 ex: see in intel book page no 35/65
     Structured - 
         predefined    TABLES.
         userdefined Field Strings and internal tables.
101. What is difference between session method and Call Transaction? 
ans:-
102. Setting up a BDC program where you find information from? 
ans:- 
103. What has to be done to the packed fields before submitting to a BDC session. 
ans:-
     fields converted into character type.
104. What is the structure of a BDC sessions. 
ans:-
      BDCDATA (standard structure).
105. What are the fields in a BDC_Tab Table. 
ans:-
      program,dynpro,dynbegin,fnam,fval.
106. What do you define in the domain and data element. 
Technical details like 
107. What is the difference between a pool table and a transparent table and how they are stored at the database level. 
ans:-
ii)Pool tables is a logical representation of transparent tables .Hence no existence at database level. Where as transparent tables are physical tables and exist at database level.
108. What is cardinality? 
For cardinality one out of two (domain or data element) should be the same for Ztest1 and Ztest2 tables. M:N
Cardinality specifies the number of dependent(Target) and independent (source) entities which can be in a relationship.