0% found this document useful (0 votes)
4 views

FAQs_Reports

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

FAQs_Reports

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

1. What is report?

- Fetch the required data from DB and display O/P based on I/P.

2. Types of reports?
- Classical, Interactive, ALV.

3. What is classical report?


- Print O/P using 'WRITE' statement.

4. Events in classical reports?


-INTIALIZATION: Triggers before selection screen display.
For default values.
AT SELECTION-SCREEN: Triggers after input and before START-OF-SELECTION.
Validations on all I/P fields.
Here we write logic

AT SELECTION-SCREEN ON: Triggers after input and before START-OF-SELECTION.


Validations on a single I/P field.
START-OF-SELECTION: Triggers after processing selection screen. esz
To fetch data from data base.
END-OF-SELECTION: Triggers after START-OF-SELECTION.
Processing logic.
TOP-OF-PAGE: Triggers before printing the O/P data (1st WRITE
statement).
To print the header info.
END-OF-PAGE: Triggers at end of each page printing.
To print footer info.

5. Difference b/w AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT?


- AT SELECTION-SCREEN - Triggers if you hit anything (Enter, Execute, etc) after
the selection screen is displayed.
AT SELECTION-SCREEN OUTPUT - Triggers before selection screen is displayed, This
can be used to make fields invisible/visible based on selection.

6. First event triggers in reports?


- LOAD-OF-PROGRAM triggers by system for any program but in ABAP perceptive
INTIALIZATION is the first triggering event.

7. What are text elements?


- Easier to maintain program texts in different languages. These are used for
maintaining list headers, hard code, selection texts in programs.

8. Types of internal tables?


- 1. INDEX TABLES:
a. STANDARD - Can accept duplicates and default tables.
b. SORTED - Addition of UNIQUE/NON-UNIQUE is required.
2. HASHED TABLES: Duplicates are not allowed and UNIQUE is required.

9. Difference between internal table with header line and without header line?
- Internal table with header line is work area name as well as internal table name
is same.
without header line means only internal table created, workarea to be created
separately.

10. When we use TYPES declaration?


- It is like a data type to be used as reference to create work area or internal
table.
When we dont have any reference structure available in SE11 to create
workarea/internal table as per the requirement then we create a reference using
TYPES.

11. Difference between SELECT SINGLE and SELECT UP TO 1 ROWS ?


- SELECT SINGLE can be used if you know the full key to select a record and DB
returns that particular record to buffer and buffer to program.
SELECT UP TO 1 ROWS is when we dont have all key to select and DB returns all
matching records to buffer and then 1st record of all will be moved to prog.

12. Difference between UPDATE and MODIFY ?


- UPDATE - it updates when the matching record found, if not found then it fails.
MODIFY - it acts like UPDATE + INSERT, it updates if the matching record found,
if not found it inserts new record.

13. What is the prerequisite to use for all entries?


- We should check base table is not initial otherwise it picks all the data.

14. What is the prerequisite to use binary search?


- SORTING with the fields used in binary search.
If we don't SORT then there is no guarantee that respective record will be
picked.

15. When will be the TOP-OF-PAGE event triggered in classical reports?


- When 1st WRITE statement encounters.

16. Explain about control break statements?


- AT FIRST, AT NEW, AT END, AT LAST.

17. What is the diff between IF and CHECK?


- Functionality wise both are same but IF can have ELSE but CHECK does not have.
IF should have ENDIF but CHECK does not have ENDCHECK.

18. What is the diff between EXIT and STOP?


- We use EXIT to terminate the loop but STOP is to stop the further processing of
the program completely.

19. When we go for LOOP inside LOOP?


- N:M case, Ex. EKPO and EKBE.

20. What is the difference between FREE and REFRESH?


- REFRESH-Clears the internal table data.
FREE-Clears internal table data and reserved memory for internal table as well.

21. Events in interactive reports?


- AT LINE-SELECTION.
AT USER-COMMAND.
TOP-OF-PAGE DURING LINE SELECTION.
AT PF.
SET PF-STATUS.

Some of the system variables related to interactive report: -


1. SY-LSIND
2. SY-LISEL
3. SY-LILLI
4. SY-UCOMM
5. SY-LINNO
SY-LSIND: -
It’s the system variable which contains the current list index number.
SY-LISEL: -
It’s the system variable which contains the contents of the selected record.
SY-LILLI: -
It’s the system variable which contains the exact line number of the selected
record.
SY-UCOMM: -
It’s the system variable which contains the function code of the selected menu
item.

Interactive report :---

1)AT Line Selection: - This event is triggered whenever the user double clicks on
any list line.
To know the selected line contents, we have two keywords or statements

1)HIDE
2)GET CURSOR

HIDE: - It is a keyword which is used to hide the data into a temporarily memory
called as hide area for further processing.
We use the hide statement within the loop….end loop, so that the HIDE keyword
will hide the values into hide area.

GET CURSOR: - This statement is used to read or get the selected line content .
i.e. fieldname, field value into the variables.

Difference between HIDE and GET CURSORE

The main Advantage of get cursor is,


We don’t have any hide area or temporary memory
We can generate interactive report based on field name and field value
which is not possible with HIDE statement.
The other difference between hide and get cursor is,
with the hide statement the system uses line no and gets the value into
hide variable without knowing what is the fieldname.
Whereas the get cursor will get the exact field name and field value
with which we can generate various interactive reports based on filed names.

2)AT User command: - This event is triggered whenever the user clicks on custom GUI
buttons.

3)Top of page during line selection: - This event is used for providing the
constant page heading for all the secondary lists.

4)AT PF <Function Key>: - This event is used or triggered whenever the user clicks
on function keys (f1, f2, .etc)

--->Conversion Routine: - It is a function module which is used to convert a value


from internal format to external format and vice-versa.
Conversion exits are maintained at domain level.
Go to the domain and double click on conversion exit.
Conversion exit function module will be displayed.

FCT CODE (Function code):- It is a shortcut code assigned to a button or menu to


identify the button or menu which is clicked .
The FCT codes are automatically stored in a system variable SY-UCOMM.

22. What is HIDE technique?


- To capture the data of double clicked record in O/P at runtime.
23. What is GET CURSOR technique?
- To store the field name and it's value of double clicked field in O/P at runtime.

24. How to print only month in current date?


- Using string operations offset.
WRITE SY-DATUM+4(6).
SY-DATUM internal format is YYYYMMDD.

25. How interactive reports work?


- It works based on SY-LSIND.
SY-LSIND incremented by 1 for each interactive list, max 21 (1 Basic list + 20
Secondary Lists) lists allowed.

26. Modularization techniques?


- Include, Macros, Sub-routines, Function modules, Class-methods.

27. Types of sub-routines?


- Internal - Definition and calling both are in one program.
External - Definition in one program and calling in different program.

28. Types of function modules?


- Noramal: SAP to SAP, Pass by value or pass by reference.
- RFC: SAP to SAP, SAP to NON-SAP vice versa. Only pass by value.
- Update: SAP to SAP, Triggeres only at the time of SAVE - To avoid COMMIT in
enhancements .

29. What is V1,V2,V3 function modules?


- Checks priority and dependancies. I always use "Start Immediate" option.
If there are two FMs (FM1, FM2) are being called in a process and if there is a
case that FM2 has to be executed after FM1 then we will specify FM2 as V2/V3 type
(FM1 as V1).

TRFC - All TRFC (Transactional RFC) FMs will be executed in the target server
independently.
QRFC - QRFC came into picture to control the sequence (FIRST IN - FIRST OUT) of
the RFCs execution in the target server.

30. Difference between sub-routine and function module?


- We can't test sub-routine independently but we can test FM from SE37.
- Exceptions handling not possible in routines but available in FM.

ALV REPORTS

31. Events in ALV?


