2008 Jul 01 6:54 AM
experts,
i have used funtion module 'REUSE_ALV_BLOCK_LIST_DISPLAY' to display a list in an alv format and passed the following parameters I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 10
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 100
.
to specify the size of the list.
the problem is when i try to close the list or come back to the original program no function is working ,how to close the list and come back to the original program.
thanks and regards
experts,
i have used funtion module 'REUSE_ALV_BLOCK_LIST_DISPLAY' to display a list in an alv format and passed the following parameters I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 10
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 100
.
to specify the size of the list.
the problem is when i try to close the list or come back to the original program no function is working ,how to close the list and come back to the original program.
thanks and regards
2008 Jul 01 7:14 AM
&----
*& Report ZTEST_ALV
*&
&----
*&
*&
&----
REPORT ZTEST_ALV.
TYPE-POOLS: SLIS.
DATA: XFIELD TYPE SLIS_T_FIELDCAT_ALV.
DATA: AFIELD TYPE SLIS_FIELDCAT_ALV.
DATA: GT_PRINT TYPE SLIS_PRINT_ALV.
DATA: X_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: GT_XEVENTS TYPE SLIS_T_EVENT.
DATA: REPID LIKE SY-REPID.
DATA: IT_MARA TYPE TABLE OF MARA.
REPID = SY-REPID.
*Form Field Catalogue.
AFIELD-COL_POS = 1.
AFIELD-FIELDNAME = 'MATNR'.
AFIELD-REF_TABNAME = 'MARA'.
AFIELD-KEY = 'X'. "define field as key
APPEND AFIELD TO XFIELD.
AFIELD-COL_POS = 2.
AFIELD-FIELDNAME = 'MTART'.
AFIELD-REF_TABNAME = 'MARA'.
AFIELD-KEY = ' '. "define field as key
APPEND AFIELD TO XFIELD.
*To Get some Data In Internal table.
select * from MARA INTO TABLE IT_MARA UP TO 10 ROWS.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IT_FIELDCAT = XFIELD
IS_LAYOUT = X_LAYOUT
I_TABNAME = 'IT_MARA'
IT_EVENTS = GT_XEVENTS
TABLES
T_OUTTAB = IT_MARA.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IT_FIELDCAT = XFIELD
IS_LAYOUT = X_LAYOUT
I_TABNAME = 'IT_MARA'
IT_EVENTS = GT_XEVENTS
TABLES
T_OUTTAB = IT_MARA.
GT_PRINT-RESERVE_LINES = 1.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
IS_PRINT = GT_PRINT.
Hope it helps you
2008 Jul 01 7:37 AM
Hi buddy...
I think u have used this block of code but forgot to create the PF-status...I mean with buttons like back...
Or else if u have not put on this peice of code then do so and dob't forget to create the PF-status...
call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = pfstatus.
Iam putting the full version for your reference:
report ZTEST_DEEP_SEL no standard page heading.
* Type-pool enthält Feldkatalogstruktur
type-pools: slis.
* Includes
include <icon>.
include <symbol>.
* Interne Tabelle für Feldkatalog
data: lfield type slis_t_fieldcat_alv.
data: xfield type slis_t_fieldcat_alv.
data: yfield type slis_t_fieldcat_alv.
data: zfield type slis_t_fieldcat_alv.
data: hfield type slis_t_fieldcat_alv.
* Kopfzeile zum Feldkatalog
data: afield type slis_fieldcat_alv.
* Special Groups
data: gt_sp_groups type slis_t_sp_group_alv with header line.
* Zwischensummen und Sortierung
data: gt_zsum type slis_t_sortinfo_alv with header line.
* Filterbedingungen
data: gt_filter type slis_t_filter_alv with header line.
* iTab für Kopfinformationen zur Liste
data: xheader type slis_t_listheader with header line.
* Layoutstruktur
data: gs_layout type slis_layout_alv.
data: x_layout type slis_layout_alv.
data: y_layout type slis_layout_alv.
data: z_layout type slis_layout_alv.
data: h_layout type slis_layout_alv.
data: l_layout type slis_layout_alv.
* Keyinfo
data: gs_keyinfo type slis_keyinfo_alv.
* Excludingtabelle
data: gt_extab type slis_t_extab with header line.
* Layoutstruktur
data: xisetab type slis_seldis_alv.
* Events
data: gt_xevents type slis_t_event.
data: gt_yevents type slis_t_event.
data: gt_zevents type slis_t_event.
data: gt_hevents type slis_t_event.
data: gt_levents type slis_t_event.
data: gt_print type slis_print_alv.
* OK_Code für Layoutpopup
data: ok_code like sy-ucomm.
data: flg_exit(1) type c. " Abbruch des Layoutpopups.
* Farbtabelle für Zelleneinfärbungen
data: gt_color type slis_t_specialcol_alv with header line.
tables: scarr, spfli, sbook.
* Interne Struktur mit Obermenge der möglichen Ausgabefelder
data: begin of xdata occurs 1,
carrid like scarr-carrid,
carrname like scarr-carrname,
currcode like scarr-currcode,
blubber like ltdxt-text,
numc(3) type n, " ohne DDIC-Bezug!
icons(30) type c, " ohne DDIC-Bezug!
symbols(30) type c,
ampel(1) type c,
box(1) type c,
listinfo(3) type c,
* COLINFO TYPE SLIS_T_SPECIALCOL_ALV,
end of xdata.
* Interne Struktur mit Obermenge der möglichen Ausgabefelder
data: begin of ydata occurs 1.
include structure spfli.
data: blubber like ltdxt-text,
numc(3) type n, " ohne DDIC-Bezug!
icons(30) type c, " ohne DDIC-Bezug!
symbols(30) type c,
ampel(1) type c,
box(1) type c,
listinfo(3) type c,
colinfo type slis_t_specialcol_alv,
end of ydata.
data: begin of zdata occurs 1.
include structure sbook.
data: blubber like ltdxt-text,
numc(3) type n, " ohne DDIC-Bezug!
icons(30) type c, " ohne DDIC-Bezug!
symbols(30) type c,
ampel(1) type c,
box(1) type c,
listinfo(3) type c,
colinfo type slis_t_specialcol_alv,
end of zdata.
data: hdata like xdata occurs 0 with header line.
data: ldata like xdata occurs 0 with header line.
data: idata like ydata occurs 0 with header line.
data:
g_exit,
x_save,
default,
x_variant like disvariant,
xs_layout like gs_layout,
xs_event type slis_alv_event,
gt_spfli like spfli occurs 0 with header line,
g_variant like disvariant.
* Report selection
select-options carrid for scarr-carrid.
data: repid like sy-repid.
parameters: pfstatus type slis_formname default 'PF_STATUS_SET'.
parameters: hiersequ as checkbox default 'X'.
parameters: box_tabl(5) default 'IDATA'.
parameters: max_data as checkbox default ' '.
*-----------------------------------------------------------------------
initialization.
repid = sy-repid.
start-of-selection.
perform selection.
perform xevents.
perform levents.
perform yevents.
perform zevents.
perform hevents.
perform fields.
*
call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = pfstatus.
*
x_layout-box_fieldname = 'BOX'.
x_layout-box_tabname = 'XDATA'.
x_layout-lights_fieldname = 'AMPEL'.
x_layout-info_fieldname = 'LISTINFO'.
*
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
it_fieldcat = xfield
is_layout = x_layout
i_tabname = 'XDATA'
it_events = gt_xevents
i_text = text-0b1
tables
t_outtab = xdata.
*
if hiersequ = space.
* y_layout-no_zebra = 'X'.
y_layout-box_fieldname = 'BOX'.
y_layout-box_tabname = 'YDATA'.
y_layout-info_fieldname = 'LISTINFO'.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
it_fieldcat = yfield
is_layout = y_layout
i_tabname = 'YDATA'
it_events = gt_yevents
i_text = text-0b2
tables
t_outtab = ydata.
else.
* h_layout-no_zebra = 'X'.
h_layout-box_fieldname = 'BOX'.
h_layout-box_tabname = box_tabl.
h_layout-info_fieldname = 'LISTINFO'.
gs_keyinfo-header01 = 'CARRID'.
gs_keyinfo-item01 = 'CARRID'.
gs_keyinfo-item02 = 'CONNID'.
call function 'REUSE_ALV_BLOCK_LIST_HS_APPEND'
exporting
is_layout = h_layout
it_fieldcat = hfield
is_keyinfo = gs_keyinfo
i_header_tabname = 'HDATA'
i_item_tabname = 'IDATA'
it_events = gt_hevents
i_text = text-0b2
tables
t_outtab_header = hdata
t_outtab_item = idata.
endif.
*
* z_layout-no_zebra = 'X'.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
it_fieldcat = zfield
is_layout = z_layout
i_tabname = 'ZDATA'
it_events = gt_zevents
i_text = text-0b3
tables
t_outtab = zdata.
*
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
it_fieldcat = lfield
is_layout = l_layout
i_tabname = 'LDATA'
it_events = gt_levents
i_text = text-0b4
tables
t_outtab = ldata.
*
gt_print-reserve_lines = 2.
call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
exporting
is_print = gt_print.
*---------------------------------------------------------------------*
* FORM FIELDS *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form fields.
data: l_count type i.
*
clear afield.
l_count = l_count + 1.
afield-col_pos = l_count.
afield-fieldname = 'CARRID'.
* AFIELD-TABNAME = 'XDATA'.
afield-ref_tabname = 'SCARR'.
afield-key = 'X'. "define field as key
append afield to xfield.
afield-tabname = 'HDATA'.
append afield to hfield.
afield-tabname = 'LDATA'.
append afield to lfield.
*
clear afield.
l_count = l_count + 1.
afield-col_pos = l_count.
* AFIELD-TABNAME = 'XDATA'.
afield-fieldname = 'CARRNAME'.
afield-ref_tabname = 'SCARR'.
append afield to xfield.
afield-tabname = 'HDATA'.
append afield to hfield.
afield-tabname = 'LDATA'.
append afield to lfield.
*
clear afield.
l_count = l_count + 1.
* AFIELD-TABNAME = 'XDATA'.
afield-col_pos = l_count.
afield-fieldname = 'CURRCODE'.
afield-ref_tabname = 'SCARR'.
* AFIELD-INPUT = INPUT.
append afield to xfield.
afield-tabname = 'HDATA'.
append afield to hfield.
afield-tabname = 'LDATA'.
append afield to lfield.
*
clear afield.
l_count = l_count + 1.
* AFIELD-TABNAME = 'XDATA'.
afield-col_pos = l_count.
afield-fieldname = 'NUMC'.
afield-datatype = 'NUMC'.
afield-reptext_ddic = text-001.
* AFIELD-INPUT = INPUT.
afield-do_sum = 'X'.
append afield to xfield.
afield-tabname = 'HDATA'.
append afield to hfield.
afield-tabname = 'LDATA'.
append afield to lfield.
*
clear afield.
l_count = 0.
l_count = l_count + 1.
afield-col_pos = l_count.
afield-tabname = space.
afield-fieldname = 'CARRID'.
afield-ref_tabname = 'SPFLI'.
afield-key = 'X'. "define field as key
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'CONNID'.
afield-ref_tabname = 'SPFLI'.
afield-key = 'X'. "define field as key
afield-key_sel = 'X'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'CITYFROM'.
afield-ref_tabname = 'SPFLI'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'AIRPFROM'.
afield-ref_tabname = 'SPFLI'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'CITYTO'.
afield-ref_tabname = 'SPFLI'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'AIRPTO'.
afield-ref_tabname = 'SPFLI'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'DEPTIME'.
afield-ref_tabname = 'SPFLI'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'ARRTIME'.
afield-ref_tabname = 'SPFLI'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'FLTIME'.
afield-ref_tabname = 'SPFLI'.
afield-no_out = 'X'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
*
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-col_pos = l_count.
afield-fieldname = 'FLTYPE'.
afield-ref_tabname = 'SPFLI'.
afield-no_out = 'X'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Ikonen
l_count = l_count + 1.
clear afield.
afield-col_pos = l_count.
afield-tabname = space.
afield-fieldname = 'ICONS'.
afield-ref_tabname = ' '.
afield-sp_group = 'B'.
afield-reptext_ddic = 'Gpk?'(045).
afield-no_out = 'X'.
afield-icon = 'X'.
afield-datatype = 'CHAR'.
afield-outputlen = '4'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Symbole
l_count = l_count + 1.
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-fieldname = 'SYMBOLS'.
afield-ref_tabname = ' '.
afield-col_pos = l_count.
afield-reptext_ddic = 'Prs?'(040).
afield-sp_group = 'B'.
afield-no_out = 'X'.
afield-symbol = 'X'.
afield-datatype = 'CHAR'.
afield-outputlen = '4'.
afield-just = 'C'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Gepäckgewicht
l_count = l_count + 1.
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-sp_group = 'A'.
afield-no_out = space.
afield-fieldname = 'DISTANCE'.
afield-ref_tabname = 'SPFLI'.
afield-col_pos = l_count.
afield-no_sign = 'X'.
afield-qfieldname = 'DISTID'.
afield-outputlen = '10'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Mengeneinheit
l_count = l_count + 1.
clear afield.
l_count = l_count + 1.
afield-tabname = space.
afield-sp_group = 'A'.
afield-no_out = space.
afield-fieldname = 'DISTID'.
afield-ref_tabname = 'SPFLI'.
afield-col_pos = l_count.
afield-outputlen = '4'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Numc
l_count = l_count + 1.
clear afield.
afield-col_pos = l_count.
afield-tabname = space.
afield-fieldname = 'NUMC'.
afield-col_pos = l_count.
afield-do_sum = 'X'.
afield-sp_group = 'S'.
afield-seltext_s = 'NUMC'.
afield-seltext_m = 'NUMC_U'.
afield-seltext_l = 'NUMC_USER'(041).
afield-datatype = 'NUMC'.
afield-outputlen = '10'.
afield-no_out = space.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Blubber
l_count = l_count + 1.
clear afield.
afield-col_pos = l_count.
afield-tabname = space.
afield-fieldname = 'BLUBBER'.
afield-ref_tabname = 'LTDXT'.
afield-ref_fieldname = 'TEXT'.
afield-col_pos = l_count.
afield-hotspot = 'X'.
afield-sp_group = 'S'.
afield-reptext_ddic = 'Kommentar'(043).
afield-datatype = 'CHAR'.
afield-outputlen = '20'.
afield-no_out = 'X'.
append afield to yfield.
afield-tabname = 'IDATA'.
append afield to hfield.
* Key
l_count = 0.
clear afield.
afield-fieldname = 'CARRID'.
afield-outputlen = '3'.
afield-key = 'X'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
* AFIELD-OFFSET = '4'.
append afield to zfield.
l_count = l_count + 1.
clear afield.
afield-fieldname = 'FLDATE'.
afield-key = 'X'.
afield-key_sel = 'X'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
append afield to zfield.
l_count = l_count + 1.
clear afield.
afield-fieldname = 'CONNID'.
afield-key = 'X'.
afield-key_sel = 'X'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
append afield to zfield.
l_count = l_count + 1.
clear afield.
afield-fieldname = 'BOOKID'.
afield-key_sel = 'X'.
afield-key = 'X'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
append afield to zfield.
* Ikonen
l_count = l_count + 1.
clear afield.
afield-fieldname = 'ICONS'.
afield-ref_tabname = ' '.
afield-sp_group = 'B'.
afield-col_pos = l_count.
afield-reptext_ddic = 'Gpk?'(045).
afield-no_out = 'X'.
afield-icon = 'X'.
afield-datatype = 'CHAR'.
afield-outputlen = '4'.
append afield to zfield.
* Buchungsdatum
l_count = l_count + 1.
clear afield.
afield-fieldname = 'ORDER_DATE'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
append afield to zfield.
* Kundentyp
l_count = l_count + 1.
clear afield.
afield-fieldname = 'CUSTTYPE'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
append afield to zfield.
* Kundennummer
l_count = l_count + 1.
clear afield.
afield-fieldname = 'CUSTOMID'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
afield-outputlen = '3'.
append afield to zfield.
* Raucher
l_count = l_count + 1.
clear afield.
afield-fieldname = 'SMOKER'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
append afield to zfield.
* Flugklasse
l_count = l_count + 1.
clear afield.
afield-fieldname = 'CLASS'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
append afield to zfield.
* Rechnungsstellung ja/nein
l_count = l_count + 1.
clear afield.
afield-fieldname = 'INVOICE'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
afield-no_out = 'X'.
append afield to zfield.
* Symbole
l_count = l_count + 1.
clear afield.
afield-fieldname = 'SYMBOLS'.
afield-ref_tabname = ' '.
afield-col_pos = l_count.
afield-reptext_ddic = 'Prs?'(040).
afield-sp_group = 'B'.
afield-no_out = 'X'.
afield-symbol = 'X'.
afield-datatype = 'CHAR'.
afield-outputlen = '4'.
afield-just = 'C'.
append afield to zfield.
* Betrag
l_count = l_count + 1.
clear afield.
afield-fieldname = 'LOCCURAM'.
afield-ref_tabname = 'SBOOK'.
afield-sp_group = 'H'.
afield-col_pos = l_count.
afield-cfieldname = 'LOCCURKEY'.
afield-datatype = 'CURR'.
afield-do_sum = 'X'.
afield-outputlen = '10'.
append afield to zfield.
* Währung
l_count = l_count + 1.
clear afield.
afield-fieldname = 'LOCCURKEY'.
afield-tech = ' '.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-outputlen = '4'.
afield-sp_group = 'H'.
append afield to zfield.
* BetragFW
l_count = l_count + 1.
clear afield.
afield-fieldname = 'FORCURAM'.
afield-ref_tabname = 'SBOOK'.
afield-sp_group = 'F'.
afield-col_pos = l_count.
afield-no_out = 'X'.
afield-do_sum = 'X'.
afield-cfieldname = 'FORCURKEY'.
afield-datatype = 'CURR'.
afield-outputlen = '10'.
append afield to zfield.
* Währung
l_count = l_count + 1.
clear afield.
afield-fieldname = 'FORCURKEY'.
afield-sp_group = 'F'.
afield-tech = ' '.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-no_out = 'X'.
afield-outputlen = '4'.
append afield to zfield.
* Gepäckgewicht
l_count = l_count + 1.
clear afield.
afield-sp_group = 'A'.
afield-no_out = 'X'.
afield-fieldname = 'LUGGWEIGHT'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-no_sign = 'X'.
afield-qfieldname = 'WUNIT'.
afield-outputlen = '10'.
append afield to zfield.
* Mengeneinheit
l_count = l_count + 1.
clear afield.
afield-sp_group = 'A'.
afield-no_out = 'X'.
afield-fieldname = 'WUNIT'.
afield-ref_tabname = 'SBOOK'.
afield-col_pos = l_count.
afield-outputlen = '4'.
append afield to zfield.
* Numc
l_count = l_count + 1.
clear afield.
afield-fieldname = 'NUMC'.
afield-col_pos = l_count.
afield-sp_group = 'S'.
afield-seltext_s = 'NUMC'.
afield-seltext_m = 'NUMC_U'.
afield-seltext_l = 'NUMC_USER'(041).
afield-datatype = 'NUMC'.
afield-outputlen = '10'.
afield-no_out = 'X'.
append afield to zfield.
* Blubber
l_count = l_count + 1.
clear afield.
afield-fieldname = 'BLUBBER'.
afield-ref_tabname = 'LTDXT'.
afield-ref_fieldname = 'TEXT'.
afield-col_pos = l_count.
afield-hotspot = 'X'.
afield-sp_group = 'S'.
afield-reptext_ddic = 'Kommentar'(043).
afield-datatype = 'CHAR'.
afield-outputlen = '20'.
afield-no_out = 'X'.
append afield to zfield.
endform. " FIELDS
*&---------------------------------------------------------------------*
*& Form SELECTION
*&---------------------------------------------------------------------*
* Selektion von Beispieldaten *
*----------------------------------------------------------------------*
* <-> XDATA Globale Datentabelle für Listausgabe
*----------------------------------------------------------------------*
form selection.
data: l_tabix like sy-tabix.
data: lt_sbook like sbook occurs 1 with header line.
data: l_tabix2 like sy-tabix.
* Read Data
select * from scarr into corresponding fields of
table xdata where carrid in carrid.
select * from spfli into table gt_spfli for all entries in xdata
where carrid = xdata-carrid.
loop at gt_spfli.
ydata-numc = sy-tabix div 5.
move-corresponding gt_spfli to ydata.
append ydata.
endloop.
loop at xdata.
xdata-numc = sy-tabix div 4.
l_tabix = sy-tabix.
refresh gt_color.
clear gt_color.
if l_tabix > 5.
xdata-ampel = '1'.
elseif xdata-currcode = 'USD'.
xdata-ampel = '2'.
else.
xdata-ampel = '3'.
endif.
if xdata-currcode = 'LIT'.
gt_color-fieldname = 'CURRCODE'.
gt_color-color-col = 6.
gt_color-color-int = 0.
append gt_color.
xdata-symbols = sym_plus_circle.
elseif xdata-currcode = 'DEM'.
gt_color-color-col = 5.
gt_color-color-int = 0.
append gt_color.
xdata-symbols = sym_filled_square.
else.
gt_color-fieldname = 'CURRCODE'.
gt_color-color-col = 7.
gt_color-color-int = 1.
gt_color-color-inv = 1.
append gt_color.
xdata-symbols = sym_filled_diamond.
endif.
modify xdata.
endloop.
*
hdata[] = xdata[].
ldata[] = xdata[].
idata[] = ydata[].
*
select * from sbook up to 50 rows. "#EC CI_NOWHERE
l_tabix = l_tabix + 1.
l_tabix2 = l_tabix2 + 1.
move-corresponding sbook to zdata.
if l_tabix > 20.
zdata-carrid = 'LH'.
zdata-connid = '47'.
endif.
if l_tabix > 14 and l_tabix <= 20 or
l_tabix > 25.
zdata-fldate = zdata-fldate + 1.
endif.
if l_tabix2 > 7 and l_tabix <= 20.
zdata-connid = 49.
elseif l_tabix >= 26.
zdata-connid = 51.
endif.
if l_tabix2 >= 14 and l_tabix <= 20 .
clear l_tabix2.
endif.
append zdata.
endselect.
loop at zdata.
l_tabix = sy-tabix.
if l_tabix = 1.
zdata-loccuram = 520.
endif.
refresh gt_color.
clear gt_color.
if zdata-loccuram < 500.
zdata-ampel = '1'.
elseif zdata-loccuram < 530.
zdata-ampel = '2'.
else.
zdata-ampel = '3'.
endif.
if zdata-loccuram > 600.
gt_color-fieldname = 'LOCCURAM'.
gt_color-color-col = 6.
gt_color-color-int = 0.
append gt_color.
zdata-symbols = sym_plus_circle.
elseif zdata-loccuram > 500.
gt_color-color-col = 5.
gt_color-color-int = 0.
append gt_color.
zdata-symbols = sym_filled_square.
else.
gt_color-fieldname = 'LOCCURAM'.
gt_color-color-col = 7.
gt_color-color-int = 1.
gt_color-color-inv = 1.
append gt_color.
zdata-symbols = sym_filled_diamond.
endif.
if zdata-luggweight = 0.
zdata-icons = icon_incomplete.
gt_color-fieldname = 'LUGGWEIGHT'.
gt_color-color-col = 4.
gt_color-color-int = 1.
gt_color-color-inv = 1.
append gt_color.
elseif zdata-luggweight < 45.
zdata-icons = icon_checked.
gt_color-fieldname = 'LUGGWEIGHT'.
gt_color-color-col = 6.
gt_color-color-int = 1.
gt_color-color-inv = 1.
append gt_color.
else.
zdata-icons = icon_failure.
gt_color-fieldname = 'LUGGWEIGHT'.
gt_color-color-col = 5.
gt_color-color-int = 1.
gt_color-color-inv = 1.
append gt_color.
endif.
zdata-numc = ( l_tabix div 10 ) * 10.
zdata-colinfo = gt_color[].
if not zdata-luggweight is initial.
move '??' to zdata-wunit.
endif.
modify zdata.
endloop.
if max_data = 'X'.
do 100 times.
append xdata.
append ydata.
append zdata.
* append hdata.
* append idata.
enddo.
endif.
endform. " SELECTION
*---------------------------------------------------------------------*
* FORM EVENTS *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form levents.
endform.
form xevents.
clear xs_event.
xs_event-name = slis_ev_end_of_page.
xs_event-form = 'XEND_OF_PAGE'.
append xs_event to gt_xevents.
clear xs_event.
xs_event-name = slis_ev_top_of_page.
xs_event-form = 'XTOP_OF_PAGE'.
append xs_event to gt_xevents.
clear xs_event.
xs_event-name = slis_ev_top_of_list.
xs_event-form = 'XTOP_OF_LIST'.
append xs_event to gt_xevents.
clear xs_event.
xs_event-name = slis_ev_end_of_list.
xs_event-form = 'XEND_OF_LIST'.
append xs_event to gt_xevents.
clear xs_event.
* XS_EVENT-NAME = SLIS_EV_BEFORE_LINE_OUTPUT.
* XS_EVENT-FORM = 'XBEFORE_LINE_OUTPUT'.
* APPEND XS_EVENT TO GT_XEVENTS.
endform.
*---------------------------------------------------------------------*
* FORM YEVENTS *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form yevents.
clear xs_event.
xs_event-name = slis_ev_end_of_page.
xs_event-form = 'YEND_OF_PAGE'.
append xs_event to gt_yevents.
clear xs_event.
xs_event-name = slis_ev_top_of_page.
xs_event-form = 'YTOP_OF_PAGE'.
append xs_event to gt_yevents.
clear xs_event.
xs_event-name = slis_ev_top_of_list.
xs_event-form = 'YTOP_OF_LIST'.
append xs_event to gt_yevents.
clear xs_event.
xs_event-name = slis_ev_end_of_list.
xs_event-form = 'YEND_OF_LIST'.
append xs_event to gt_yevents.
endform.
form hevents.
clear xs_event.
xs_event-name = slis_ev_top_of_page.
xs_event-form = 'HTOP_OF_PAGE'.
append xs_event to gt_hevents.
clear xs_event.
xs_event-name = slis_ev_top_of_list.
xs_event-form = 'HTOP_OF_LIST'.
append xs_event to gt_hevents.
clear xs_event.
xs_event-name = slis_ev_end_of_list.
xs_event-form = 'HEND_OF_LIST'.
append xs_event to gt_hevents.
endform.
form zevents.
* CLEAR XS_EVENT.
* XS_EVENT-NAME = SLIS_EV_BEFORE_LINE_OUTPUT.
* XS_EVENT-FORM = 'ZBEFORE_LINE_OUTPUT'.
* APPEND XS_EVENT TO GT_ZEVENTS.
endform.
*
form zbefore_line_output using lineinfo type slis_lineinfo.
write at /20 'HalloZ'.
endform.
form xbefore_line_output using lineinfo type slis_lineinfo.
write at /20 'HalloX'.
endform.
form xtop_of_page.
* BREAK-POINT.
write: / 'X_TOP_OF_PAGE'.
endform.
*---------------------------------------------------------------------*
* FORM XTOP_OF_LIST *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form xtop_of_list.
* BREAK-POINT.
write: / 'X_TOP_OF_LIST'.
endform.
*---------------------------------------------------------------------*
* FORM XEND_OF_PAGE *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form xend_of_page.
* BREAK-POINT.
write: / 'X_END_OF_PAGE'.
endform.
*---------------------------------------------------------------------*
* FORM XEND_OF_LIST *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form xend_of_list.
* BREAK-POINT.
write: / 'X_END_OF_LIST'.
endform.
*
form ytop_of_page.
* BREAK-POINT.
write: / 'Y_TOP_OF_PAGE'.
endform.
*---------------------------------------------------------------------*
* FORM YTOP_OF_LIST *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form ytop_of_list.
* BREAK-POINT.
write: / 'Y_TOP_OF_LIST'.
endform.
*---------------------------------------------------------------------*
* FORM YEND_OF_PAGE *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form yend_of_page.
* BREAK-POINT.
write: / 'Y_END_OF_PAGE'.
endform.
*---------------------------------------------------------------------*
* FORM YEND_OF_LIST *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form yend_of_list.
* BREAK-POINT.
write: / 'Y_END_OF_LIST'.
endform.
*
*---------------------------------------------------------------------*
* FORM YTOP_OF_LIST *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form htop_of_list.
* BREAK-POINT.
write: / 'h_TOP_OF_LIST'.
endform.
*---------------------------------------------------------------------*
* FORM YEND_OF_PAGE *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form hend_of_page.
* BREAK-POINT.
write: / 'h_END_OF_PAGE'.
endform.
*---------------------------------------------------------------------*
* FORM YEND_OF_LIST *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form hend_of_list.
* BREAK-POINT.
write: / 'h_END_OF_LIST'.
endform.
*
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when 'REFR'.
loop at xdata.
if xdata-box = 'X'.
xdata-listinfo = 'C50'.
else.
xdata-listinfo = space.
endif.
modify xdata.
endloop.
loop at ydata.
if ydata-box = 'X'.
ydata-listinfo = 'C50'.
else.
ydata-listinfo = space.
endif.
modify ydata.
endloop.
loop at idata.
if idata-box = 'X'.
idata-listinfo = 'C50'.
else.
idata-listinfo = space.
endif.
modify idata.
endloop.
* LOOP AT HDATA.
* IF HDATA-BOX = 'X'.
* HDATA-LISTINFO = 'C50'.
* ELSE.
* HDATA-LISTINFO = SPACE.
* ENDIF.
* MODIFY HDATA.
* ENDLOOP.
rs_selfield-refresh = 'X'.
when others.
endcase.
endform.
*---------------------------------------------------------------------*
* FORM PF_STATUS_SET *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> EXTAB *
*---------------------------------------------------------------------*
form pf_status_set using extab type slis_t_extab.
* BREAK-POINT.
set pf-status 'STANDARD' excluding extab.
endform.
Do not forget to create the PF-status 'STANDARD' by double clicking on that.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |