75
SAP ABAP INTERVIEW QUESTIONS…. 1. What are the layers of data description in R/3? The external layer The ABAP/4 layer The database layer 2. Define external layer? The external layer is the plane at which the user sees and interacts with the data, that is, the data format in the user interface. This data format is independent of the database system used. 3. Define ABAP/4 layer? The ABAP/4 layer describes the data formats used by the ABAP/4 processor. 4. Define Database layer? The database layer describes the data formats used in the database. 5. What is a Data Class? The Data class determines in which table space the table is stored when it is created in the database. 6. What is a Size Category? The Size category describes the probable space requirement of the table in the database.

ABAP IQs

Embed Size (px)

DESCRIPTION

ABAP interview questions

Citation preview

Page 1: ABAP IQs

SAP ABAP INTERVIEW QUESTIONS….

1. What are the layers of data description in R/3?

The external layerThe ABAP/4 layerThe database layer

2. Define external layer?

The external layer is the plane at which the user sees and interacts with the data, that is, the data format in the user interface. This data format is independent of the database system used.

3. Define ABAP/4 layer?

The ABAP/4 layer describes the data formats used by the ABAP/4 processor.

4. Define Database layer?

The database layer describes the data formats used in the database.

5. What is a Data Class?

The Data class determines in which table space the table is stored when it is created in the database.

6. What is a Size Category?

The Size category describes the probable space requirement of the table in the database.

7. How many types of size categories and data classes are there?

There are five size categories (0-4) and 11 data classes only three of which are appropriate for application tables:

APPL0- Master Data (data frequently accessed but rarely updated).

APPL1- Transaction data (data that is changed frequently).

Page 2: ABAP IQs

APPL2- Organizational data (customizing data that is entered when system is configured and then rarely changed).

What are control tables?

The values specified for the size category and data class are mapped to database-specific values via control tables.

What is the function of the transport system and workbench organizer?

The function of the transport system and the Workbench Organizer is to manage any changes made to objects of the ABAP/4 Development Workbench and to transport these changes between different SAP systems.

What is a table pool?

A table pool (or pool) is used to combine several logical tables in the ABAP/4 Dictionary. The definition of a pool consists of at least two key fields (Tabname, Varkey) and a long argument field (VARDATA).

What are pooled tables?

These are logical tables, which must be assigned to a table pool when they are defined. Pooled tables can be used to store control data (such as screen sequences or program parameters).

What is a table cluster?

A table cluster combines several logical tables in the ABAP/4 Dictionary. Several logical rows from different cluster tables are brought together in a single physical record. The records from the cluster tables assigned to a cluster are thus stored in a single common table in the database.

How can we access the correction and transport system?

Each time you create a new object or change an existing object in the ABAP/4 Dictionary, you branch automatically to the Workbench Organizer or correction and transport system.

Which objects are independent transport objects?

Page 3: ABAP IQs

Domains, Data elements, Tables, Technical settings for tables, Secondary indexes for transparent tables, Structures, Views, Match code objects, Match code Ids, Lock objects.

How is conversion of data types done between ABAP/4 & DB layer?

Conversion between ABAP/4 data types and the database layer is done within the database interface.

How is conversion of data types done between ABAP/4 & external level?

Conversion between the external layer and the ABAP/4 layer is done in the SAP dialog manager DYNP.

What are the Data types of the external layer?

ACCP, Char, CLNT, CUKY, CURR, DATS, DESC, FLTP, INT1, INT2, INT4, LANG, LCHR, LRAW, NUMC, PREC, QUAN, RAW, TIMS, UNIT,VARC.

What are the Data types of the ABAP/4 layer?

Possible ABAP/4 data types:

C: Character.

D: Date, format YYYYMMDD.

F: Floating-point number in DOUBLE PRECISION (8 bytes).

I: Integer.

N: Numerical character string of arbitrary length.

P: Amount of counter field (packed; implementation depends on h/w platform).

S: Time Stamp YYYYMMDDHHMMSS.

V: Character string of variable length, length is given in the first two bytes.

X: Hexadecimal (binary) storage.

How can we set the table spaces and extent sizes?

You can specify the extent sizes and the table space (physical storage area in the database) in which a transparent table is to be stored by setting the size category and data class.

Page 4: ABAP IQs

What is the function of the correction system?

The correction system manages changes to internal system components. Such as objects of the ABAP/4 Dictionary.

What are local objects?

Local objects (Dev class$TMP) are independent of correction and transport system.

What is a Development class?

Related objects from the ABAP/4 repository are assigned to the same development class. This enables you to correct and transport related objects as a unit.

What are the features of ABAP/4 Dictionary?

The most important features are:

Integrated to an ABAP/4 Development Workbench.

Active in the runtime environment.

What are the basic objects of the data dictionary?

Tables, Domains, Data elements, Structures, Foreign Keys.

What are the aggregate objects in the data dictionary?

Views, Match codes, Lock objects.

In the ABAP/4 Dictionary Tables can be defined independent of the underlying database (T/F). True.

ABAP/4 Dictionary contains the Logical definition of the table.

Page 5: ABAP IQs

What is the max number of structures that can be included in a table or structure? Nine.

A field containing currency amounts (data type CURR) must be assigned to a reference table and a reference field. Explain.

--->As a reference table, a system containing all the valid currencies is assigned or any other table, which contains a field with the currency key format. This field is called as reference field. The assignment of the field containing currency amounts to the reference field is made at runtime. The value in the reference field determines the currency of the amount.

A field containing quantity amounts (data type QUAN) must be assigned to a reference table and a reference field. Explain?

As a reference table, a system table containing all the valid quantity units is assigned or any other table, which contains a field with the format or quantity units (data type UNIT). This field is called as reference field. The assignment of the field containing quantity amounts to the reference field is made at runtime. The value in the reference field determines the quantity unit of the amount.

What is the significance of Technical settings (specified while creating a table in the data dictionary)?

By specifying technical settings we can control how database tables are created in the database. The technical setting allows us to (1) optimize storage space requirements. (2) Table access behavior.(3) Buffering required. (4) Changes to entries logged.

What is a Table attribute?

The table’s attributes determine who is responsible for maintaining a table and which types of access are allowed for the table. The most important table attributes are:Delivery class. Table maintenance allowed. Activation type.

What are two methods of modifying SAP standard tables?

Append Structures and Customizing Includes.

What are the two ways for restricting the value range for a domain?

By specifying fixed values and by stipulating a value table.

Page 6: ABAP IQs

To how many tables can an append structure be assigned? One.

What is the significance of Delivery Class?

The delivery class controls the degree to which the SAP or the customer is responsible for table maintenance. Whether SAP provides the table with or without contents. Determines the table type. Determines how the table behaves when it is first installed, at upgrade, when it is transported, and when a client copy is performed.

If a table that is to be extended contains a long field, we cannot use append structures why?

Long fields in a table must always be located in the end, as the last field of the table. If a table has an append structure the append line must also be on the last field of the table.

Can we include customizing include or an append structure with Pooled or Cluster tables? No.

What are base tables of an aggregate object?

The tables making up an aggregate object (primary and secondary) are called aggregate object.

The data of a view is not physically stored, but derived from one or more tables? True.

Structures can contain data only during the runtime of a program (T/F) True.

What is a Match Code?

Match code is a tool to help us to search for data records in the system. Match Codes are an efficient and user-friendly search aid where key of a record is unknown.

What are the two levels in defining a Match Code?

Match Code Object and Match Code Id.

Page 7: ABAP IQs

What is the max no of match code Id’s that can be defined for one Match code object?

A match code Id is a one character ID that can be a letter or a number.

Can we define our own Match Code ID’s for SAP Match codes?

Yes, the number 0 to 9 are reserved for us to create our own Match Code Ids for a SAP defined Match code object.

Can match code object contain Ids with different update types? Yes.

What are the update types possible?

The following update types are possible:

Update type A: The match code data is updated asynchronously to database changes.

Update type S: The match code data is updated synchronously to database changes.

Update type P: The match code data is updated by the application program.

Update type I: Access to the match code data is managed using a database view.

Update type L: Access to the match code is achieved by calling a function module.

Can you delete a domain, which is being used by data elements? No.

Can you delete data element, which is being used by table fields? No.

What are the two different ways of building a match code object?

A match code can be built in two different ways:

Logical structure: The match code data is set up temporarily at the moment when the match code is accessed. (Update type I, L).

Physical Structure: The match code data is physically stored in a separate table in the database. (Update types A, S, P).

Page 8: ABAP IQs

What are the differences between a Database index and a match code?