- TOP-OF-PAGE, TOP-OF-LIST, END-OF-PAGE, END-OF-LIST, USER-COMMAND, PF-STATUS-SET.

Function modules for developing ALV Reports :-


REUSE_ALV_GRID_DISPLAY -- Display ALV data in GRID format
REUSE_ALV_LIST_DISPLAY -- Display ALV data in LIST format
REUSE_ALV_COMMENTARY_WRITE -- Display TOP-OF-PAGE,LOGO,END-OF-LIST.
REUSE_ALV_FIELDCATELOG_MERGE --Generate field catalog automatically
REUSE_ALV_EVENTS_GET -- Display ALV Events
REUSE_ALV_HIERSEQ_LIST_DISPLAY --Display hierarchical ALV
REUSE_ALV_BLOCKED_LIST_DISPLAY --Display blocked ALV

--->what is alv report???


ALV stands for ABAP List Viewer. ALV gives us a standard List format and user
interface to all our ABAP reports.
ALV is created by a set of standard function modules provided by SAP.

Uses of ALV?????

-Sorting of records
-Filtering of records
-Totals and Sub-totals
-Download the report output to Excel/HTML
-Changing the order of the columns in the report
-Hide the unwanted columns from the report

--->What Is Slis In Alv And Standard Type Tables Of It?


Ans: SLIS is the type library for ALV grid.

-->In Alv's How Would You Get Default Values In The Selection Screen?

Ans: Create a variant in the ALV Report with whatever columns you would like to
see
and set sort criteria and column widths and save as a default variant.

ex:- You could get the default variant by calling FM


REUSE_ALV_VARIANT_DEFAULT_GET

31A) How do you insert header in ALV Reports.


-Step 1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'top-of-page' FORM
Step 2. Create 'top-of-page' FORM

The below code also shows you how to add a image to your ALV report.

call function 'REUSE_ALV_GRID_DISPLAY'


exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.

31.Are The Steps To Create Custom Table?


Create all the Domains and Data elements as needed using Txn SE11.
Start creating the table using Tcode SE11.
Maintain Delivery Class (A-Application Table, C-Customizing, etc)
Enter all the fields (MANDT must be the first field) and appropriate data elements
or Built in Types for each field.
Make sure you select the Primary Key for this table.
Maintain the Technical Settings (Data class, Size, Buffering info)
Create Secondary indexes as needed
Activate the Table

32. How do we handle events in ALV?


- Fill events internal table and pass to ALV FM.
- Events internal table contains 2 fields, event name and sub-routine name.
33. How to handle custom button to an ALV?
- Copy the standard ALV PF-STATUS and use USER-COMMAND event to handle the custom
button functionality.

34. Difference between ALV GRID and ALV LIST?


- GRID can supports OOPS ABAP but LIST does not support.
Logo is possible in GRID but not in LIST.
GRID will work only in foreground but LIST will work foreground and background
also.

35. How to add logo in ALV GRID?


- Reffering SLIS-LAYOUT or OAER pictures to be passed to REUSE_ALV_COMMENTARY_WRITE
FM in TOP_OF_PAGE event.

36. What is field catalog in ALV?


- To prepare column headings, positions, sub-total, grand total, colors, Edit, etc.

37. Types of ALVs?


- GRID/LIST, BLOCKED, HIERARCHICAL.

38. How hierarchical reports work?


- Using common field as KEY of HEADER & ITEM tables.

39. I want to change ALV O/P field value and update it in DB?
- Set field catalog EDIT to X and use USER-COMMAND event and add required logic in
the FORM routine.

40. I want to see the selected sales order details from ALV O/P (sales order is
available in O/P)?
- Use USER-COMMAND event,
SET PARAMETER ID,
Call transaction VA03.

41. How to capture the selected record values in ALV O/P?


- Using Importing structure SLIS_SELFIELD of USER_COMMAND event FORM, it contains
FIELDNAME and VALUE.

42. What is SY-SUBRC?


- It's a system variable which specifies the return code of the executable
statement.
If it's value is 0 then success otherthan 0 is fail.
This check is required when there a dependancy furthur.

44. What is the difference between SY-TABIX & SY-INDEX?


- SY-TABIX works in LOOP but SY-INDEX works in DO/WHILE.

45. What is the SCREEN element in reports?


- It's a system table with header that holds the I/P screen fields attributes.
When there is a need to modify the I/P screen fields properties like
HIDE/INVISIBLE/INPUT DISABLE
dynamically then we use this SCREEN MODIFICATIONS in AT SELECTION SCREEN OUTPUT
event.

46. What are the fields in SELECT-OPTIONS or RANGES?


- There are 4 fields - SIGN, OPTION, LOW, HIGH.

47. What is MODIF ID?


- When there is a need to modify I/P fields properties (HIDE/INVISIBLE) as a group
we use MODIF ID.

48. What is the difference between E and I/W messages?


- If it's E (Error) then process will stop there until we clear it where as I/W can
proceed further after the message and ENTER click.

49. How to get I/P fields side by side?


- Use BEGIN OF LINE and END OF LINE concept (Here field labels will be truncated so
need to provide labels explicitly).

50. What are SUBMIT & CONTINUE statements?


- SUBMIT is to call an executable program inside another executable program.
CONTINUE is to skip the further logic from that statement and go to the next
record in the iterations (LOOP).

51. How do you handle messages in reports?


- Create a message class in SE91 and use in program with MESSAGE-ID along with the
message numbers.

52. What is pre-requisite to use AT NEW or AT END OF?


- Make sure to have the <field> in extreme left in table fields, otherwise it
considers the combination.

53. How to find the number of records of an internal table?


- Use DESCRIBLE TABLE <IT> LINES <gv_count>.

54. How to delete duplicates in an internal table?


- 1st SORT the table based on the requirement.
Use the syntax of DELETE ADJUSANT DUPLICATES FROM <IT> COMPARING <field>.

55. What is the difference between IF and CASE?


- IF stops in every ELSE (step by step check) but CASE directly goes to the
satisfied condition.

56. How to get F4 help of an I/P field?


- Refer the I/P field to the data element if F4 does not exist then use the event
AT SELECTION SCREEN ON <field> FOR VALUE-REQUEST.

57. How to remove range (HIGH) of SELECT-OPTIONS field?


- Use NO INTERVALS to remove HIGH values and use NO-EXTENSION to remove multiple
options.

58. How to make an I/P as mandatory dynamically?


- Use the event AT SELECTION SCREEN OUTPUT and LOOP the SCREEN and change SCREEN
field property to REQUIRED = 1 and MODIFY SCREEN or
Write the logic in START-OF-SELECTION event to check NOT INITIAL and throw error
message.

59. What will happen if I don't specify the events in a program?


- Everything will be executed under START-OF-SELECTION event.
START-OF-SELECTION is the default event in reports.

59A)No need to write END-OF-SELECTION? WHY?


Report dont need any event to execute the output.It we put start-of-selection
there is no compulsory to use end-of-selection.
End-of-selection is used when we want to execute some output even when some
exception occurs to skip start-of-selection.
60. What is the screen number of a report program?
- Every report program will be created under screen number 1000 by system.

60A. Can we down load and Upload a form? How?


-Run Program RSTXSCRP using SE38 and Download and upload.

61) Classical reports


ALV Reports
1. Simple reports using the WRITE statements within the loops.

1. The system generated Functions start with REUSE* are used to display the data.

=================================================================

2. Performance is not as good as ALV Reports since the LOOP statement must be used
to display the data.

2. Performance is good since the data is displayed using the function modules
outside of the loops.

=================================================================

3. Not possible to edit the Fields in the Output.

3. It can be possible to edit the Fields in the Output.

=============================================================

4. It is difficult to display the LOGOS in the output.

4. It is so EASY to display the LOGOS in the output.

==========================================================

5. It is COMPLEX to Align the Columns.

5. Column Alignment is done by the system.

You might also like