20/02/2025
ASSIGNMENT QUESTIONS
1- What is an interactive report.
2- What is the use of interactive report.
3- What is the event used in interactive report explain that.
4- Create interactive report using VBRK and VBRP table new syntax with
hide syntax up to 10 rows.
5- What is get cursor field technique and its use.
6- List down the system variables available in the interactive report and
its uses.
7- How many lists are available for the system variables.
8- What system field do we use for interactive reporting?
9- Create an interactive report using get cursor technique and use top of
page and end of page events for example it is a basic list it shows the
VBRK (master data).
Table and if it is a secondary list, it shows VBRP (item data). In each
page show only 15 records. And it is tabular format maintain the
top-of-page during line selection and end of selection during line
selection. In end of selection show the output using colors and
borders.
ANSWERS
1. What is an interactive report?
It is one of the types of reports which is used to interact with the
output.
Interactive reporting allows the user to participate in retrieving and
presenting data at each level during the session
2. What is the use of interactive report.
Interactive reports enable users to interact with the data in real-time,
allowing for deeper exploration and analysis. Users can filter and sort
the data based on their specific needs.
It helps you to create easy-to-read lists. You can display an overview
list first that contains general information and provide the user with
the possibility of choosing detailed information that you display on
further lists.
3. What is the event used in interactive report explain that.
In the interactive report we have 2 types of events.
1- At line-selection
2- At user-selection
At line-selection
This event will trigger whenever the user double clicks on any list line.
This is used to generate a secondary list. whenever user double clicks
on any value.
At user-selection
This event will trigger whenever user clicks on any custom buttons of
the GUI. To perform the user actions on the screen.
At PF Status. This event will trigger whenever user clicks on any
function buttons.
Top of Page during Line Selection. This is used to print headings
for secondary lists in interactive reports.
Set Pf. To add GUI status.
4. Create interactive report using VBRK and VBRP table new
syntax with hide syntax up to 10 rows.
load-OF-PROGRAM.
types: BEGIN OF ty_mara, matnr TYPE matnr , " material number ersda
TYPE ersda , " release date mtart type mtart , " material type mbrsh
TYPE mbrsh , " idustry type matkl type matkl , END OF ty_mara .
DATA: lt_mara TYPE TABLE OF ty_mara,
ls_mara TYPE ty_mara .
" lt_table TYPE TABLE of string.
PARAMETERS: r1 RADIOBUTTON GROUP abc DEFAULT 'X' USER-
COMMAND x, r2 RADIOBUTTON GROUP abc.
DATA(lv1) = '1'.
DATA(lv2) = '3'.
INITIALIZATION.
PARAMETERS: p_mtart TYPE mara-mtart MODIF ID par. SELECT-
OPTIONS: s_ersda FOR ls_mara-ersda MODIF ID sel.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF r1 = 'X'.
IF screen-group1 = 'SEL'.
screen-active = 0.
MODIFY SCREEN.
ELSEIF screen-group1 = 'par'.
"nothing.
ENDIF.
ELSEIF r2 = 'X'. IF screen-group1 = 'PAR'. screen-active = 0. MODIFY
SCREEN.
ELSEIF screen-group1 = 'sel'.
"nothing
ENDIF.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
START-OF-SELECTION. IF r1 = 'X'.
SELECT FROM mara
FIELDS matnr,
ersda,
mtart,
mbrsh,
matkl
WHERE mtart = @p_mtart ORDER BY matnr
INTO TABLE @lt_mara.
ELSEIF r2 = 'X'. SELECT FROM mara FIELDS matnr, ersda, mtart,
mbrsh, matkl WHERE ersda in @s_ersda ORDER BY matnr INTO TABLE
@lt_mara.
ENDIF.
WRITE: 'MATERIAL NUMBER', 40 'CREATION DATE',60 'MATERIAL TYPE',
80 'IND SECTOR', 100 'MATERIAL GROUP'. SKIP 3. LOOP AT lt_mara
INTO ls_mara.
WRITE: / ls_mara-matnr COLOR 1, 40 sy-vline,
ls_mara-ersda COLOR 2, 60 sy-vline,
ls_mara-mtart COLOR 3, 80 sy-vline,
ls_mara-mbrsh COLOR 4, 100 sy-vline,
ls_mara-matkl COLOR 5, 120 sy-vline.
uline 1(120).
HIDE: ls_mara.
ENDLOOP.
at LINE-SELECTION.
BREAK-POINT.
5. What is get cursor field technique and its use.
This statement transfers the name of the screen element on which the
cursor is positioned during a user action into the variable. If the cursor
is on a field, the system sets SY-SUBRC to 0, otherwise to 4.
get cursor is used to store the value of the field on which the cursor is
placed.
Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass
the output field or output line on which the cursor was positioned
during the interactive event to the ABAP program.
6. List down the system variables available in the interactive
report and its uses.
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.
SY-LINNO: - It’s the system variable which contains the line number
of the last record display
7. How many lists are available for the system variables.
List in interactive report.
Basic List: - in interactive report one we interact with the output on
basic list and it take us to the secondary list. basic list is the list which
is generated at first by our ABAP program only 1 basic list
Secondary list: - secondary lists are generated by further navigation
or user selection from the basic list.
We can create 20 secondary lists.
8. Create an interactive report using get cursor technique and
use top of page and end of page events for example it is a
basic list it shows the VBRK (master data) Table and if it is a
secondary list, it shows VBRP (item data). In each page show only 15
records. And it is tabular format maintain the top-of-page during line
selection and end of selection during line selection. In end of selection
show the output using colors and borders.
REPORT ZVD_RP_INTRP3.
TYPES: BEGIN OF ty_mara,
matnr TYPE matnr,
ersda TYPE ersda,
mtart TYPE mtart,
mbrsh TYPE mbrsh,
matkl TYPE matkl,
END OF ty_mara.
DATA: lt_mara TYPE TABLE OF ty_mara,
ls_mara TYPE ty_mara.
DATA: lv_field_name TYPE string,
lv_field_value TYPE string.
*DATA: lv_timestamp TYPE timestamp.
"CONVERT DATE sy-datum TIME sy-timlo INTO TIME STAMP lv_timestamp
TIME ZONE sy-zonlo.
START-OF-SELECTION.
SELECT FROM mara
FIELDS matnr,
ersda,
mtart,
mbrsh,
matkl
ORDER BY matnr
INTO TABLE @lt_mara.
* WRITE: 'MATERIAL NUMBER', 40 'CREATION DATE',60 'MATERIAL TYPE', 80
'IND SECTOR', 100 'MATERIAL GROUP'.
LOOP AT lt_mara INTO ls_mara.
" BREAK-POINT.
WRITE: / ls_mara-matnr COLOR 5,sy-vline,
40 ls_mara-ersda COLOR 4,sy-vline,
60 ls_mara-mtart COLOR 3,sy-vline,
80 ls_mara-mbrsh COLOR 2, sy-vline,
100 ls_mara-matkl COLOR 1,sy-vline.
ENDLOOP.
AT LINE-SELECTION.
GET CURSOR FIELD lv_field_name VALUE lv_field_value.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = lv_field_value
IMPORTING
output = lv_field_value
EXCEPTIONS
length_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
" Implement suitable error handling here
ENDIF.
IF sy-lsind = 1.
IF lt_mara IS NOT INITIAL.
SELECT FROM marc
FIELDS matnr,
werks
WHERE matnr = @lv_field_value
INTO TABLE @DATA(lt_marc).
LOOP AT lt_marc INTO DATA(ls_marc).
WRITE : ls_marc-matnr, ls_marc-werks.
ENDLOOP.
ENDIF.
ENDIF.
TOP-OF-PAGE.
WRITE: 'MATERIAL NUMBER', 40 'CREATION DATE',60 'MATERIAL TYPE', 80
'IND SECTOR', 100 'MATERIAL GROUP'.
end-of-PAGE.
WRITE: / 'username : ',sy-uname, " gives the user name
/ 'Date : ',sy-datum , " gives the date
/ 'Time : ', sy-uzeit . " gives the time.