Match code can contain fields from several tables whereas an index can contain fields from only one table. Match code objects can be built on transparent tables and pooled and cluster tables.

What is the function of a Domain?

A domain describes the technical settings of a table field.

A domain defines a value range, which sets the permissible data values for the fields, which refers to this domain. A single domain can be used as basis for any number of fields that are identical in structure.

What are conversion routines?

Non-standard conversions from display format to sap internal format and vice-versa are implemented with so called conversion routines.

What is the function of a data element?

A data element describes the role played by a domain in a technical context. A data element contains semantic information.

What is one step, two steps in Table Maintenance Generator?

This specifies the screens to be created in the Table Maintenance Program. Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records. Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.

What is a view?

A view is a logical view on one or more tables. A view on one or more tables i.e., the data from a view is not actually physically stored instead being derived from one or more tables.

Can a domain, assigned to a data element be changed?

Yes. We can do so by just overwriting the entry in the field domain.

Page 9: ABAP IQs

Can you define a field without a data element?

Yes. If you want to specify no data element and therefore no domain for a field, you can enter data type and field length and a short text directly in the table maintenance.

What are null values?

If the value of a field in a table is undefined or unknown, it is called a null value.

What is the difference between a structure and a table?

Structures are constructed the almost the same way as tables, the only difference using that no database table is generated from them.

How many types of Views are there?

Database View, Help View, Projection View, Maintenance View

What is locking?

When two users simultaneously attempt to access the same data record, this is synchronized by a lock mechanism.

What is database utility?

Database utility is the interface between the ABAP/4 Dictionary and the underlying the SAP system.

What are the basic functions of Database utility?

The basic functions of database utility are:

Create database objects.

Delete database objects.

Adjust database objects to changed ABAP/4 dictionary definition.

Page 10: ABAP IQs

What is Repository Info. Systems?

It is a tool with which you can make data stored in the ABAP/4 Dictionary available.

Which field differentiates a table from client-dependent and client-independent?

The MANDT field of the table specifies whether the table is client independent or not.

What are the different types of Views?

Projection view - Just retrieves some fields from a single table.

Help View - This is used for search help.

Database View - This is inner join view of one or more tables

Maintenance View - Helps in creating maintaining data of the application object. The data can be distributed among several tables.

Can I use all the views in the ABAP program ?

No. You can use only projection view or database view in your ABAP program.

When I create new entries in the table the field values are always in Uppercase. How do I get the data with mixed case?

The reason for this is that the Domain for the field in the table might have Lowercase checkbox unchecked. Check the Lowercase checkbox to preserve the case of your data.

What is parameter id in data elements ?

If you are calling a transaction and passing a value from your program to that transaction,you need parameter id. Parameter Id is the one which holds the memory for the particular field when we need to pass the field from one screen to another use the parameter Id. The SAP Memory is a user-specific memory area of the application server, which is accessed by all main sessions of a user session at once. ABAP programs have access to SPA/GPA parameters stored in the SAP Memory (also called SET/GET parameters). E.g. Of how to use Set parameter

you can give value of variable (dobj) to parameter ID 'pid'. This will store value in SAP memory

SET PARAMETER ID pid FIELD dobj.

Page 11: ABAP IQs

When you want to use that value stored in SAP memory .You can use GET parameter.

GET PARAMETER ID pid FIELD dobj.

How many MAIN windows are allowed for SAPscript?

SAPscript allows for 99 MAIN windows

What is interactive reporting?

With the use of interactive reporting we can be present in an active mode at the data presentation in a session. Actually interactive reporting generates a simple list that encapsulates the details, it can be extended and we can see the details with the aid of the cursor or commands. Interactive reporting lowers the amount of retrieved details to the real requirement of data.

Which are the event key words used in interactive reporting?

AT LINE-SELECTION-this is a time when we choose a line with a double-click on the line or by moving the cursor over the line and hitting F2. AT USER-COMMAND- this is a time when we hit a function key. TOP-OF-PAGE DURING LINE-SELECTION-this is a time when, while the list is processing a secondary list, a new page is starting.

What is the usage of GET CURSOR and SET CURSOR?

GET CURSOR LINE and GET CURSOR FIELD are statements that we use to transfer an output field and an output line where, in the time of the interactive event the cursor was placed. Example of syntax: GET CUROSR FIELD [OFFSET] [LINE] [VALUE] [LENGTH]. SET CURSOR is a statement used to set the cursor the latest list made which when we make a basic or main list, the latest will be exactly this one: the basic list. The basic list will become previous when we make a secondary list. The set cursor statement also places the cursor on the column that is on the output window’s line.

What is the role of the READ LINE and READ CURRENT LINE statements?

These statements are used for reading the current list level data lines explicitly and they are linked together with the technique named HIDE.

1. Can we write the code both call transaction and session method in single program?

Page 12: ABAP IQs

Ans. Yes it is possible to write call transaction and session in one program.

2. Which BDC you prefer?

Ans. If we want to transfer large amount of data and when we need to use more than one transaction code we prefer session method. For small or less amount of data and for single transaction use call transaction.

3. When u prefer LSMW?

Ans :- When we need to update medium amount of data we use LSMW. LSMW is also used when the person like functional consultant has less programming language.

5. Difference between .include and .append?

Ans. Include structure allows you to add one or more structure into structure or table. Also placed positioning anywhere up to 6 include structure can be used in a table.

Append structure can be placed only at the end of a structure or table which also stops further insertion of fields. Only one append structure can be used.

6. Performance techniques

Ans.

1. The sequence of fields must be same as per database table

2. During writing select query write all fields in sequence as per database table.

3. Never write select statements inside loop….endloop.

4. Use st05 SQL trace, se30 run time analysis, code inspector, slin,etc.

5. Use select single * statement instead of select *

6. Always use primary key

7. Use binary search but before using binary search sort that table.

7. How to debug sapscripts ?

Ans.

Page 13: ABAP IQs

Two ways to debug sapscript . first way is goto SE 71 and from menu bar select Utilities->activate debugger .then goto SE38 execute the print program ,it automatically goes to debugging mode.

the other way is , run the program RSTXDBUG in se 38 . execute it . a message will show that debugger is activated .now open the print program in se 38 …u vll notice that the print prgm is automatically diverted to debugging mode.

10. What is occurs in internal table?

Ans. Occurs addition to the Declaration will give initial size to that table. Generally occur statement allocates 8kb of memory to the internal table.

11. What is page window?

Ans : page window is nothing but a container of a page ,which uniquely identifies a set of data …for example while creating invoice .we create logo window , billing document header window , customer window , terms and condition window etc.

12. What is the difference between scrolling a table horizontally and vertically..??

Ans: In table control when you scroll a table vertically presentation server needs to call application server to fetch the next record and display in the table while in case of horizontal scroll there is no need to call application server.

13. What are Field Groups?

Ans: A group that combines several fields fewer than one name, at runtime, the INSERT command is used to define which data fields are assigned to which field group are called Field Groups. It should always be a HEADER field group that defines how the extracted data will be sorted; the fields grouped under the HEADER field group sort the data.

14. List the events in ABAP/4 Language?

Ans: The events in ABAP/4 are load of program, Initialization, Selection Screen, Start of Selection, End of Selection, Top of page, Line selection, User command, End, First.

15.How the values will be passed to RFC Function module Pass by Value or Pass by reference?

Page 14: ABAP IQs

Ans: always Pass by Value.

RFC is Remote Function call so it can’t access the values with Pass by reference.

16. Buffering concept usage?

Ans: There are three type of buffer

1 single record 2 generic buffer 3 full buffer

Buffering is use for improve performance. it improves performance 10 to 100 times more

17. Select up to 1 row and select single difference ?

Ans: Select single fetches first matching record. If more than one matching records are there then only the first matching record will be considered other records will not be taken into account. Where as select up to 1 rows will fetch all the matching records from the database.(Again it will assign only One Record to the internal table/Work area)

18. What is concept of buffering?

Table buffering is used to reduce database load and improves the performance when accessing the data records contained in the database table. The 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.

The options for selecting the Buffering

1. Buffering not allowed

Table is not required to buffer.

2. Buffering allowed but not activated

For a database table buffering is allowed, but at that point of moment buffering should not be active.

3. Buffering allowed if the table should be buffered.

Table should be specified by a buffering type.

Buffering Types:

1. Full buffering : In this buffering type, complete table or none of the table is

in the buffer. If a read access is made to a record, all records of

Page 15: ABAP IQs

the table are transferred to the buffer.

2. Generic buffering : This buffering type is part of the primary key of a table.

When a table record is read, this buffer type loads all records

that correspond with the generic key.

3. Single- record buffering : In this buffering type, only the records of a table which are

actually accessed are loaded into the buffer.

19. Different types of locks?

Read lock (shared lock)

Protects read access to an object. The read lock allows other transactions read access but not write access to the locked area of the table.

Write lock (exclusive lock)

Protects write access to an object. The write lock allows other transactions neither read nor write access to the locked area of the table.

Enhanced write lock (exclusive lock without cumulation)

Works like a write lock except that the enhanced write lock also protects from further accesses from the same transaction.

20. CHAIN END CHAIN?

Ans: Chain and end chain are used for multiple field validation in Module pool programming .It is written inside the screen flow logic.

22. Why sap scripts are client dependent and smart forms are client independent?

Ans-: Smart forms create its own function module so it doesn’t need to transport the request through SCC1.As all the Development Object are stored in client independent tables. Whereas Script doesn’t generate any function module while executing so we need to transport the request number through SCC1.Sap script is stored inside the client depended table as a TEXT so sap scripts are client dependent and smart forms are client independent.

Page 16: ABAP IQs

24. Control break events in ABAP:-

1. AT-FIRST: This is used when we want to execute the statements before records are processed.

2. AT-LAST: This event is used when we want to execute the statements after all records are processed.

3. AT-NEW: This event is used when we want to execute the statement before group of records are processed.

4. AT-END: This event is used when we want to execute the statements after processing of group of records.

26. Suppose i am writing following code then what will be output?

LOAD-OF-PROGRAM.

WRITE:/”HELLO”.

Ans: HELLO

(Explain the importance of LOAD-OF-PROGRAM Event. If you don’t know Tell the interviewer as this event is used in such cases when you want to clear sum buffers or something Before calling that Program)

27. What is TMG?

Ans. TMG stands for Table Maintenance generator. It is a tool available in abap by which we can add or delete multiple records at a time and it is executed or triggered by the transaction code SM30.

28. Difference between select option and ranges ?

Ans. The main difference between select option and ranges is that ranges implicitly or automatically creates internal table with fields like OPTION,LOW,HIGH,SIGN,etc . Where as in case of select option we have to explicitly create internal table.

When u declares a select options it will implicitly declare an internal table (ranges) for you.

While using RANGES syntax u can declare internal table explicitly.

The only need of declaring ranges is when you r not taking input from the user but you want make limit based selection at that time it will be use full e.g. SELECT ** from ** where MATNR in val_range.

Here u can use select-option or ranges : val_range.

Page 17: ABAP IQs

29. is it possible to bring select option in module pool screens?

Ans. Create a SELECT-OPTION in module pool screen using two methods as shown.

Method 1:—

a) Create a sub screen area in your screen layout where you want to create the select options.

b) In the top include of your module pool program declare a selection screen as a sub screen e.g.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

select-options s_matnr for mara-matnr.

SELECTION-SCREEN END OF SCREEN.

c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).

CALL SUBCREEN sub_area INCLUDING <program> <screen>

This CALL SUBSCREEN statement is necessary for transport of values between screen and program.

Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.

Method 2:——-

a) Create 2 separate fields in your screen layout – one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.

struc_tab_and_field-fieldname = con_cust. ” ‘KUNNR’

struc_tab_and_field-tablename = con_kna1. ” ‘KNA1′.

CALL FUNCTION ‘COMPLEX_SELECTIONS_DIALOG’ EXPORTING*

TITLE = ‘ ‘

text = g_titl1 ” ‘Customers’

tab_and_field = struc_tab_and_field

TABLES RANGE = rng_kunnr

EXCEPTIONS

NO_RANGE_TAB = 1

Page 18: ABAP IQs

CANCELLED = 2

INTERNAL_ERROR = 3

INVALID_FIELDNAME = 4

OTHERS = 5.

IF NOT rng_kunnr[] IS INITIAL.

* Read the very first entry of the range table and pass it to

* dynpro screen field

*READ TABLE rng_kunnr INDEX 1.

IF sy-subrc = 0.

g_cust = rng_kunnr-low.

ENDIF.

ENDIF.

You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.

30. How we can retrieve data using secondary index, explain with simple example

Ans: First create secondary indexes on required fields of a particular database table.

We can create one primary index and 15 secondary indexes. Once the respective secondary indexes are created write select queries and within select queries specify secondary indexes field name with where clause.

31. How can we handle table control in BDC?

Ans. We can handle table control using line index

Line index indicates which line of Table control is to be use for BDC transaction

Ex - perform bdc_field using ‘RC29K-AUSKZ(01)’

Indicates 1st line of table control is going to be used for transaction which is Line index of Table Control

Page 19: ABAP IQs

32. If i want to execute a BDC program only in background not in foreground is there any option for this?

Ans. The sm37 transaction can be used for running a program in the background. Also in the session method while processing the session you can specify the processing type as background or foreground.

33. How can we upload a text file having Delimiters in to Legacy System?

Ans. For uploading text file we use the pre-defined FM gui_upload in that FM we have the parameter has_field_seperator for that we assign the default delimiter ‘x’.

HAS_FIELD_SEPERATOR ‘X’

‘X’ can provide whatever delimiter we used in flat file for separation.

34. What is the land scape in sap?

Ans. In every organization sap landscape involves three servers i.e. Development server, Quality server and Production server. Whatever new development we do as per clients requirement is done in development server. Later to test the developed object we move it to quality server for testing and finally once everything goes clear then the object is moved to production server, production server data is ready for final business use.

35. Workbench request are client dependent or client independent

Ans. Workbench request are client independent.

36. Tell me about workbench request and customization requests.

Ans. Workbench (ABAP Dev) request is client independent when you import it into one system it reflect it in all client in same system, but customized request has to import in that particular client where it is created, actually it is client dependent.

Difference BETWEEN

1. sap script and smart forms

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

Page 20: ABAP IQs

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 customized 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.

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 its 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 output 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

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

Page 21: ABAP IQs

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.

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

PBO will be called before the screen is displayed to the user while process after input is called once user interacts with screen.

19. Stop, check and exit

Page 22: ABAP IQs

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 <expression> statement within an event block but not within a loop, and the Condition < expression > is not fulfilled, the system exits the processing block immediately.

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 insert new line. Instead, it adds the values from the numeric fields of the work area <line> to the values 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 all lines of the current control level and writes the results to the corresponding fields in the work area.

23. Call transaction and session method in BDC.

Ans: 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.

25. Enhancement point and Enhancement Section

Page 23: ABAP IQs

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.

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 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 is used to store transaction data. It’s having 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. It’s 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. It’s also many to one relation table.

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.

Page 24: ABAP IQs

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. By Default you can open 9 internal sessions.

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.

40. Sap script smart forms and adobe forms

Sap script is client dependent whereas smart form is client independent.

Main window is compulsory in scripts whereas main window not compulsory in form.

Smart form output can be seen in web while in scripts it is not possible.

smart form generates function module while scripts don’t generate function module.

Page 25: ABAP IQs

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.

43. What is the difference between INSERT and MODIFY?

Whenever you need to create new records in the database table use INSERT statement. Whenever using INSERT be sure that a duplicate entry having the same values for the primary key fields are not present. Else it may throw a dump. When you use MODIFY it makes a check for the matching key field values. If present it modifies the matching record, else it creates a new record in the database table.7

44. What is the difference between Check Table and Value Table?

The Check Table is the dependent table to which the relationship is defined using foreign keys. The contents of the check table field are shown in the input help for the referenced field. The Value table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not used in the Input Help.

45. What is the difference between Domain and Data Elements?The Domain specifies the Technical attributes of the field such as the data type, length and the value range. The data element is an elementary type defining the description/text for the field when displaying on the screen and Parameter ID.

Questions on internal tables

Q1: What is the meaning of Data Clusters?

A1: Data clusters are the way in which every type of complex internal data objects from an application in ABAP/4 are grouped. They are also deposited in the memory of BAP/4 for a limited period of time or in databases for a longer time. The databases of this type have the name accordingly, they are named cluster databases and their construction is predefined. This type of depositing data clusters is a particular feature of ABAP/4. With the aid of SQL statements it is possible to enter cluster databases and the data clusters that have been deposited in ABAP/4 can be decoded only by ABAP/4.

Page 26: ABAP IQs

Q2: What is the meaning of these terms in SAP: application server and presentation server?

A2: An application server manages the output /input of ABAP/4 programs and interprets them. Application servers are groups of executables. Presentation servers are programs from the workstations of users that are called like this: Sapgui.exe.

Q3: In what way are Get and SET different?

A3: GET PARAMETER IF FIELD: The value deposited in ID is met in the variable by the statement, if a value is not found in SAP memory, the system configures SY-SUBRC to 4, in a different case is 0. SET PARAMETER ID FIELD: The field contents from ID are stored in SAP memory in a code with up to 20 characters in length. If a value is found there already it will be overwritten, if there is no ID we have to make a new parameter object by double-clicking the ABAP Editor.

Q4: What is the meaning of Field group, extract data set?

A4: Extract data sets are made of records sequences, we can have various structures for the records, record types are in fact a group of records that have the same structure. Every record type that an extract dataset has can be defined as a field group with the statement FIELD GROUPS. The FIELD GROUPS statement brings multiple fields together with providing one single name. Usually we should declare the field groups when the declaration part in a program is finished, this will make everything clearer. Field groups don’t generate field space but they show the fields that already exist, they show us the records content if the records are met in the extract dataset.

Q5: What is the way for accessing data that is found on an application server and on a presentation server in ABAP/4?

A5: We will have to make use of these modules: UPLOAD or WS_UPLOAD for the presentation server and OPEN DATASET, CLOSE DATASET, READ DATASET for the application server.

Q11: At the creation of internal tables what is the criteria configuration of the value of an occurs?

A11: What we have to do for configuring the value of an occurs is to make optimizations and for this we have to keep in mind some things like:

a) The default declared size will be maintained in the roll area – faster program access.

b) The whole data area of the application will be 64 kilobytes.

Page 27: ABAP IQs

c) The data inserted that is bigger than the default size is deposited in the roll file- the program is accessed slowly.

More, prior to deciding to do an optimization we have to analyze the rates of access and the volume.

Q12: What is the syntax and function used for command AUTHORITY CHECK?

A12: Syntax: AUTHORITY=CHECK OBJECT

IF SY-SUBRC NE 0. The verification for authorization from the user part for starting a specific action is made by AUTHORITY CHECK.

Q13: What are the details regarding the debugger screen functions?

A13: Single step or F5 is an option that can be used to go through a program by every statement, in the function modules and subroutines that will run also step by step. After the processing of every function module or subroutine with the aid of the statements CALL FUNCTION and PERFORM the control can go back at the statement. Execute or F6 is an option for running a program with every line, so in a single line the statements will be processed all at once. When we use Execute and we are on a line invoking a subroutine, the entire subroutine will be processed and it will go to the line with the subroutine invoking, and we can go from statement to statement inside the subroutine. Return or F7: When control is going back to the main program, also the debugger will go back there from the subroutine. Return is an option that is good for going back to the invoking program from a subroutine, invoked program or function module. Continue or F8 is an option good for processing the program up to the following dynamic or static breakpoint or the location of the cursor. When the breakpoints don’t exist anymore and there is no cursor, the remaining part of the program will be processed normally and the system will go out of the debugging mode.

Q14: What is the role of the following commands: IMPORT and EXPORT? When we use IMPORT what is the way for passing multiple data groups?

A14: IMPORT: The statement used or reading the data objects from the memory into a program in ABAP/4 has this syntax: IMPORT … FROM MEMORY ID. The data objects that are read are found in a memory cluster in the form of a list. Without the option TO the same name will be found at assigning the data object from the memory to the one from the application. In this case the data object will be read in the field from memory and the memory cluster will be seen by the name, which can be of a maximum of 32 characters in length. We don’t really have to read every object that was deposited on a specific name; the object count can be restricted by the names of the objects. When on a specific name in the memory there are no objects then SYSUBRC will be four. In another case when the name from memory has a data cluster then SY-SUBRC will be 0 no matter if neither there is nor a data object contained.

Page 28: ABAP IQs

EXPORT: The statement and syntax used for reading A data object from the program into memory in ABAP/4 is: EXPORT … TO MEMORY ID. A cluster in the memory is where the data objects are deposited in form of a list, when FROM is not used the data object will be stored in the name of the data object, when FORM is used a name will be used for storage and it will represent the cluster from the memory, 32 maximum characters in length. If we have the same name already EXPORT will overwrite what it finds in the current data cluster.

What is the difference between internal table and structure?

There are there types of structure:-

1. Flat structure( elementary fields)

2. Nested structure ( type reference to other structure)

3. deep structure ( type reference to database tables)

Can anyone give me brief explanation about internal tables, and work area?

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) and Body (Compulsory). Any value that comes to or goes from internal table, that travels through header line.

What is Size of the internal tables?

The size of the internal tables is set using the 'occurs n' clause. Here n refers to a integer number that specifies the size. Usually it’s given as 'occurs 0' which creates an itab with the memory space of 8kb.

Explain row type and line type concept?

Line type refers to the structure of an internal table, whereas row type is the actual part that contains the data and it refers to the table body. Creating internal table using line type and row type concept is for reusability purpose. Line type and Row type are defined at DDIC LEVEL.

Explain Hashed tables in SAP Internal 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

Page 29: ABAP IQs

useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.

Questions on Sap Script

What is the meaning of a Compare Tool in SAP Script?

For object comparison between clients there are many utilities within SAP Script, for example for the comparison of these objects-Documents, Layout sets and Styles we have a Compare Tool. With the Compare Tool we can make many things like: verifying if an object can be found in each of the two clients or showing why multiple versions of an object are different. For the page layout management or to format the text in a document we can use Layout Sets. The Standard styles and layout sets are found in Client 000 in the SAP system.

How can we describe better the SAP Script ?

SAP Script is by definition the text handling system of SAP R/3, it has a high degree of integration in the SAP system, it is the standard and the most used tool for several tasks that involve the processing of text in the entire SAP system.

What is the meaning of Layout Sets?

In SAP Script Layout Sets are the tools that define the layout of pages (documents). A layout is constructed from many components, some of them even handle the layout itself for single pages or some are filled with details about the text that is about to be printed on the pages. The Layout Set speaks about how a document will look and how it will be constructed, it will contain text blocks with areas for variables that can be useful for other programs, each SAP Script document has a Layout Set. When we want to modify our documents, for instance when we have to move text blocks, choose a different font, set a specific paragraph type, insert tabs all these can be made from the Layout Set. For text formatting we have two possibilities: We insert the text and output it in normal text maintenance or we can insert the text through the Layout Set. The text can be formatted through the ABAP/4 application and the Layout Set, the application will output single text blocks, elements of a text or a whole document. The formatting of our text is given by the use of Styles, they make the formatting by configuring the character formats and the paragraphs that we use in the document. Styles can be useful for highlighting strings of characters and even entire paragraphs, they can be attributed to every type of text but mainly they will be used in the basic windows of Layout Sets, where the text is inserted straight from the user in a document.

An important element is the header data, which can be used on Styles for show valuable details( in this way an end user can choose a style in the simplest way) and Layout Sets as well, where it has the role of control and information.

Page 30: ABAP IQs

The Layout Set maintenance also contains windows, which are places in a page where the text will output in the near future, every Layout Set contains one or multiple windows, if the window is missing then text formatting will not be possible in SAP Script.

Window types that are used in Layout Sets:

a) MAIN-in this type of window the output of text is made continuously, it is a window type that is common to the dialog users, like the body text of letters.

b) VAR- this type of window contains variable text in every page where the window is found, these windows will be formatted for every page.

c) CONST-this type of window contains constant text so it will be formatted only one time.

We can classify the elements of a Layout Set like this:

a) The header data- it contains data about the construction and the Layout Set like who made the document, what elements were used etc. This is the start page.

b) The paragraph formats –they are needed for text formatting exactly as in Styles but their usage extends to the processing of text like formatting the text elements as well.

c) The character formats-these can be used for formatting paragraphs and text, they actually format the text from inside paragraphs

d) The windows- they are placed only after their assigning to pages and attributing measurement units.

e) The pages- They give us a beginning and a finish in the formatting of text.

f) The page windows- They bring the pages and the windows together and their measurements are stated.

The management commands in SAP Script are meant for handling the output formatting and they are not read by the SAP Script Editor but processed by the SAP Script Composer which is an application that transforms the text from the editing form to the printing form.

Can we describe the way in which the Layout Sets are backed up, uploaded and downloaded in SAP Script?

For the SAP Script backup we have go to transaction SE71to select Utilities then Copy from client then Give source from name then source client (000 default) and Target from name. For downloading we must go to transaction SE71 the we must write the name of the form then we select Display, Utilities, form info, List and we hit Save to PC file. Fro Upload we have to create form with page then window, pagewindow with the downloaded PC file. From the PC file we will have the page window text elements.

What is the way to count pages the SAP Script outputs?

Page 31: ABAP IQs

&page&, &nextPage&.

How can we classify the SAP Script components?

SAP Script can be classified in: SAP Script text, Layout Set, Symbols, ABAP print program and function modules such as read text, open/close form and others.

What is the way to deposit the text in SAP Script?

For text storage SAO Script uses ITF or the Interchange Text Format but it also has the options to convert RTF or Rich Text Format and also ASCII which are formats for other text processors.

What is the meaning of a SAP Script and what is the role of it?

SAP Script is in fact the word processor of the SAP system, very similar to the most used text processors available for personal use on computers. Usually companies print the documents in their own layout like invoices, delivery notes and others.

There is a standard layout (or predefined) but sometimes the standard layout has to be expanded according to the requirements with additional data like addresses or purchase orders. These details are inserted by employees or they are extracted from database tables. Companies use a high amount of these documents, so printing them has become a big requirement.

Larger documents are printed like paychecks, reminders, order confirmations, payslips and others, for making this possible SAP Script is developed in such a way that it can make all the document types mentioned above, it has the IT tool that is used for text insertion and the printing of forms in the R/3 programs. Usually SAP can give us these document types in a standard form but each company can modify them or replace them at their desire and according to their needs.

How can we describe symbols and what are the main types with example?

The constant that may be entered into a document has the name of symbol and has the role of keeping the supplementary work if phrases or portions of the text get replaced, the symbol name is enclosed with &. Example: &variable name&, or system symbols like &Date&, &time& an others. Standard symbols are the ones that the user has defined and they are kept in the table TTDTG. Examples of standard symbols: &SGDH& for :”dear sir/madam” and &MFG& for:”yours Faithfully”. The program symbols show ABAP/4 program data that invoked a function for text processing, example: Itab-connid. The text symbols are good for every block type of text to define but it becomes valid just where it has been defined, example: Define &Symbol&=’value’.

Page 32: ABAP IQs

How can we implement the tab sets in Layout Sets?

We can do this by defining the paragraphs using defined tabs.

What is the role of the composer?

For getting a final look of our documents we will combine the Layout Set with the print program, the print program is being started by SAP Script so the process of printing begins, each of the commands inserted with the aid of the SAP Script interface is given to the composer. The print program specifies a Layout Set which contains the details that will be sent to the composer, and in this way the documents will be formatted base on the details provided. When there are variables in a document they are they will be replaced with R/3 data, for example the actual date or with data from the print program. In the end the document is finished with the use of the print program and the composer will put it in the spool.

What is the way to define the text symbols?

We can define the text symbols with the aid of the control command DEFINE &x1&=’56’

What activity is the most time-consuming from all in SAP Script coding?

The most time-consuming is when we define Layout Sets.

What commands are used in ABAP/4 for connecting a Layout Set?

We can use the following: the call functions OPEN-form, WRITE-form or CLOSE-form.

How do we define the data tab space in SAP Script and where?

We may define the tabs after we define the text element paragraphs.

Which are the commands mainly used for control?

The main control commands are PROTECT, ENDPROTECT, DEFINE, NEW-PAGE, INCLUDE, IF, ENDIF.

Page 33: ABAP IQs

How can we introduce a logo in our program and what is the name of the program for logo upload and also what syntax can be used for this in SAP Script?

We can use the “RSTXLDMC” report for uploading a logo and this statement: /:INCLUDE’ZHEX-MACRO-XXX’OBJECTTEXTID ST LANGUAGE’E’. The name of the object is represented by ‘XXX’.

Which are the variables that we can utilize for data output in SAP Script?

&Tables name-fields&

What purpose has an ABAP application in SAP Script?

The purpose of an ABAP application can include multiple parts like:

a) It makes the definition of the processing logic of the Layout Set, or so to speak-what order the elements of text have and when are they used again.

b) It takes the data from the R/3 program that is found in the database.

c) It selects a Layout Set to print.

d) Chooses printer, fax or monitor as the output device.

e) It makes print configurations regarding the counting of pages that will be printed.

What is the correct syntax used for a box command?

The syntax looks like this one: BOX XPOS 2MM WIDTH 0 CM HEIGHT ‘9.5’ CM FRAME 10 TW.

How do we define variables?

DEFINE &CUST&=’00000021’.

How can we describe symbols more detailed?

The values that are entered in the time of print formatting are stored in symbols and these symbols can be found under names between”&” and they are not case sensitive.

System symbols are: DATE, DAY, NAME_OF_DAY, MONTH, YEAR, TIME, HOURS, MINUTES, SECONDS, PAGE, NEXTPAGE, DEVICE, SPACE, ULINE, VLINE. Standard symbols are the ones from table TTDG and are defined by the user. To show them or modify them we can use the transaction

Page 34: ABAP IQs

SM30. An example of standard symbol: &MFG&. The standard text is a normal text that can be found in one or multiple forms and they can be written , modified or shown with the aid of the transaction SO10. For text classification we have text ID. For putting standard texts in forms we can do this with the command INCLUDE like the following: INCLUDEZ_BC460_EX4_HF OBJECTTEXT ID SDVD. We can use the PARAGRAPH parameter to format standard texts, in the next example we will see how we can center the text:

INCLUDEZ_BC460_EX4_HF OBJECTTEXT ID SDVD LANGUAGE EN PARAGRAPH C.

Name:Z_BC460_EX4_HF

Object: Text

Text id: SDVD(TEXT id from SO10)

Language EN

Paragraph: C (Centered0.

Program symbols are used for database content. For tables: kna1, in forms: &KNA1-NAME1&, for formatting: &SYMBOL& (it means there is no formatting), &SYMBOL(5)&Length(the

data and length), &SYMBOL(Z)&Suppress leading zeros, &SYMBOL+4&Offset(the start of the output), &SYMBOL(I)&Suppress initial value, &SYMBOL(C)&Compress blank spaces

(one space from the compression of consecutive spaces), &SYMBOL(S)&Operators are suppressed, &SYMBOL(R)&Right align output, &SYMBOL(8.2)&Decimal format(length),

&SYMBOL(*)&Dictionary length(the ABAP dictionary), &’text1’SYMBOL’text2’&Text entered prior to and after the symbol.

Can we give a detailed description on the Control commands?

For the changing of text output we use control commands./: is the format key that can be used in the format column, there is the intensity (grey scale) in percents, the frame thickness is given by frame parameters with zero as the initial value. Every parameter such as width and height, xpos and ypos or frame will have a measurement unit like: CH-character, TW-twip, IN-inch, PT-point, MM-millimeter, LN-line, CM-centimeter; as an example we have: BOX XPOS ’10.14’ MM YPOS ‘5.79’ MM HEIGHT ‘9’ MMWIDTH ‘14’ MM INTENSITY 8 FRAME 0 TW. This is making 2 lines and 2 rectangles for building a 3 column table and a highlighting heading section.

Page 35: ABAP IQs

POSITION and SIZE are commands used for configuring the initial box parameters, a very good thing when we have many boxes with equal parameters. With POSITION WINDOW we can configure the position in relation to the window (to the left or to the right), after that we can use POSITION for setting the coordinates related to the window start. “+” and “-“ can be used for position configuration in ORIGIN.

The Styles are utilized in forms for setting paragraphs or formats of characters and for this we have multiple standard Styles in SAP; we can also define personal styles. For the creation, finding and keeping of styles there is the transaction SE72. With the aid of the Format menu and then Style we will give the text a style and for non permanent modifications to the style we will use /: as a command.

How do we import or use graphics in Sap Script?

For importing graphics in SAP there is the transaction SE78. We may include using Edit, Graphic, Create in the form painter or we can use the statement INCLUDE, case in which we will use the window script editor-Include, Graphic like in this example (with a bitmap):

How are the modifications made?

Changes to the normal SAP program have to be made only in the case when this is compulsory. When we require supplementary data , we should use the statement PERFORM and we don’t have to modify the print program. He print program modification can take place due to reasons like these: modifications in structure or the requirement for fresh text elements. The print program the will print supplementary forms will be crucial to deciding what are the print programs and forms that we will use. They exist in the TNAPR table and they are specific for a particular output type; the programs used for output are: view V_TNAPR for entry modification from transaction SE30, for importing or exporting a SAP Script form from a PC file we will use RSTXSCRP, for getting the print application name we will use SD or the TNAPR table (for SD documents).

How can we define and enter a standard text?

The default text type that can be implemented in multiple forms is called a standard text. With the aid of the transaction SO10 we can make, modify or display a standard text. For classifying the texts we will use text ID. With the command INCLUDE we can introduce a standard texts in forms like in this example: /:INCLUDEZ_BC460_EX4_HF OBJECT TEXT ID SDVD. With the aid of the parameter PARAGRAPH we can format standard texts and for centering texts we can see the example: /:INCLUDEZ_BC460_EX4_HF OBJECT TEXT ID SVD LANGUAGE EN PARAGRAPH C. For address format we can use the command ADRESS-ENDADRESS which is determined by the country parameter from the postal standards that the

country of the recipient has. Example:

Page 36: ABAP IQs

ADDRESS DELIVERY PARAGRAPH AD

NAME &KNA1-NAME&

STREET & KNA1-STRAS&

POSTCODE&KNA1-PSTLZ&

CITY&KNA1-ORT01&’

COUNTRY &KNA1-LAND1&

FROMCOUNTRY ‘de’

ENDADDRESS.

For pagebreak avoiding in paragraphs :

/:PROTECT

:

:

/:ENDPROTECT.

The lines of text that are to be defended against pagebreaks will be met between the command IF and the command ENDIF, as in every ABAP program like this:

/:IF condition

:

:

/:ENDIF

and

/:IF condition

:

/:ELSE

:

/:ENDIF. An exact expression would be: /: &SPFLI-CITYTO&=”BERLIN” …text… /:ENDIF.

What separates a Window from a Page Window?

Page 37: ABAP IQs

The Page Window is when we declare the parameters of a window that was declared before and the document look (width, height and the margins –left and right). Window is when we talk about the type window, about the initial paragraph or the text components (SAP Scripts) that have to be included. The windows are those places stated from the start in the layout set , the text blocks that we find on a page are the windows.

How do we load graphics like logos in SAP Script?

We can load graphics like files with the .tif extension in SAP Script in standard text with the aid of RSTXLDMC.

Which are the most used programs from SAP Script?

For the transformation of the page format we have RSTXFCON, for downloading and uploading the layout sets we have RSTXSCRP, for the debugging of SAP Script we have RSTXDBUG, for moving script files from system to system we can use RSTXSCRP, to modify development classes of different objects we will use RSWBO052, for table contents comparison between clients we have to use RSTBSERV.

What are the steps and other details of debugging?

We will use Tools then Word Processing then Layout Set and we will write the layout name the we go to Utilities and Activate Debugger. It doesn’t matter which layout set we choose we choose the debugger. The layout set will call the debugger. If we try to copy a form from client to client and we try to also modify the copied form we will have these error messages:

a) Form not found. The solving of this problem is trying to copy again but with a language specification.

