*****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,
wa_spfli type spfli.
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.
endloop.
top-of-page.
write :/ 'flight details'.
uline.
end-of-page.
write :/ 'thanks visit again'.
uline.
at line-selection. " event triggers when user double clicks on the basic list
case sy-lsind. " sy-lsind - list index system variable
when '1'.
write :/ 'this is secondary list number =', sy-lsind.
when '2'.
write :/ 'this is secondary list number =', sy-lsind.
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 with HIDE Technique*******
report zinteractive_rep2 no standard page heading line-count 15(2).
data : it_spfli type table of spfli,
wa_spfli type spfli.
data : it_sflight type table of sflight,
wa_sflight type sflight.
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.
hide : wa_spfli-carrid. " hiding value of carrid in the hide Area
endloop.
top-of-page.
write :/ 'details from spfli table'.
uline.
end-of-page.
write :/ 'thanks visit again'.
uline.
at line-selection. " event triggers when the user double clicks on the basic list
case sy-lsind.
when '1'.
select * from sflight into table it_sflight where carrid = wa_spfli-carrid.
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.
endloop.
endif.
endcase.
top-of-page during line-selection.
case sy-lsind.
when '1'.
write :/ 'details from sflight table'.
endcase.
uline.
********Interactive report using HIDE Technique *********
report zinteractive_rep3 no standard page heading line-count 15(2).
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.
hide : wa_spfli-carrid. " Hiding CARRID Value From SPFLI table
endloop.
top-of-page.
write :/ 'details from spfli table'.
uline.
end-of-page.
write :/ 'thanks visit again'.
uline.
at line-selection.
case sy-lsind.
when '1'.
select * from sflight into table it_sflight where carrid = wa_spfli-carrid.
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.
hide : wa_sflight-carrid. " Hiding CARRID value from "SFLIGHT table
endloop.
endif.
when '2'.
select * from sbook into table it_sbook
where carrid = wa_sflight-carrid.
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.
SELECT * FROM VBAK INTO TABLE IT_VBAK WHERE VBELN IN S_VBELN.
SORT IT_VBAK BY VBELN.
END-OF-SELECTION.
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.
AT LINE-SELECTION.
IF SY-LSIND = 1.
WRITE : / 'INTERACTIVE LIST', SY-LISEL. " sy-lisel - holds the "content of the line on which the user double clicked on the "basic list
D_VBELN = SY-LISEL+0(4).
SELECT * FROM VBAP INTO TABLE IT_VBAP WHERE VBELN = D_VBELN.
IF SY-SUBRC = 0.
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.
**********Interactive report using SY-LISEL Technique with HOT-SPOT ON ***********
REPORT ZREP_0015 NO STANDARD PAGE HEADING LINE-COUNT 30(2).
DATA : VAL TYPE C LENGTH 2.
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 : S_CARRID FOR WA_SPFLI-CARRID
DEFAULT 'AA' TO 'ZZ'.
start-of-selection.
select * from spfli into table it_spfli
WHERE CARRID IN S_CARRID..
WHERE CARRID IN S_CARRID..
end-of-selection.
loop at it_spfli into wa_spfli.
write : /1 wa_spfli-carrid HOTSPOT ON,
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.
CASE SY-LSIND.
WHEN 1.
VAL = SY-LISEL+0(2).
SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT
WHERE CARRID = VAL.
WHERE CARRID = VAL.
IF SY-SUBRC = 0.
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.
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.
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.
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.
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.
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'.
endcase.
uline. .*********INTERACTIVE REPORTING(1) USING GET CURSOR TECHNIQUE **********
REPORT ZREP_0014 NO STANDARD PAGE HEADING line-count 30(2)
DATA : FNAME TYPE C LENGTH 20,
FVALUE TYPE C LENGTH 20. .
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 : S_CARRID FOR WA_SPFLI-CARRID DEFAULT 'AA' TO 'ZZ'.
start-of-selection.
select * from spfli into table it_spfli
WHERE CARRID IN S_CARRID..
WHERE CARRID IN S_CARRID..
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.
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.
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.
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.
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 ********
report zinteractive_rep5 no standard page heading line-count 15(2).
data : name type c length 20,
val type c length 20.
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.
where carrid in p_carrid.
end-of-selection.
loop at it_spfli into wa_spfli.
write :/ wa_spfli-carrid HOTSPOT ON,
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.
end-of-page.
write :/ 'thanks visit again'.
uline.
at line-selection.
get cursor field name value val.
case SY-LSIND.
when '1'.
IF NAME = 'WA_SPFLI-CARRID'.
select * from sflight into table it_sflight
where carrid = val.
where carrid = val.
if it_sflight is not initial.
loop at it_sflight into wa_sflight.
write :/ wa_sflight-carrid HOTSPOT ON,
wa_sflight-connid,
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.
******INTERACTIVE REPORT WITH GET CURSOR AND USER-COMMAND *************
report zinteractive_rep6 no standard page heading line-count 15(2).
data : name type c length 20,
val type c length 20.
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.
SET PF-STATUS 'STATUS1'. " Create Two buttons 'DICT' and 'WORK'
select * from spfli into table it_spfli
where carrid in p_carrid.
where carrid in p_carrid.
end-of-selection.
loop at it_spfli into wa_spfli.
write :/ wa_spfli-carrid HOTSPOT ON,
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.
end-of-page.
write :/ 'thanks visit again'.
uline.
at line-selection.
get cursor field name value val.
case SY-LSIND.
when '1'.
IF NAME = 'WA_SPFLI-CARRID'.
select * from sflight into table it_sflight where carrid = val.
if it_sflight is not initial.
loop at it_sflight into wa_sflight.
write :/ wa_sflight-carrid HOTSPOT ON,
wa_sflight-connid,
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 " DOUBLE CLICK EVENT SET IN PF STATUS
CASE SY-UCOMM.
WHEN 'DICT'.
CALL TRANSACTION 'SE11'.
WHEN 'WORK'.
CALL TRANSACTION 'SE80'.
ENDCASE.
******** CALLING A REPORT PROGRAM WITHIN A REPORT PROGRAM WITH SUBMIT STATEMENT ********
REPORT ZREP_0017 NO STANDARD PAGE HEADING LINE-COUNT 35(2).
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 : S_CARRID FOR WA_SPFLI-CARRID
DEFAULT 'AA' TO 'ZZ'.
start-of-selection.
select * from spfli into table it_spfli
WHERE CARRID IN S_CARRID.
WHERE CARRID IN S_CARRID.
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.
HIDE : WA_SPFLI-CARRID.
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.
CASE SY-LSIND.
WHEN '1'.
SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT
WHERE CARRID =
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.
6 comments:
Great job ,,,, Really Appreciated :)
very well documented . . . i have been searching for something list this.
very good article......
THNX THNX THNX DEAR VERY HELPFUL ... :) :) :)
EVERY STUDENT WANTS THIS TYPE OF EXAMPLE :) :D
nice bro............and i want different oops alv reports also...........plz put that also bro........
can u plz provide ppts on interactive reports
Post a Comment