Sunday, May 18, 2008

sap abap program for A SAP Pop-out Calculator

A SAP Pop-out Calculator

* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
* 1000 abap faqs
* A Pop-out Calculator for the users
* Rajasekhar. P


call function 'FITRV_CALCULATOR'
* START_ROW = '10'

WRITE:/ 'Output Value ', X_VALUE.

*-- End of Program

Wednesday, May 14, 2008

IBM abap interview Questions phase - final 1


Name the reports, interfaces, transactions, sap script programs written? Explain the Functionality?

What is the typical structure of an ABAP/4 program?

Ans. = Declarative elements, Operational, control, events.

What are field symbols and field groups? Have you used “component idx of structure” clause with fields groups?

Ans.: place holder for existing fields similar to fields point to point

Groups. : Common several fields under one Name.

What should be the approach for writing a BDC program?

Ans.: 1. Analysis the Data. 2. Generate SAP structure. 3. Develop transfer program 4. Create sequential file. 5. Create batch input program. 6. Process batch input data

What is the alternative to batch input session?

Ans. : Call transaction & call dialog

A situation: An ABAP program creates a batch input session. We need to submit the program and the batch session in background. How to do it? (up to 3.1H)

Ans.: Run the session by RSBDCSUB explicitly by providing batch input session name Go to batch input, Double click on session name. It gives a pop up screen for run mode enters it and run.

What are the problems in processing batch input sessions? How is batch input process different from processing on line?

Ans.: Sessions cannot be run in parallel and not fast.

Name as many SAP Transactions as possible you are familiar with?

Ans. : SE38 - ABAP editor , SE80 – Object Browser , SE36 – logical databases

SE11 – ABAP data dictionary & SE16 SE37 – Function Module

What are the different types of data dictionary objects?

Ans : Tables – Data Elements – Domains - Structure – Foreign Keys

How many types of tables exist and What are they in data dictionary?

Ans : Transparent Tables - Pooled Tables – Cluster Tables

What is the step by step process to create a table in data dictionary?

Ans : Create Domain – Create Data elements – Create fields – Create Tables

Can a transparent table exist in data dictionary but not in the database physically?

Ans : Yes. (Tables in database have different structures, different names and total no. of tables in oracle database is smaller than transparent tables)

What are the domains and data elements?

Ans : domain describes Technical Characteristics of a table fields e.g. value range

Elements describe role played by a fields in technical contains e.g. Form of field text.

Can you create a table with fields not referring to data elements?

Ans : yes

What is the advantage of structures? How do you use them in the ABAP programs?

Ans: structure is used to define the construction of data produced when calculations are carried out within programs or when data is transferred between programs. Contain data at runtime only.

What does an extract statement do in the ABAP program?

Ans: Fills the fields groups with values.

What is a collect statement? How is it different from append?

Ans: Collect – does not allow duplicate keys and append adds a line even if it exists already.

What is open SQL v/s Native SQL?

Ans : Native SQL – used to include SQL stmt of RDBMS in ABAP/4 programs

Open SQL - subset of standard SQL with enhancements that are specific to SAP.

What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?

Ans: it allows us to execute a SQL stmt relevant to a particular database attached to SAP.

It is not transparent. (Disadvantage)

What is the meaning of ABAP/4 editor integrated with ABAP/4 Data dictionary?

Ans: the Graphical programming environment. We can write ABAP/4 code, control access to objects under development, create new or access predefined database information.

What are the events in ABAP/4 language?

Ans: Interactive reports - At line selection – At user-command – At PF-status

Classical reports - Top of page – end of page – start of selection – end of selection.

What is an interactive report? What is the obvious different of such report compared with HTML type report?

Ans: Features – Screen oriented – short basic lists – compressed data in basic list

Detailed information in secondary lists or windows.

What is drill down report?

Ans: A list which you create by selecting on characteristic value of a report and which contains detailed information about that value.

How do you write a function module in SAP? Describe.

Ans : using function <> function library : parameters , importing changing tables exporting

…. Exceptions.

End function

IBM abap interview Questions phase - final 2


What are the exceptions in a function module?

Ans: error situations that can occur within function modules EXCEPTION - return codes.


What is a function group?

Ans : A function group is the main program for the function modules it contains. Functions that use the same data are normally assigned to the same function group.


How are the date and time fields values stored in SAP?

Ans: As character fields of length 8 and 8 as NUMC.


What is a Julian date format?


Name a few data dictionary objects? Ans: Tables – Views – Structure – Domains – Data elements – Match codes – Lock objects – type groups.


What happens when a table is activated in DD?

-A table definition is generated - Map to the database system

-For each table, a table of the same name with the same fields and corresponding data type is created in database. – Primary index is generated automatically


What is a check table and what is a value table?

- When we define a foreign key in a table (A). If this key refers to primary key of another table (B). Table B is check table

