Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

ABAP - Advanced Business Application Programming

Monday, May 26, 2008

ABAP - Questions

What is a 'Z' report?
Y or Z report refer to customized abap programs written for modules such as mm, sd, pp or fi/co etc.

Can we create an ABAP program without using Y or Z?
No, this is because all non Yor Z programs are standard SAP programs.

1. How data is stored in cluster table?
Each field of cluster table behaves as tables which contains the no. of entries.

2. What are client dependant objects in abap/sap?
SAP Script layout, text element, and some DDIC objects.

3. On which even we can validate the input fields in module progams?
In PAI (Write field statement on field you want to validate, if you want to validate group of fields put in chain and End chain statement.)

4. In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically?
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' to get material and material group for the plant.

5. How do you get output from IDOC?
Data in IDOc is stored in segments, the output from Idoc is obtained by reading the data stored in its respective segments.

6. When top of the page event is triggered?
After excuteing first write statement in start-of-selection event.

7. Can we create field without data element and how?
In SE11 one option is available above the fields strip. Data element/ direct type.

8. How do we debug sapscript?
Go to SE71 give lay set name , go to utilities select debugger mode on.

9. Which transaction code can I used to analyze the performance of ABAP program.
TCode AL21.

10. How can I copy a standard table to make my own z_table.
Go to transaction SE11. Then there is one option to copy table. Press that button. Enter the name of the standard table and in the Target table enter Z table name and press enter.

Following are some of the answers which I gave upto my knowledge.

1. What is the use of 'outerjoin'
Ans. With the use of outer join you can join the tables even there is no entry in all the tables used in the view.
In case of inner join there should be an entry in al the tables use in the view.

2. When to use logical database?
Ans. Advantage of Logical databases:
less coding s required to retrieve data compared to normal internel tables.
Tables used LDB are in hierarchial structure.

3. What is the use of 'table index'?
Ans .Index is used for faster access of data base tables.

4. What is the use of 'FOR ALL ENTRIES'?
Ans. To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.
If there r more than 10000 records SELECT FOR ALL ENTRIES is used.
Performance wise SELECT FOR ALL ENTRIES is better to use.

5. Can you set up background processing using CALL TRANSACTION?
Yes,Using No Screen Mode.

6. What are table buffers?

Table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed directly from the buffer of the application server. This avoids the time-consuming process of accessing the database. Buffering is useful if table needs to be accessed more no. of times in a program.

1. How do I set a flag for a field in any table?
Create a char field of length 1. for example field STAS-LKENZ is Deletion Indicator. It means that if the value in the field is 'X' then that record has been deleted.

2. Can I execute user exits? If yes, how?
Yes you can. after finding the user exit, you need to use, goto CMOD add ur user-exit to your project. Then activate the FM which you require. Now go into that function module there will be a Include program wit name ZX* . Double click on it, it will ask to create an object, answer it Yes and then write your code in it.

3. How do I find the output type of a table or a program?
Table TNAPR / NAST

4. How to execute a program step by step on the ABAP editor?

First test your code with '/h' type in command window which shall take you to debug or by putting break points with F8. You test your program from code and then go to se30 performance analysis transaction and there you can know what are the drawbacks. Then go to SLIN transaction and do extended syntax check or from code in menu options where you have debugging -> extended check and the program id ready without error.

Tips by : Harichand Chandunair

Testing your code.

As mentioned above after doing syntax check and extended syntax check you have to create a TEST PLAN. You have to test all possible Postive & Negative test cases.

Test for division by zero if it involves calculation or code accordingly.

Try to test for field overflows. If it involves sap script or smart forms try to print outputs which have single page and also multiple page and which does not have any output at all.

Test by leaving all parameters in selection screen blank.

Test by entering wrong values in selection screen and display a pop-up if the user enters wrong selection screen values.

You can also do ABAP trace and SQL trace to make sure that your program is efficient.

Debugging code/program.

As mentioned above type /h in command line and try to execute the program. Another way is to set break-point at the function module or the required line and do single step execute or execute. Once you finished debugging, you can select Delete to clear all the break points.


5) What are dml statements in sap?

Ans: Insert, Update, Delete.

What is the difference between open sql & native sql?

Ans: Open SQL allows you to access all database tables known to the SAP system, regardless of the database manufacturer. Sometimes, however, we may want to use database-specific SQL statements called Native SQL in your ABAP/4 program. To avoid incompatibilities between different database tables and also to make ABAP/4 programs independent of the database system in use, SAP has created a set of separate SQL statements called Open SQL. Open SQL contains a subset of standard SQL statements as well as some enhancements which are specific to SAP.

A database interface translates SAP's Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly

What is Primary key, foreign key ? what is primary index? secondary index?

Ans: Primary index: the primary index contains key fiels of a table and a pointer to non-key fields of the table. The primary index is created automatically when a table is created in database and moreover you can further define reference to the primary index which are known as Secondary index.

How many indexes can be created for a table?

Ans: 9.

What is data class?

Ans: The data class specifies in which table space the table is created in database.

Give few names of cluster tables in sap?

Ans: sorry i dont know

Give few names of pooled tables in sap?

