Академический Документы
Профессиональный Документы
Культура Документы
1 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
INTERACTIVE REPORTS
*****Simple Interactive Report *******
REPORT ZREP_0012 NO STANDARD PAGE HEADING line-count 30(2).
data : it_spfli type table of spfli,
wa_spfli type spfli.
start-of-selection.
select * from spfli into table it_spfli.
end-of-selection.
loop at it_spfli into wa_spfli.
write : /1 wa_spfli-carrid,
6 wa_spfli-connid,
12 wa_spfli-COUNTRYFR,
22 wa_spfli-COUNTRYTO,
32 wa_spfli-AIRPFROM,
42 wa_spfli-AIRPTO,
52 wa_spfli-CITYFROM,
62 wa_spfli-cityto.
endloop.
top-of-page.
write : /1 'CARRID',
10 'CONNID',
20 'COUNTRY FROM',
30 'COUNTRY TO',
40 'AIR FROM',
50 'AIRP TO',
60 'CITY FROM',
70 'CITY TO'.
ULINE /1(75).
end-of-page.
WRITE : / 'FLIGHT DETAILS '.
ULINE /1(75).
AT LINE-SELECTION. " Events Triggers when the user double clicks on the list
WRITE : / 'INTERACTIVE REPORT =', SY-LSIND.
********Interactive report Using SY_LSIND *******
report zinteractive_rep1 no standard page heading line-count 15(2).
data : it_spfli type table of spfli,
5/22/2015 12:24 AM
INTERACTIVE REPORTS
2 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
3 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
4 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
5 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
write :/ wa_sflight-carrid,
wa_sflight-connid,
wa_sflight-fldate,
wa_sflight-price,
wa_sflight-seatsmax,
wa_sflight-seatsocc.
hide : wa_sflight-carrid. " Hiding CARRID value from
table
endloop.
endif.
"SFLIGHT
when '2'.
select * from sbook into table it_sbook
where carrid = wa_sflight-carrid.
if it_sbook is not initial.
loop at it_sbook into wa_sbook.
write :/ wa_sbook-carrid,
wa_sbook-connid,
wa_sbook-fldate,
wa_sbook-bookid,
wa_sbook-customid,
wa_sbook-custtype.
endloop.
endif.
endcase.
top-of-page during line-selection.
case sy-lsind.
when '1'.
write :/ 'details from sflight table'.
when '2'.
write :/ 'details from sbook table'.
endcase.
uline.
*******Interactive Report using SY-LISEL technique**********
REPORT YSP_0123 NO STANDARD PAGE HEADING.
DATA : IT_VBAK TYPE TABLE OF VBAK,
WA_VBAK TYPE VBAK,
IT_VBAP TYPE TABLE OF VBAP,
WA_VBAP TYPE VBAP.
SELECT-OPTIONS : S_VBELN FOR WA_VBAK-VBELN.
DATA : D_VBELN TYPE VBELN.
START-OF-SELECTION.
5/22/2015 12:24 AM
INTERACTIVE REPORTS
6 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
7 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
8 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
WRITE : /1 WA_SFLIGHT-CARRID,
10 WA_SFLIGHT-CONNID,
20 WA_SFLIGHT-FLDATE,
30 WA_SFLIGHT-PRICE LEFT-JUSTIFIED,
45 WA_SFLIGHT-SEATSMAX,
55 WA_SFLIGHT-SEATSOCC.
ENDLOOP.
ELSE.
WRITE : / 'NO RECORDS FOUND'.
ENDIF.
ENDCASE.
**********Interactive Report using SY_LISEL Technique **********
report zinteractive_rep4 no standard page heading line-count 15(2).
data : carr type char3.
data : it_spfli type table of spfli,
wa_spfli type spfli.
data : it_sflight type table of sflight,
wa_sflight type sflight.
data : it_sbook type table of sbook,
wa_sbook type sbook.
select-options : p_carrid for wa_spfli-carrid.
start-of-selection.
select * from spfli into table it_spfli
where carrid in p_carrid.
end-of-selection.
loop at it_spfli into wa_spfli.
write :/ wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-countryfr,
wa_spfli-countryto,
wa_spfli-cityfrom,
wa_spfli-cityto,
wa_spfli-airpfrom,
wa_spfli-airpto.
clear wa_spfli.
endloop.
top-of-page.
write :/ 'details from spfli table'.
uline.
5/22/2015 12:24 AM
INTERACTIVE REPORTS
9 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
end-of-page.
write :/ 'thanks visit again'.
uline.
at line-selection.
case sy-lsind.
when '1'.
carr = sy-lisel+0(2).
select * from sflight into table it_sflight
where carrid = carr.
clear carr.
if it_sflight is not initial.
loop at it_sflight into wa_sflight.
write :/ wa_sflight-carrid,
wa_sflight-connid,
wa_sflight-fldate,
wa_sflight-price,
wa_sflight-seatsmax,
wa_sflight-seatsocc.
clear wa_sflight.
endloop.
endif.
when '2'.
carr = sy-lisel+0(2).
select * from sbook into table it_sbook
where carrid = carr.
if it_sbook is not initial.
loop at it_sbook into wa_sbook.
write :/ wa_sbook-carrid,
wa_sbook-connid,
wa_sbook-fldate,
wa_sbook-bookid,
wa_sbook-customid,
wa_sbook-custtype.
clear wa_sbook.
endloop.
endif.
endcase.
top-of-page during line-selection.
case sy-lsind.
when '1'.
write :/ 'details from sflight table'.
when '2'.
write :/ 'details from sbook table'.
5/22/2015 12:24 AM
INTERACTIVE REPORTS
10 of 19
endcase.
uline.
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
11 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
ULINE /1(75).
AT LINE-SELECTION.
GET CURSOR FIELD FNAME VALUE FVALUE.
CASE SY-LSIND.
WHEN '1'.
IF FNAME = 'WA_SPFLI-CARRID'.
SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT
WHERE CARRID = FVALUE.
ENDIF.
LOOP AT IT_SFLIGHT INTO WA_SFLIGHT.
WRITE : /1 WA_SFLIGHT-CARRID,
10 WA_SFLIGHT-CONNID,
20 WA_SFLIGHT-FLDATE,
30 WA_SFLIGHT-PRICE LEFT-JUSTIFIED,
45 WA_SFLIGHT-SEATSMAX,
55 WA_SFLIGHT-SEATSOCC.
ENDLOOP.
ENDCASE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE SY-LSIND.
WHEN '1'.
WRITE : /1 'CARRID',
10 'CONNID',
20 'FLDATE',
30 'PRICE',
40 'MAX SEAT',
50 'AVAI SEAT'.
ENDCASE.
********* INTERACTIVE REPORT(2) ON GET CURSOR TECHNIQUE
***************
.
DATA : IT_VBAK TYPE TABLE OF VBAK,
WA_VBAK TYPE VBAK,
IT_VBAP TYPE TABLE OF VBAP,
WA_VBAP TYPE VBAP.
SELECT-OPTIONS : S_VBELN FOR WA_VBAK-VBELN.
DATA : V_VALUE TYPE VBELN.
DATA F_NAME(15) TYPE C.
5/22/2015 12:24 AM
INTERACTIVE REPORTS
12 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
START-OF-SELECTION.
SELECT * FROM VBAK INTO TABLE IT_VBAK WHERE VBELN IN S_VBELN.
SORT IT_VBAK BY VBELN.
END-OF-SELECTION.
IF IT_VBAK IS NOT INITIAL.
LOOP AT IT_VBAK INTO WA_VBAK.
WRITE : /1 WA_VBAK-VBELN,
10 WA_VBAK-ERDAT,
20 WA_VBAK-ERNAM,
30 WA_VBAK-NETWR,
40 WA_VBAK-ANGDT.
ENDLOOP.
ENDIF.
AT LINE-SELECTION.
GET CURSOR FIELD F_NAME VALUE V_VALUE.
IF SY-LSIND = 1.
IF F_NAME = 'WA_VBAK-VBELN'.
WRITE : 'TESTING GET CURSOR'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT
= V_VALUE
IMPORTING
OUTPUT
= V_VALUE
.
SELECT * FROM VBAP INTO TABLE IT_VBAP
WHERE VBELN = V_VALUE.
IF IT_VBAP IS NOT INITIAL.
LOOP AT IT_VBAP INTO WA_VBAP.
WRITE : /1 WA_VBAP-VBELN,
10 WA_VBAP-POSNR,
20 WA_VBAP-MATNR,
30 WA_VBAP-MATKL.
ENDLOOP.
ENDIF.
ENDIF.
********** INTERACTIVE REPORT(3) ON GET CURSOR TECHNIQUE ********
5/22/2015 12:24 AM
INTERACTIVE REPORTS
13 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
14 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
15 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
16 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
wa_sflight-fldate,
wa_sflight-price,
wa_sflight-seatsmax,
wa_sflight-seatsocc.
clear wa_sflight.
endloop.
endif.
ENDIF.
when '2'.
IF NAME = 'WA_SFLIGHT-CARRID'.
select * from sbook into table it_sbook where CARRID = VAL.
if it_sbook is not initial.
loop at it_sbook into wa_sbook.
write :/ wa_sbook-carrid,
wa_sbook-connid ,
wa_sbook-fldate,
wa_sbook-bookid,
wa_sbook-customid,
wa_sbook-custtype.
clear wa_sbook.
endloop.
endif.
ENDIF.
endcase.
top-of-page during line-selection.
case sy-lsind.
when '1'.
write :/ 'details from sflight table'.
when '2'.
write :/ 'details from sbook table'.
endcase.
uline.
AT USER-COMMAND. " FUNCTION CODE -' PICK' FOR F2-CHOOSE FOR
CLICK EVENT SET IN PF STATUS
CASE SY-UCOMM.
WHEN 'DICT'.
CALL TRANSACTION 'SE11'.
WHEN 'WORK'.
CALL TRANSACTION 'SE80'.
ENDCASE.
" DOUBLE
******** CALLING A REPORT PROGRAM WITHIN A REPORT PROGRAM WITH SUBMIT STATEMENT ********
REPORT ZREP_0017 NO STANDARD PAGE HEADING LINE-COUNT 35(2).
5/22/2015 12:24 AM
INTERACTIVE REPORTS
17 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
5/22/2015 12:24 AM
INTERACTIVE REPORTS
18 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
CASE SY-LSIND.
WHEN '1'.
SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT
WHERE CARRID =
WA_SPFLI-CARRID.
LOOP AT IT_SFLIGHT INTO WA_SFLIGHT.
WRITE :/1 WA_SFLIGHT-CARRID,
10 WA_SFLIGHT-CONNID,
20 WA_SFLIGHT-FLDATE.
ENDLOOP.
WHEN '2'.
SUBMIT ZREP_0018. " (DOUBLE CLICK ON THE NAME 'ZREP_0018' AND CREATE A REOPRT
PROGRAM . WHEN THE USER DOUBLE CLICKS ON THE FIRST INERACTIVE LIST , THEN THE
CONTROL IS TRANSFERRED TO THIS PROGRAM.) "
ENDCASE.
Posted 27th May 2012 by S Prasad
13
View comments
5/22/2015 12:24 AM
INTERACTIVE REPORTS
19 of 19
http://freesapabap.blogspot.in/2012/05/abap-interactive-reports.html
7 comments
Top comments
5/22/2015 12:24 AM