- Fields referring to a domain may assume values contained in the corresponding fields of the value table. Field referring to the domain should have a foreign key


What are match codes? Describe.

- Tool that helps us to search data records in the system.


What transactions do you use for data analysis?



What is table maintenance generator?

- used to maintain tables and providing authorization for particular objects

1. One step maintenance

2. Two step maintenance


What are ranges? What are number ranges?

- A range of numbers that can be laid down for assignment of document numbers.

· Internal

· External


What are select options and what is the different from parameters?

- Select options are used to select a range of values where as in Parameters only one value can be given

- Select option generates a line on selection screen, the first part of which contains a text, followed by a range for input possibilities.


How do you validate the selection criteria of a report? And how do you display initial values in a selection screen?

- Validation - AT SELECTION-SCREEN event

- Initial Values – by default statement in select options / parameters


What are selection texts?

- Texts that appear on the selection screen for a particular field. Default – fields name.


What is CTS and What do you know about it? [ CTS is Correction and Transport Systems ]

- Correction system manages the internal system components like objects like only original version of the object exists. It stores all changes made to the object.

- Transport system allows to transports the object from on SAP system to another (Development system to Production system). It allows to over write or delete existing object in target system and import new objects to target systems.

- During development work we start by opening a task (correction) to which we can assign new and changed objects. Once changes have been made, transport new or changed objects to other SAP system by means of transport (Change) request.


When a program is created and need to be transported to production does selection texts always go with it? If no how do you make sure? Can you change the CTS entries? How do you do it?



What is client concept in SAP? What is the meaning of client independent?

- Client - A client is self contain unit in an R/3 system with separate master records in common tables(MANDT).

- Client independent – records and tables can be accessed from any client.


Are program clients dependent?

- No


Name a few system global variables you can use in ABAP program?



What are internal tables? How do you get number of lines in an internal table? How to use a specific numbers occur statement?

- Data structure that exists only at program runtime. Internal tables are one of two structured data types in ABAP. They can contain any number of identically structured rows, with or without a header line.

- Internal Tables are temporary tables which used to store values at run time no. of lines in Internal tables DESCRIBE TABLE ITAB LINES LIN.

- Use a Specific nos. OCCURS statement.


How do you take care of performance issues in your ABAP programs?

- Runtime Analysis


What are data sets?

- Sequential files in ABAP.


How to find the return code of a stmt in ABAP programs?



What are interface / Conversion programs in SAP?



Have you used SAP supplied programs to load master data?

- SAP supplied BDC programs – RM06BBI0 (Purchase requisitions)

- RMDATIND (Material master) RFBIKR00 (Vendor Masters)

- RFBIDE00 (Customer Master) RVINVB00 (Sales Order)


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

- Identify relevant fields

- Maintain transfer structure (Predefined – first one is always session record)

- Session record structure, Header Data, Item (STYPE – record type )

- Fields in session structure – STYPE, GROUP, MANDT, USERNAME, NO DATA

- Fields in header structure – consists of transaction code also – STYPE, BMM00, TCODE, MATNR and Fields in Item - ITEMS …

- Maintain transfer file – sample data set creation

- Transfer data by direct input.


What are logical databases? What are the advantages/disadvantages of logical databases?

Ans :- A Logical Database is a hierarchical structure of tables. Use the GET statement to process Logical Databases.

- LDB consists of logically related tables grouped together – used for reading and processing data.

- Advantages = 1. No need of programming for retrieval, meaning for data selection

- 2. Easy to use standard user interface, have check completeness of user input.

- Disadvantages = 1. Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.


What specific statements do you using when writing a drill down report?







What are different Tools to report data in SAP? What all have you used?



What are the Advantage and disadvantages of ABAP query tool?

- Advantages = no lengthy code

- Disadv. = Interactive lists drill reports are not possible and conditional reporting not possible.


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

- Functional areas = provide the user with a framework for defining a query quickly.

- Select a logical database from application system.

User groups = used to set up appropriate environment for the user or authorization for using query. By creating fun. Areas and assigning them to user groups. System administrator determines the range of reports the individual application depts. Or end users can generate using ABAP query.


Is a logical database a requirement / must to write an abap/4 query?

- Logical database is not a must for ABAP/4 query.


Have you created / maintained functional areas?

- No.


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

- The change header contains both fields that define and describe the change and administrative data on the change master. The administrative data is updated by the system.


What do you do when the system crashes in the middle of a BDC batch session?

-Check no. of records already updated and delete them from input file and run BDC again.


What do you do with errors in BDC batch session?

-Analysis and correct input file format and entries in internal table BDCDATA.


How do you set up background jobs in SAP? What are the steps? What are events driven batch jobs?

- Create a job using function module JOB-OPEN

- Collect the job specifications.

