Code: Alles auswählen.
001 Queue-ID
002 Mappe
003 Ersteller
004 Status
005 Datum
006 Zeit
007 Transakt.
008 Dynpros
009 Berechtigung
010 Sperre
011 Selektieren/Löschen von Batch-Input Mappen
012 Mappen Status
013 Mappe
014 Ersteller
015 von Datum
016 bis Datum
017 oder älter als Tage
018 Zeitraum
019 Selektierte Mappen löschen
020 Selektion
021 neu
022 fehlerhaft
023 verarbeitet
024 in Bearbeitung
025 im Hintergrund
026 in Erstellung
027 alle
028 gesperrt
029 Gruppiert nach Status
030 Sind Sie sicher?
031 Sollen die selektierten Mappen tatsächlich gelöscht werden?
032 Ja
033 Nein
034 von Zeit
035 bis Zeit
040 Gesamtanzahl der Mappen:
041 Davon wurden gelöscht:
045 -----> Mappe gelöscht
046 ****** Mappe nicht gelöscht *****
047 Lösch-Kz
Code: Alles auswählen.
REPORT rsbdctl6 NO STANDARD PAGE HEADING LINE-SIZE 180.
*Selektieren/Löschen von Batch-Input Mappen
TABLES: apqi.
SELECTION-SCREEN BEGIN OF BLOCK sessiondel
WITH FRAME TITLE text011.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text013 FOR FIELD session.
SELECT-OPTIONS session FOR apqi-groupid DEFAULT '*' OPTION CP.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text014 FOR FIELD creator.
PARAMETERS creator LIKE d0100-creator DEFAULT '*'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK interval
WITH FRAME TITLE text018 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text015 FOR FIELD dat_from.
PARAMETERS dat_from LIKE d0100-von DEFAULT 0.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text034 FOR FIELD tim_from.
PARAMETERS tim_from LIKE APQI-CRETIME DEFAULT 0.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text016 FOR FIELD dat_to.
PARAMETERS dat_to LIKE d0100-bis DEFAULT 0.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text035 FOR FIELD tim_to.
PARAMETERS tim_to LIKE APQI-CRETIME DEFAULT 0.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK interval.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) text017 FOR FIELD period.
PARAMETERS period(03) DEFAULT ' '.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK selstate
WITH FRAME TITLE text012 NO INTERVALS.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state__ TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text021 FOR FIELD state__.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_e TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text022 FOR FIELD state_e.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_f TYPE c DEFAULT 'X' RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text023 FOR FIELD state_f.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_r TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text024 FOR FIELD state_r.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_s TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text025 FOR FIELD state_s.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_c TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text026 FOR FIELD state_c.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_l TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text028 FOR FIELD state_l.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS state_a TYPE c RADIOBUTTON GROUP stat.
SELECTION-SCREEN COMMENT 4(20) text027 FOR FIELD state_a.
PARAMETERS grouplst AS CHECKBOX.
SELECTION-SCREEN COMMENT 27(25) text029 FOR FIELD grouplst.
SELECTION-SCREEN END OF LINE.
*
SELECTION-SCREEN END OF BLOCK selstate.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS deleteit AS CHECKBOX.
SELECTION-SCREEN COMMENT 3(40) text019 FOR FIELD deleteit.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK sessiondel.
*------------------------------------------------------------*
DATA: qcount TYPE i,
dcount TYPE i.
DATA: ans_delok(1) TYPE c VALUE ' ',
state(1) TYPE c,
ctxtmappenstate(30) TYPE c.
DATA: BEGIN OF mtab OCCURS 0.
INCLUDE STRUCTURE apqi.
DATA: END OF mtab.
DATA: text020(20) TYPE c.
*------------------------------------------------------------*
INITIALIZATION.
text011 = 'Selektieren/Löschen von Batch-Input Mappen'(011).
text012 = 'Mappen Status'(012).
text013 = 'Mappe'(013).
text014 = 'Ersteller'(014).
text015 = 'von Datum'(015).
text016 = 'bis Datum'(016).
text017 = 'oder älter als Tage'(017).
text018 = 'Zeitraum'(018).
text019 = 'Selektierte Mappen löschen'(019).
text020 = 'Selektion'(020).
text021 = 'neu'(021).
text022 = 'fehlerhaft'(022).
text023 = 'verarbeitet'(023).
text024 = 'in Bearbeitung'(024).
text025 = 'im Hintergrund'(025).
text026 = 'in Erstellung'(026).
text027 = 'alle'(027).
text028 = 'gesperrt'(028).
text029 = 'Gruppiert nach Status'(029).
text034 = 'von Zeit'(034).
text035 = 'bis Zeit'(035).
*------------------------------------------------------------*
START-OF-SELECTION.
IF deleteit = 'X'.
AUTHORITY-CHECK OBJECT 'S_BDC_MONI'
ID 'BDCAKTI' FIELD 'REOG'
ID 'BDCGROUPID' FIELD '*'.
IF sy-subrc NE 0.
MESSAGE s389(00).
EXIT.
ENDIF.
IF sy-batch <> 'X'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Sind Sie sicher?'(030)
* DIAGNOSE_OBJECT = ' '
text_question = 'Sollen die selektierten Mappen' &
' tatsächlich gelöscht werden?'(031)
text_button_1 = 'Ja'(032)
icon_button_1 = 'ICON_OKAY'
text_button_2 = 'Nein'(033)
icon_button_2 = 'ICON_CANCEL'
default_button = '2'
display_cancel_button = 'X'
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
IMPORTING
answer = ans_delok
* TABLES
* PARAMETER =
EXCEPTIONS
text_not_found = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE s151(00).
EXIT.
ENDIF.
CASE ans_delok.
WHEN '1'.
"ok - doit
WHEN '2'.
deleteit = ' '.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDIF.
ENDIF.
IF state__ EQ 'X'.
state = ' '.
ENDIF.
IF state_e EQ 'X'.
state = 'E'.
ENDIF.
IF state_f EQ 'X'.
state = 'F'.
ENDIF.
IF state_r EQ 'X'.
state = 'R'.
ENDIF.
IF state_s EQ 'X'.
state = 'S'.
ENDIF.
IF state_c EQ 'X'.
state = 'C'.
ENDIF.
IF state_l EQ 'X'.
state = '*'.
ENDIF.
IF state_a EQ 'X'.
state = '*'.
ENDIF.
PERFORM selection_set.
CALL FUNCTION 'BDC_OBJECT_SELECT'
EXPORTING
name = '###'
session_creator = creator
datatype = 'BDC '
client = sy-mandt
qstate = state
date_from = dat_from
date_to = dat_to
time_from = tim_from
time_to = tim_to
TABLES
apqitab = mtab
groupsel = session
EXCEPTIONS
OTHERS = 1.
qcount = sy-dbcnt.
dcount = 0.
IF state_l EQ 'X'.
LOOP AT mtab.
DELETE mtab WHERE startdate LE 0.
ENDLOOP.
qcount = sy-tfill.
ENDIF.
IF state_a EQ 'X' AND grouplst EQ 'X'.
SORT mtab BY qstate ASCENDING
credate DESCENDING
cretime DESCENDING.
ENDIF.
LOOP AT mtab.
CASE mtab-qstate.
WHEN ' '. ctxtmappenstate = text021.
WHEN 'E'. ctxtmappenstate = text022.
WHEN 'F'. ctxtmappenstate = text023.
WHEN 'R'. ctxtmappenstate = text024.
WHEN 'S'. ctxtmappenstate = text025.
WHEN 'C'. ctxtmappenstate = text026.
WHEN OTHERS. ctxtmappenstate = '???'.
ENDCASE.
WRITE: / mtab-groupid,
mtab-creator,
mtab-qstate,
ctxtmappenstate(15),
mtab-credate,
mtab-cretime,
mtab-transcnt,
mtab-msgcnt,
mtab-userid.
IF mtab-startdate = 0.
WRITE: ' '.
ELSE.
WRITE: mtab-startdate
COLOR COL_NEGATIVE INTENSIFIED OFF.
ENDIF.
WRITE: mtab-qerase, ' ' COLOR COL_BACKGROUND.
WRITE: mtab-qid.
CHECK deleteit = 'X'.
PERFORM delete_session(saplsbdc) USING mtab-qid.
IF sy-subrc = 0.
WRITE: ' -----> Mappe gelöscht'(045).
dcount = dcount + 1.
ELSE.
WRITE: ' ****** Mappe nicht gelöscht *****'(046).
ENDIF.
ENDLOOP.
SKIP 1.
ULINE.
WRITE:/ text020.
WRITE:/(20) text013, ':'.
LOOP AT session.
WRITE: '(', session-sign, session-option, ')', session-low.
IF session-high NE space.
WRITE: '..', session-high.
ENDIF.
WRITE: /(22) ' '.
ENDLOOP.
WRITE:/(20) text014, ':', creator.
WRITE:/(20) text015, ':', dat_from.
WRITE:/(20) text034, ':', tim_from.
WRITE:/(20) text016, ':', dat_to.
WRITE:/(20) text035, ':', tim_to.
WRITE:/(20) text017, ':', period.
WRITE:/(20) 'Status'(004), ':', state.
IF state_l EQ 'X'.
WRITE: '/', text028.
ENDIF.
ULINE.
WRITE:/ 'Gesamtanzahl der Mappen:'(040), qcount.
IF deleteit = 'X'.
WRITE:/ 'Davon wurden gelöscht:'(041), dcount UNDER qcount.
ENDIF.
ULINE.
*------------------------------------------------------------*
TOP-OF-PAGE.
WRITE: / 'Mappe'(002),
14 'Ersteller'(003),
27 'Status'(004),
45 'Datum'(005),
56 'Zeit'(006),
64(10) 'Transakt.'(007) RIGHT-JUSTIFIED,
75(10) 'Dynpros'(008) RIGHT-JUSTIFIED,
87 'Berechtigung'(009),
100 'Sperre'(010),
111 'Lösch-Kz'(047),
120 'Queue-ID'(001).
* WRITE:/ '.........1.........2.........3.........4.........5'
* & '.........6.........7.........8.........9.........0'
* & '.........1.........2.........3.........4'.
ULINE.
*------------------------------------------------------------*
FORM selection_set.
DATA: diffdays TYPE i.
IF period EQ space.
diffdays = 0.
ELSE.
IF period CN ' 0123456789'.
diffdays = 999.
ELSE.
diffdays = period.
ENDIF.
ENDIF.
IF diffdays > 0.
CLEAR dat_from.
dat_to = sy-datum - diffdays.
ENDIF.
period = diffdays.
ENDFORM. "selection_set