b) Text file is inconsistent. From SE38 we have to run “RSTXCHKO”, the form name will be required and checking all the checkboxes (and running the program) fixes the problem.

What is the way for making a script layout backup for future loading from the HDD?

This can be done with the EXPORT MODE, a script with a similar name to the initial script will be made, if this is already made,it receives an error.

What types of Internal tables exist?

The Internal table type are:

Page 38: ABAP IQs

a) The standard table: for key access to this type of table linear search is used, so the duration needed for a search has a linear connection to how many table entries we have. For accessing standard tables it is best to use index operations.

b) The hashed table: it is a table that will be handled using an internal hash procedure and it will only be available to access with the generic (key) operations like LOOP, SORT and others, so implicit/explicit index operations are forbidden.

c) The sorted table: it is a table that is every time sorted in the right way and to access it we need to use binary keys. The index from the lower level is picked up by the system if we don’t have a unique key. The table count determines directly in a logarithmic way the needed runtime for key access.

d) The index table: is the table which is possible for us to access with the aid of an index. Its solely purpose if to say what kind of generic parameters we will have in a function or form.

How do we describe the “Check” statements and what is their mechanism?

The “Check” statement is used for finishing one loop pass conditionally, when the condition says true the rest of the statements from the actual statement block will be ignored and will begin the next loop.

How can we describe the following commands: MODIFY LINE and READ LINE?

The MODIFY LINE statement is meant for changing the lines of a full list from inside the program and the READ LINE statement is used for reading data found on the lines from the current levels. READ LINE is the same as READ CURRENT LINE and they are both related to HIDE.

How do we describe Activation?

In the time of activation, the runtime object of aggregate object/tables is being made, it will be buffered for the purpose of faster access from the application program; it contains details regarding the following objects of table: domain, data elements, field definition, table definition.

What is the best way for reading database table lines in an internal table in the form of packs of a known size?

SELECT *FROM SPFLI INTO TABLE ITAB PACKAGE SIZE N (N being the variable). We must give a name to the WILDCARD characters that are meant to be compared with numeric and character strings.

What is the meaning of these terms: Switching changes, storing changes and cancelling changes?

Page 39: ABAP IQs

The switching changes are the switches from active to revised version, the storing changes mean that active version will be deposited for a limited period of time in versions and cancelling changes will make a reset of the revised versions to be an active versions.

What is the significance of restart adjustment and cancel adjustment?

With restart adjustment will continue the conversion when it is at the finish point and with cancel adjustment the lock entry will be erased from table.

What is the version catalog and what types of versions exist?

The version catalog is the list that contains very version of an object in existence. The version types are:

a) The active version: is the version made at the program activation.

b) The revised version: is the version made at the editing of the current project.

c) The temporary version: is the version made at the temporary copying of the active version in the database that has store version functions.

d) The historical version: is the version made at the making of the correction and at the release of the correction.

How do we show the internal table contents and how does a program run in background?

We can push F9 from the selection screen but not before we fill the screen, then the display will show a request for the user to print Background Parameters. Then we write the output device, that can be for example HPLI/SAP2. Print has to be unchecked urgently from the spool options then we c also delete then new spool request. After we hit enter a screen will be displayed showing the start time of the heading , we may pres start now and save. In this way we have a background job started for the specific program, for displaying its status we will use this transaction code: SM37. Then from the screen that appears –Job overview then we select our program then Spool in the toolbar of the application the Output Controller and List of Spool Requests. After this-we select our Spool request and we hit the Display icon that we see in the overview. The List should appear. We have to be careful because if the list exceeds 255 columns it will become truncated in background.

What is generic key and generic area?

The generic key is the left part of the first table key. The generic area represents every record that correspond to generic key fields.

Page 40: ABAP IQs

How do we separate these terms: invoking a program, transactions with or without return and what is the way to succeed?

When using AND RETURN the data of the invoking executable will be deposited by the system and the system will go back to the invoking once the invoked program was processed. The execution of the invoking program will be retaken when the statement is made. When we don’t add AND RETURN the entire data and the stages of the list that the invoking program has or we can say the whole internal session will be erased. Once the executable program is terminated the control will go back to where that start of the invoking program was. When it comes to transaction we have:

CALL TRANSACTION [AND SKIP FIRST SCREEN] [USING]. It is a statement that preserves the invoking program data and the transaction begins. When the transaction finishes, the system will go back to the statement from the invoking report that is following the invoking. This statement: LEAVE TO TRANSACTION [AND SKIP FIRST SCREEN] finishes the invoking program and the transaction begins. The invoking stack will be erased (or what we name internal sessions) for all the past programs. When the transaction finishes, the system will go back to the area menu where the original program from the invoking stack begun.

MODULARIZATION

What are Modularization and its benefits?

If the program contains the same or similar blocks of statements or it is required to process the same function several times, we can avoid redundancy by using modularization techniques. By modularizing the ABAP/4 programs we make them easy to read and improve their structure. Modularized programs are also easier to maintain and to update.

How can we create callable modules of program code within one ABAP/4 Program?

A. By defining macros. B. By creating include programs in the library.

What are subroutines?

Subroutines are program modules which can be called from other ABAP/4 programs or within the same program.

What are the types of Subroutines?

Page 41: ABAP IQs

A. Internal Subroutines: The source code of the internal subroutines will be in the same ABAP/4 program as the calling procedure (internal call).

B. External Subroutines: The source code of the external subroutines will be in an ABAP/4 program other than the calling procedure.

What are the different types of parameters?

Formal parameters: Parameters which are defined during the definition of subroutine with the FORM statement. Actual parameters: Parameters which are specified during the call of a subroutine with the PERFORM statement.

How can one distinguish between different kinds of parameters?

A. Input parameters are used to pass data to subroutines. B. Output parameters are used to pass data from subroutines.

What are the different methods of passing data?

A. Calling by reference: During a subroutine call, only the address of the actual parameter is transferred to the formal parameters. The formal parameter has no memory of its own, and we work with the field of the calling program within the subroutine. If we change the formal parameter, the field contents in the calling program also change.

B. Calling by value: During a subroutine call, the formal parameters are created as copies of the actual parameters. The formal parameters have memory of their own. Changes to the formal parameters have no effect on the actual parameters.

C. Calling by value and result: During a subroutine call, the formal parameters are created as copies of the actual parameters. The formal parameters have their own memory space. Changes to the formal parameters are copied to the actual parameters at the end of the subroutine.

The method by which internal tables are passed is By Reference.

What is the difference between the function module and a normal ABAP/4 subroutine?

In contrast to normal subroutines function modules have uniquely defined interface. Sub routines do not return values.

Sub routines do not return exceptions. Sub routines cannot be tested independently. Declaring data as common parts is not possible for function modules. Function modules are stored in a central library. What is a function group? A function group is a collection of logically related modules that share global data

Page 42: ABAP IQs

with each other. All the modules in the group are included in the same main program. When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at runtime. Every function module belongs to a function group.

What is the difference between internal tables and extract datasets?

A. The lines of an internal table always have the same structure. By using extract datasets, you can handle groups of data with different structure and get statistical figures from the grouped data.

B. You have to define the structure of the internal table at the begining. You need not define the structure of the extract dataset.

C. In contrast to internal tables, the system partly compresses extract datasets when storing them. This reduces the storage space required.

D. Internal tables require special work area for interface whereas extract datasets do not need a special work area for interface.

What are screen painter and menu painter?

Screen painter: Screen painter is a tool to design and maintain screen and its elements. It allows user to create GUI screens for the transactions. Attributes, layout, filed attributes and flow logic are the elements of Screen painter. Menu painter: Menu painter is a tool to design the interface components. Status, menu bars, menu lists, F-key settings, functions and titles are the components of Menu painters. Screen painter and menu painter both are the graphical interface of an ABAP/4 applications.

What are the components of SAP scripts?

SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal documents. Layout sets. - Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of Header, paragraph, and character string. ABAP/4 program.

What is ALV programming in ABAP? When is this grid used in ABAP?

ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and

Page 43: ABAP IQs

arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

What is CTS and what do you know about it?

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.

What are logical databases? What are the advantages/ dis-advantages of logical databases?

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. Advantages: i)check functions which check that user input is complete, correct,and plausible. ii)Meaningful data selection. iii)central authorization checks for database accesses. iv)good read access performance while retaining the hierarchical data view determined by the application logic. dis advantages: 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).

What is a batch input session?

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.

What is Smart Forms?

Smart Forms allows you to create forms using a graphical design tool with robust functionality, color, and more. Additionally, all new forms developed at SAP will be created with the new Smart Form solution.

How can I make a differentiation between dependent and independent data?

Client dependent or independent transfer requirements include client specific or cross client objects in the change requests. Workbench objects like SAPscripts are client specific, some entries in customizing are client independent. If you display the object list for one change request, and then for each object the

Page 44: ABAP IQs

object attributes, you will find the flag client specific. If one object in the task list has this flag on, then that transport will be client dependent.

What is the difference between macro and subroutine?

Macros can only be used in the program the are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program the are defined in and other programs . A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.

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.

In events start-of-selection is default event. When we have to use this event explicitly? Why?

The default event in the ABAP is Start-of-selection.We have to call explicitely this event when you are writing other than ths event , that is when you write AT SELECTION-SCREEN EVENTS OR INITIALIZATION EVENT etc,you have to explicitely mention the Start-of-selection event while you are writing the logic. Before these events called ,all the code you have written come into this default Start-of-selection screen event.

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.

Page 45: ABAP IQs

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 Tcode SE16. For what is it used. Explain briefly?

Answer1:

SE16 is a T-code for object browser.

Generally used to search the fields of SAP Tables . and respective data.

Answer2:

se16 is a data browse and it is used to view the contents of the table and we cannot change or append new fields to the existing structure of the table as we cannot view the structure level display using the se16

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

The 2 editors are se38 and se80 both have the abap editor in place. In se38 you can go create programs and view online reports and basically do all thedevelopmet of objects in this editor. In se80 ( object navigator) there are additional features such as creating packages,module pool , function group ,classes, programs ( where you can create ur programs) and BSP applications .

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

Which one is not an exit comand ? (Exit, cencle, stop, back)

STOP.

Page 46: ABAP IQs

Effect :The statement STOP is only to be used in executable programs

EXIT.

Effect :If the EXIT statement is executed outside of a loop, it will immediately terminate the current processing block.

BACK. Effect : This statement positions the list cursor on the first position of the first line in a logical unit.

So "Cancle" is not an exit command

What is Field symbol ?

Answer1:

You can use field symbols to make the program more dynamic. In this example 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 table control as a parameter.

Answer2:

fieldsymbol has the same concept as pointer in c,

fieldsymbol don't point to a data type like char, num instead of that it points to the memory block. the syntax for fieldsymbol is

FIELD-SYMBOL <N>.

EG. FOR FIELD SYMBOL.

DATA: DAT LIKE SY-DATUM,

TIM LIKE SY-UZEIT,

CHAR(3) TYPE C VALUE 'ADF'.

FIELD-SYMBOL : <FS>.

MOVE DAT TO <FS>.

WRITE:/ <FS>.

MOVE TIM TO <FS>.

WRITE:/ <FS>.

MOVE CHAR TO <FS>.

Page 47: ABAP IQs

WRITE:/ <FS>.

The output will be

Today's date

current time

What are the advantages and disadvantages of using views in ABAP programming ?

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 data is stored in cluster table?

A cluster table conatins data from mulitple DDIC tables.

It stores data as a name value pair ( varkey, vardata)

Have you used performance tuning? What major steps will you use for these?

First of all tunning can be done

In three ways: disk i/o ,sql tunning , memory tunning,

Before tunning u have to get the status of your database using

Oracle utility called statpack , tkprof, then you should go for tunning

How to create client independent tables?

client independent tables:

the table in which the first field is not mandt is the client independent tables

Page 48: ABAP IQs

*mandt is the field with mandt as the data element

*automatically client which we login is populated to mandt

What type of user exits have you written?

there are four types

1.function exit

2.menu ixit

3.screen exit.

4.field exit.

these are the user exits

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

APPEND : IT IS USED TO GET THE RECORD FROM THE INTERNAL TABLE HEADER TO THE BODY AREA IT ALLOWS DUPLICATION

COLLECT: IT IS USED TO A GET A RECORD FROM HEADER TO THE BODY AREA BUT IT WILL NOT ALLOW ANY DUPLICATION EXCEPT IF THERE IS ANY NUMERIC FIELS IT ADDS THAT FIELDS DATA BUT NOT AS A NEW RECORD

Q: What Function does data dictionary perform?

A. Central information repository for application and system data. The ABAP Dictionary contains data definitions (metadata) that allow you to describe all of the data structures in the system (like tables, views, and data types) in one place. This eliminates redundancy.

Difference between /N and /BEND?/BEND terminates the batch input processing and sets the session to be failed. /N terminates the current batch input transaction.

SM35 transaction . How to automate BDC? After execution of batch input program , the session created is placed in the session queqe which can be viewed using SM35 transaction executing / Releseing the session will start the transfer of the data from the session into the database tables./

Page 49: ABAP IQs

Update types in Call transaction method. What is the difference ? At present with SAP we have only modes of updation 1.Synchronus Update. 2.Asynchronous Update. There is no more Local Update.

What are the table controls in BDC ? What is the difference between bdc and lsmw

? What is the difference between bdc and rfc ? BDC - Batch data communication in which there are 2 processes 1. in bound 2. outbound RFC - remote fucntion call(or) calling

Data conversion experience? DATA CONVERSIONS: SAP HAS PROVIDED A TOOL NAMED LSMW WHICH CONVERTS THE LEGACY DATA INTO THE REQUIRED SAP FORMAT AND UPDATES THE DATABASE.

Open datasets, Read datasets ( Reading and writing data to files)? Date Sets are nothing but files on Application Server, they can even be called as Sequential files. Open Dataset Is used to open required file on the application Server. Read Dataset. Is used to read the contents required file on the application Server.

How to do back ground processing in BDC Session method?

Go to sm35 select the option background process

Call transaction method, how to capture the errors ? IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING. FIRST I MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE. THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS. THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE" AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNING.

How to load data from MS Excel sheet to SAP by using BDC method ? KCD_EXCEL_OLE_TO_INT_CONVERT even takes care of blank cells and is available in older versions of SAP 

* Add values to internal tableSORT t_cells BY row col.LOOP AT t_cells INTO wa_cells.

Page 50: ABAP IQs

MOVE : wa_cells-col TO l_index.ASSIGN COMPONENT l_index OF STRUCTURE itab TO <f_value>.MOVE : wa_cells-value TO <f_value>.AT END OF row.APPEND itabCLEAR itab.ENDAT.ENDLOOP.

What is the difference between Upload and WS_Upload ? The difference between WS_Upload and Upload is when you use function Upload it prompts for a dialog box where in you need to key in the file location. Where as in case of WS_Upload you specify the file location in the function input parameters itself

If I want to execute a program only in background not in foreground is there any option for this? The sm37 transaction can be used for running a program in the background. Also in the session method while processing the session you can specify the processing type as background or foreground.

What kind of BDC programs are written ?

There are five types of BDC methods available. They are 1.Batch input session 2.Call Transaction 3.Recording 4.Direct Input and 5.LSMW

How to read files and process BDCs automatically? To read file from Presentation server use Upload or GUI Upload or WS upload and to read file from Application server use Open Dataset, Read dataset and Close dataset

In session method sy-subrc is not returned whereas in call transaction method sy-subrc is returned. What does it mean? While transferring the data if any errors occurs until the errors are the complete the data is not transfer to the SAP system. the system compulsory shows the errors. that errors are stored into the error logs (Transaction is SM35). so the session method should not return any value. In call transaction method data is directly pass to the SAP system. So its compulsory return the value. Because of the call transaction is the function. A function should return the value mandatory.

Recording Function With recording, user can avoid manual search for fields and tables required in a program including screen numbers. SHDB is the transaction code.

BDC vs Direct Loads( have you used direct loads on SAP tables ) Direct loads is 5 times faster than uploading by normal BDC method. but some times while updating the database referential integrity is violated.

Have you set up a back ground job ? How to create a background job without a

variant ? 

Page 51: ABAP IQs

Yes, user can create background job scheduling in two ways. 

1. By calling the executable program RSBDCSUB 2. Transaction Code SM37

What is BDC and why do we use BDC ?

BDC ( Batch Data Communication ) also known as batch input is a technique by which large volumes of data can be transferred from Non Sap or Legacy systems to SAP systems.

Example:  A Legacy system that is to be replaced by SAP has say 1000 Customers , 2000 vendors and 3000 materials. All this data needs to be transferred to SAP . In such cases , We can use BDC.

If the old system is replaced by SAP, such a transfer is called Conversion.If the old system runs along with SAP, in that case the transfer is called an Interface.

The two methods for BDC are: Session Method Call TRANSACTION Method CALL DIALOG (Outdated)

ABAP interview questions on BDC:Important:Question 1:What is the difference between Call Transaction Method and the Session method ?

Session Method Call TransactionSession method id generally used when the data volume is huge.

Call transaction method is when the data volume is low.

Session method is slow as compared to Call transaction.

Call Transaction method is relatively faster than Session method.

The records are not added to the database until the session is processed.

The records are immediately added to the database table.

Sy-subrc is not returned. Sy-subrc is returned to 0 if successful.

Page 52: ABAP IQs

Error logs are created for error records.

Updating in database table is always Synchronous. 

Error logs are not created and hence the errors need to be handled explicitly.

Updating in database table is either Synchronous or Asynchronous.

Important:Question 2: How do you do BDC for a table control?With other things as usual, there is a special trick that you have to use while doing BDC for table control.You need to use the BDC OKCODE '=P+'.Its the BCD_OKCODE for Page down that can be used for scrolling down in table control.

Important:Question3: Is there any method apart from BDC for data upload to SAP?Apart from BDC and LSMW, you can use BAPIs to upload data into SAP.BAPIs should be preferred over BDCs, because they process data faster than BDC.

A BAPI is faster since it updates Database "directly". Whereas BDC calls transaction and goes through the whole screen sequence as any user would do.

BAPI BDCBAPI is faster than BDC. BDC is relatively slower than BAPI.BAPI directly updates database. BDC goes through all the screens as a

normal user would do and hence it is slower.

No such processing options are available in BAPI.

Background and Foreground processing options are available for BDC.

BAPI would generally used for small data uploads.

BDCs would be preferred for large volumes of data upload since background processing option is available.

For processing errors, the Return Parameters for BAPI should be used.This parameter returns exception messages or success messages to the calling program.

Errors can be processed in SM35 for session method and in the batch input program for Call Transaction method.

Question 4: How do you process errors in Call Transaction method ?

Let's have a look at the syntax for CALL TRANSACTION method.Sample code:DATA: BEGIN OF G_T_MESSTAB OCCURS 0.        INCLUDE STRUCTURE BDCMSGCOLL.DATA: END OF G_T_MESSTAB.

CALL TRANSACTION 'MB11'

Page 53: ABAP IQs

    USING G_T_BDCDATA          MODE 'E'          UPDATE 'S'          MESSAGES INTO G_T_MESSTAB.

All the error messages will be trapped inside G_T_MESSTAB.

Question 5: What is the use of program RSBDCSUB?There are two ways to process the BDC sessions:1) Go to SM35 ---> Choose session ---> hit process.      Now See Question no. 10.2) Use program RSBDCSUB.     RSBDCSUB schedules the session to be processed in background.

Let's take an example to understand this.

The sessions are created at one point of time and processed at other point of time and this may create a problem: For example: a BDC program creates a session for updating 1500 customers in SAP. However , before this session is processed via SM35 , a user inserts 100 customers in the system manually. In this case , the session will have at least 100 errors when the session is processed from SM35.

One way to avoid this is to use the program "RSBDCSUB" in the batch input program itself so that the session is processed as soon as it is created. RSBDCSUB schedules the session to be processed in background.

Question 6: What is the structure of the BDC table?

The BDCDATA consists of the following fields:  PROGRAM [CHAR 40] - Online program name.  DYNPRO [NUMC 4] - Screen number.  DYNBEGIN [CHAR 1] - Flag to indicate the start of a new screen.  FNAM [CHAR 132] - Field name of a screen field to be filled with data.  FVAL [CHAR 132] - The actual value to be filled into the specified screen field.

Sample Screenshot:

Page 54: ABAP IQs

BDCDATA table structure

Question 7: What is the difference between BDC_OKCODE and BDC_CURSOR?

BDC_OKCODE: is used for storing commands during the recording. like '/00' is the command for 'ENTER' Key.BDC_CURSOR: contains the cursor position. it contians the field in which cursor will be.

Example code:perform bdc_field       using 'BDC_CURSOR'                                                'PROJ-PSPID'.perform bdc_field       using 'BDC_OKCODE'                                                '=BU'.

Question 8: What are the 3 methods that we use in sequence in a Batch input session method ?

1) BDC_OPEN_GROUP for opening the Batch Input Session2) BDC_INSERT for inserting the transactional data into SAP3) BDC_CLOSE_GROUP for closing the Batch Input Session

If there are n records , the BDC_INSERT method should be called n times.

Page 55: ABAP IQs

BDC_OPEN_GROUP and BDC_CLOSE_GROUP are called only once.

General Information about a session is stored in table APQI.Transaction data for a session is stored in table APQD.

Question 9: What is your approach for writing a BDC program?

Identify the Tcode and do the recording in SHDB to populate the BDCDATA.

Once the recording is done , one can Transfer it to the Batch input program.

In the batch Input program , The transactional data is read from the file to an internal table.

Then one can loop over the transactional data in the internal table and start uploading the data in SAP either by CALL TRANSACTION method or by creating sessions through the batch input program.

Question 10: How do you process errors in Session method ?You can go to Transaction SM35 , Choose the session name and click on Process.

Page 56: ABAP IQs

Question 11: What are the different modes of processing batch input sessions?  

The three modes are:

Foreground

Display Errors Only

Background

Question 12: What is the difference between Synchronous and Asynchronous Update?In Synchronous update, the database is updated before the next transaction is taken for processing in a batch input.In Asynchronous update, the system doesn't wait for updating the database before the next transaction is taken for processing in a batch input.

Question 13: What is the transaction for Recording BDC? The Tcode is SHDB.

Question 14: How do you read files from the Application server? You can use the commands:OPEN DATASET ---> opens the file(dataset) either in read /write mode.READ DATASET ---> Read the file

Page 57: ABAP IQs

CLOSE DATASET ---> Close the dataset once the date has been read .

Question 15: How do you read files from the presentation server ?You can use the Function Modules :GUI_UPLOAD --> To read data from file into an internal tableGUI_DOWNLOAD --> To write data from internal table to a file on presentation server