- Add a job step to the job with the function module JOB-SUBMIT.

- Close the job and pass it to Background processing system for execution with the function module JOB-CLOSE


- Types = System events – triggered when activation of new operation mode takes place

- User events - Triggered from ABAP/4 or external program.

- Triggering an event notifies the background processing that named condition has been reached. The Background system reacts by starting any jobs that were waiting for the event.

Transaction codes related to background jobs creation and processing are :-

SM36(Job creation)

SM37(Job selection and execution).


Is It possible to run host command from SAP environment? How do you run?



What kind of financial periods exist in SAP? What is the relevant Table for that?



Does SAP handle multiple currencies? Multiple Languages?

- Yes


What is currency factoring technique?



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




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.

- A layout set in SAP script 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.


What are the ABAP/4 Commands that link to a layout set?

- Call function OPEN-form.

- Call function WRITE-form.

- Call function CLOSE-form


What is output determination?


IBM abap interview Questions phase - final -3

What are IDOC’S (Intermediate Documents)?

Ans -1. SAP standard format for electronic data interchange between systems. Different message types (for example, delivery notes or purchase orders) usually have specific formats, the SAP IDoc types. However, several related message types can be assigned to one IDoc type. For example, the IDoc type ORDERS01 transfers the "logical" message type ORDERS (purchase orders) and ORDRSP (purchase order confirmation).

- 2. Features of an IDoc type, that is a business message with IDoc format (for example the confirmation XYZ).

IDocs can be used in the following business scenarios:

¨ ALE: communication between logical systems. Logical systems can be R/3, R/2 or non-SAP system. ALE distribution models are based on message types that indicate the appropriate IDoc types.

¨ EDI: communication between an R/3 or R/2 system and a non-SAP system.

What are Screen Painters? Menu Painter? GUI Status? …etc

- Screen Painters: - Arranging or creating elements of the screen.

- Menu Painters: - Designing and creating menu bar.

- GUI Status: - Interface between user and SAP program (PF STATUS).

What is screen flow logic? What are the selections in it? Explain PAI and PBO?

Ans - Screen flow logic contains the procedural part of a screen. The screen flow logic is like an ABAP program in that it serves as a container for processing blocks. There are four event blocks, each of which is introduced with the screen keyword PROCESS:





- Selections are performed in PAI.

- PROCESS BEFORE OUTPUT (PBO) is automatically triggered after the PAI processing of the previous screen and before the current screen is displayed. You can program the PBO processing of the screen in this block. At the end of the PBO processing, the screen is displayed.

- PROCESS AFTER INPUT (PAI) is triggered when the user chooses a function on the screen. You can program the PAI processing of the screen in this block. At the end of the PAI processing, the system either calls the next screen or carries on processing at the point from which the screen was called.

- PROCESS ON HELP-REQUEST (POH) and PROCESS ON VALUE-REQUEST (POV) are triggered when the user requests field help (F1) or possible values help (F4) respectively. You can program the appropriate coding in the corresponding event blocks. At the end of processing, the system carries on processing the current screen.

Overall how do you write transaction program in SAP?

- Create the transaction using object browser (SE80)

- Define the objects e.g. screen, Transactions. – Modules – PBO, PAI.

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

- Yes

- On what OS is it available – Window based.

- Other type of screen painter – alpha numeric screen painter.

What are step loops? How do you program page down page up in step loop?

- Step loops: Method of displaying a set of records.

- Page down & Page up: decrement / increment base counter

- Index = base + sy-step1 – 1

Is ABAP a GUI language?

- Yes

Normally how many and what files get created when a transaction program is written? What is top XXXXXXTOP program?

- Main program with A Includes


- II ) Include for PBO

- III) Include for PAI

- IV) include for Forms

What are Include Programs?

- Set of code which are included into the main program at runtime.

Can you call a subroutine of one program from another program?

- Yes

What are user exits? What is involved in writing them? What precautions are needed?

- User defined functionality included to predefined SAP standards. Point in an SAP program where a customer's own program can be called. In contrast to customer exits, user exits allow developers to access and modify program components and data objects in the standard system. On upgrade, each user exit must be checked to ensure that it conforms to the standard system.

¨ There are two types of user exit:

· User exits that use INCLUDEs.

These are customer enhancements that are called directly in the program.

· User exits that use tables.

These are used and managed using Customizing.

- Should find the customer enhancements belonging to particular development class.

What are RFC’S? How do you write RFC on SAP side?

Ans - Remote Function Calls. RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems. RFCs enable you to call and execute predefined functions in a remote system - or even in the same system. RFCs manage the communication process, parameter transfer and error handling.

- Any ABAP program can call a remote function using the CALL FUNCTION...DESTINATION statement. The DESTINATION parameter tells the SAP System that the called function runs in a system other than the caller's. RFC communication with the remote system happens as part of the CALL FUNCTION statement.

What are the general naming conventions of ABAP programs?

- Start with Z or Y followed by Char or Nos.

- 8 Letters long / 20 letters (4.0b onwards).

How do you find if a logical database exists for your program requirements?


- Get table command

- Table name – where used list – logical database

- Attribute

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 structure?

- Go to transaction. F1 and go to technical information.

How do you find the menu path for a given transaction in SAP?

- Go to dynamic menu, Give the search term i.e. transaction name

- SAP std menu – ABAP/4 workbench – Development / utilities.

What are the Different Modules of SAP?


What is IMG in SAP?

- Implementation guide containing all IMG, activities arranged by business application components.

How do you get help in ABAP?

- Place cursor on required field and press F1 or H keyword in command mode.

What are different ABAP/4 Editors? What are the differences?

- Command mode Editor (Not available in 4.6)

- PC Mode with line numbering

- PC Mode without Line numbering

What are different elements in layout sets?

- Paragraphs

- Character String

- Page

- Windows

- Page Windows

- Header Data

Can you use if then else, perform etc. statements in SAP Script?

- YES.

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 are presentation and application servers in SAP?

-A presentation server is actually a program named Sapgui.exe. It is usually installed on a user’s workstation.

- Application server is a set of executables that collectively interpret the ABAP/4 programs and manage the input & output for them.

In an ABAP/4 program how do you access data that exists on a presentation server v/s on an application server?

- For presentation server use UPLOAD or WS_UPLOAD function modules.

- For application server use OPEN DATASET, READ DATASET and CLOSE DATASET commands.

What are different data type in ABAP/4?

-There are eight predefined types in ABAP with fixed length:

Four character types:

Character (C), Numeric character (N), Date (D), and Time (T).

One hexadecimal type:

Byte field (X).

Three numeric types:

Integer (I), Floating-point number (F) and Packed number (P).

IBM abap interview Questions phase - A

Memory Management


How to use the new two-part roll area?

- Some data must be held in roll area and must be rolled into and out of work processes. Roll area must not drop below a minimum size. In two part roll area implementation, you can limit amount of data in roll area before extended memory is used remaining portion of roll area is used only if no further extended memory can be allocated to a user context.



What is a dictionary?

- Dictionary contains Meta data or information for the data in data management system.

- It supports redundancy free data storage and data integrity.


Primary Key – field or combination of fields used to uniquely identify a row of the table


Foreign Key - Combination of fields in a table acting as a primary key in another table.


Difference between structure and a Table ?

Ans - Using tables, data can be stored permanently in Database, and Structures contain no data.


Define Structures ?

Ans - Structures are used for example in ABAP programs to define internal tables or to define the type of the interface parameters of function modules.


Table attributes – Determine who is responsible for maintaining the table and which type of access is allowed for the table e.g.: Delivery class – table maintained by sap or customer.

Table maintenance allowed – Table entries accessed using std table maintenance.

Activation Type – Whether table can be activated directly from ABAP/4 dictionary or whether the runtime object must first be generated by c program.


Database Utility – Interface between ABAP/4 Dictionary and the database.


Data Elements – Describe the role played by a field in technical context. Fields of same semantic meaning refer same data elements.


Domain – describe technical characteristics of a table field. It specifies the value range, which describes allowed values for a field.


Index – Copy of database table reduced to specific fields

Function – speed up scanning of table for data records satisfying a given search criteria.


Foreign key Table – Table which contains the foreign key. E.g. ZEMP table.


Check Table – Table which has foreign key of another table as its primary key e.g. DEPT.


Cardinality – N: M indicates how many dependent record or referenced records.


View :- used to summarize data distributed among different tables type of views


Types of Views

1 Database – created in database (read only)

2 Projection - used to suppress the display of table fields (all operations possible)

3 Help views – Display information in online help system

- 4 Maintenance views – used to realize commercially relevant views on data customizing vies business oriented approach to looking at data


Views that cannot be used to create new views

- Structure views – used to generate a structure from several logically connected tables

- Entity views – used to represent entity type of Data Modular on tables of ABAP/4 dictionary


Maintain Status – Determine if records can only be read or if it is also possible to change them.


Match codes – tool to help you search for data records in the system


Match codes object – describes the set of all possible search paths for the search term.


Match codes Id – describes a special search path for a search term.


Match codes

- fields from several tables

- built on the basis of transparent tables, clusters and pools

- restricted by stipulating selection conditions

- use as entry aids

Database index

- fields from only table


Lock Objects – simultaneous access of records by two users synchronized by lock objects.


Activation – During activation, the runtime object of aggregate object or tables is created. The runtime object is buffered so that the application program can access it quickly. Runtime object has information about the following objects of table

- domain – data elements – field definition – table definition

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)


Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials