Reports

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

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

2. Which BDC you prefer?

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

(This is more genric answer but you can add more on to this if you have worked on  BDC)

3. When u prefer LSMW?

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

5. Difference between .include and  .append?

Ans.

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

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

6.What is occurs in internal table?

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

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

8.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)

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

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

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

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

Method 1:—-

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

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

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

select-options s_matnr for mara-matnr.

SELECTION-SCREEN END OF SCREEN.

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

CALL SUBCREEN sub_area INCLUDING <program> <screen>

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

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

Method 2:——-

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

continued ……

struc_tab_and_field-fieldname = con_cust. ” ‘KUNNR’

struc_tab_and_field-tablename = con_kna1. ” ‘KNA1′.

CALL FUNCTION ‘COMPLEX_SELECTIONS_DIALOG’ EXPORTING*

TITLE = ‘ ‘

text = g_titl1 ” ‘Customers’

tab_and_field = struc_tab_and_field

TABLES RANGE = rng_kunnr

EXCEPTIONS

NO_RANGE_TAB = 1

CANCELLED = 2

INTERNAL_ERROR = 3

INVALID_FIELDNAME = 4

OTHERS = 5.

IF NOT rng_kunnr[] IS INITIAL.

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

* dynpro screen field

*READ TABLE rng_kunnr INDEX 1.

IF sy-subrc = 0.

g_cust = rng_kunnr-low.

ENDIF.

ENDIF.

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

13.how we can retrive data using secondary index.explain with simple example

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

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

Leave a comment