Ans: A pool table has many to one relation with the table in the database. For one table in the database there are many tables in the dictionary. Tha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. A pooled table is stored in the pool at the database level. A table pool is a databse table with a special struct that enables the data of many R3 tables to be stored in it. It can hold only pooled tables.
Sorry I dont know table names

Give few names of transparent tables?

Ans: A transparent table has a one to one relataionship in the database. The table in the dictionary has the same name, same no of fields, and the fields have the same name as in the R3 table defn. A transparent tabel has application data (Master and Transaction). sorry i dont know table names

What is a buffer and how many types?

Ans: Buffer is othing but which stores data temporarily. there are two types of buffers. they are Roll and Page areas.
Pages : it stores the application data.
Roll area: it stores the data of previous pages.Data areas of used programs are created in roll areas for each internal session.

What is table maintenance generator and how to create that? What is the transaction code?

Ans: Table maintanence generator is nothing but making a table available for adding records and deleting records.
The transaction code used is SM30.

How to add new fields to a standard sap table?

Ans: 1. Appended structures 2. Customizing tables

What are lock objects?

Ans: Lock objects are nothing but which holds a data for particular field value until you remove a lock..

Diff betwn inner & outer join?

Ans:

What is the use of start-of-selection event?

Ans: Start-of-selection is called implicity even it is not used in the program. start-of-selection is triggered after the standard selection screen has been displayed.

What is the difference between end-of-page and end-of-selection?

Ans: End-of-page : is footer of the page. End-of-selection: is triggered At the end of the processing block.

If you write a write statement after end-of-selection, will that be triggered?

Ans: Yes

How to create a button in selection screen?

Ans: Using parametres

How to add a gui status in a selection screen?

Ans: sorry i dont know i thik using set pf.

How to create a check box/option button in a list?

Ans:

For this...

Create an Internal table as :

data: Begin itab occurs 0,
cb_field type char1,
matnr like mara-matnr,
.....
end of itab.

Now you fetch the data into the internal table of itab using
some query...

select * ......

Now you are going to display it as....

Loop at itab.
write:/ cb_field as checkbox...
......
at this time only write the Hide statement.... as...

HIDE: values.... u want...

Endloop..

Now capturing of selected data process...

This can be done by clicking on some USER Command button...

for suppose you're clicking F8 means...

AT pf8.
IF SY-LSIND = 1.
describe table itab lines VARIABLE NAME.
cnt = 3. " Initiate value for Count 3 if you're including page header.
do VARIABLE NAME times.
read line cnt. " Above counter....
if sy-lisel(1) = 'X'.
WRITE:/ 'SELECTED RECORDS:', itab-cb_field,.....
endif.
COUNTER = COUNTER - 1.
cnt = cnt + 1.
enddo.
ENDIF.

Can you call a bdc program from a report? how?

Ans: Yes through Submit and return

Can you call a transaction from a report? how?

Ans: Yes Using Call transaction and leave to.


What are ALV reports? how they are different from normal reports?
Ans: these reports are used to find subtotals and totals in a report. If you want i'll give you an example program

What are the main events that are used in an ALV report?
Ans: sorry i dont know

What is the use of SLIS type pool in alv reports?

Ans: Slis type pool is a global defination of pooltypes of catalog structure, table and layout which we use in ALV reports

Difference between top-of-page and top-of-page during at-line- selection?

Ans: Top-of-page is a header on primary list. Top-of-page during line-selection is a header on secondary lists

In an interactive report, after going to 5th list, can you come back to 2nd list? how?

How many type of internal tables are there?

Ans: Standard, Hashed, Sorted tables

What is the difference between hashed & sorted internal tables?

Ans: Sorted internal table works on Binary Search and Hashed internal tables works on hashed alogorthim through indexes.

What is the difference between standard and sorted internal tables? (in performance wise)

Ans: Sorted table improve the performance in case of a huge table which has no: of records

What is the use of at new statement?

Ans:sorry i dont know

When do you need to create an internal table with header line? and with out a header line? line?

Ans: If we don't want to use any explicit work area then its better to go for an internal table with header line.

What does it mean occurs 0 while creating an internal table?

Ans: sorry i dont know

Which of these methods can be best used in background process?

Ans : Batch Input method.

What is direct input method?

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

Ans: Exec Sql[Performing [Native sql statements]
endexec.
The above is the syntax for the native sql statements.

Disadvantages:

. Syntax check is not done to statements written inside the EXEC SQL statements.

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

What transactions do you use for data analysis?

ANs: Sorry i dont know but for runtime analysis we use transaction code : se30.

What are selection texts?

Ans: in the selection screen you can change the name of the field,title etc using selection texts. go to text--> text elemets---> selection texts in the menu bar to set selection texts.

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

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

Ans: Through functions.

What are steps you follow to improve the performance of a report?

Ans: 1) USe select fields statements (not select *)
2) Use views rather than tables
3) Don't use nested Select.

What is the role of secondary index in performance?

Ans: sorry i dont know

What is the role of ST05 in performance tuning?

Ans: SQL trace

What is the role of extended syntax check in performance tuning?

Ans: sorry i dont know

Will join conditions in sql queries affect perfomance? how?

Ans : Yes

Will sorted internal tables help in performance?

Ans: Yes

Will where conditions in a sql query help improve performance?

Ans: No Not at all

No comments: