Many Times we get this error during deletion/reading/loading of data in cube/dso,
Runtime Errors: MESSAGE_TYPE_X
ABAP Program: SAPLRSREQARCH
This error when some of the archive files/Request id belonging to BWREQARCH are not available or deleted.
SAP has recommended a Program RSREQARCH_FAKE_MONITORENTRIES, but for this you need to find out the exact request id and trigger it and you can do it only one request at a time.
So I have done some modification in the program now you can pass n number of request id together, or else pass the Infoprovider Name alone it will find the erroneous request id any will correct it.
*&---------------------------------------------------------------------*
*& Report ZRSREQARCH_FAKE_MONITORENTRIES
*&
*&---------------------------------------------------------------------*
*& * Created by SAP
*& * Modified by Vijayendra Suryawanshi
*&---------------------------------------------------------------------*
REPORT ZRSREQARCH_FAKE_MONITORENTRIES.
data: l_s_reqdone like rsreqdone.
data: l_s_seldone like rsseldone.
data: l_t_crtdone like rscrtdone occurs 0.
data: l_t_hiedone like rshiedone occurs 0.
data: l_t_ldtdone like rsldtdone occurs 0.
data: l_t_monfact like rsmonfact occurs 0.
data: l_t_monictab like rsmonictab occurs 0.
data: l_t_moniptab like rsmoniptab occurs 0.
data: l_t_monmess like rsmonmess occurs 0 with header line.
data: l_t_ruledone like rsruledone occurs 0.
data: l_t_seldone like rsseldone occurs 0.
data: l_t_tcpdone like rstcpdone occurs 0.
data: l_t_uicdone like rsuicdone occurs 0.
data: l_s_reload like rsreqarchdel.
data: l_s_ctrl like rsreqarchctrl.
data: l_read_handle like sy-tabix.
data: l_length type i.
data: l_reload, l_fake, l_enq.
*------------------------------------------------------------------------
*parameter: request type rsrequid.
*parameter: no_enq type rs_bool no-display.
TYPES : BEGIN OF ty_req,
req TYPE rsrequid,
END OF ty_req.
TYPES : BEGIN OF ty_req1,
sign(1) TYPE c,
option(2) TYPE c,
low(30) TYPE c,
high(30) TYPE c,
END OF ty_req1.
data : it_req TYPE ty_req,
wa_req TYPE ty_req,
wa_req1 TYPE ty_req1,
request TYPE rsrequid.
Data : it_dsreq TYPE STANDARD TABLE OF ty_req,
it_arcreq TYPE STANDARD TABLE OF ty_req.
PARAMETERS : ODSO TYPE RSSTATMANDTA.
SELECT-OPTIONS : request1 for it_req-req.
START-OF-SELECTION.
type-pools: rsrqa.
SELECT RNR into TABLE it_dsreq FROM RSREQICODS where tabname = ODSO.
select RNR INTO TABLE it_arcreq from RSREQARCHCTRL FOR ALL ENTRIES IN it_dsreq WHERE rnr = it_dsreq-req or rnr in request1.
*it_req = request1.
*-----------------------------------------------------------------------
LOOP AT it_arcreq INTO wa_req.
request = wa_req-req.
select single * from rsreqdone into l_s_reqdone where
rnr = request.
if sy-subrc <> 0.
write: text-001.
CONTINUE.
endif.
if l_s_reqdone-archived is initial.
write: text-003.
CONTINUE.
elseif l_s_reqdone-archived <> 'X'.
write: text-002.
CONTINUE.
endif.
select single * from rsreqarchctrl into l_s_ctrl where
rnr = request.
if sy-subrc = 0 and not l_s_ctrl-archive_name is initial.
call function 'ARCHIVE_READ_OBJECT'
exporting
object = rsrqa_c_archive_object
* object_id = l_s_ctrl-archive_object
user_exit_program = ' '
user_exit_form = ' '
archivkey = l_s_ctrl-archive_name
offset = l_s_ctrl-archive_offset
moveflag = ' '
importing
archive_handle = l_read_handle
compr_object_length = l_length
exceptions
no_record_found = 1
file_io_error = 2
internal_error = 3
open_error = 4
cancelled_by_user = 5
archivelink_error = 6
object_not_found = 7
filename_creation_failure = 8
file_already_open = 9
not_authorized = 10
file_not_found = 11
others = 12.
if sy-subrc = 0.
l_reload = 'X'.
call function 'ARCHIVE_CLOSE_FILE'
exporting
archive_handle = l_read_handle
exceptions
internal_error = 1
wrong_access_to_archive = 2
others = 3.
if sy-subrc <> 0.
message x001(rsm) with sy-subrc 'ARCHIVE_CLOSE_FILE'.
endif.
else.
l_fake = 'X'.
endif.
else.
l_fake = 'X'.
endif.
if l_reload = 'X'.
call function 'RSREQARCH_RELOAD_REQUEST'
exporting
i_rnr = request.
CONTINUE.
endif.
authority-check object 'S_ARCHIVE'
id 'APPLIC' field 'BW'
id 'ARCH_OBJ' field 'BWREQARCH'
id 'ACTVT' field '*'.
if sy-subrc <> 0.
message i018(rsreqarch) with 'BW' 'BWREQARCH' '*'.
CONTINUE.
endif.
do 10 times.
call function 'ENQUEUE_ERSREQARCH'
exporting
mode_rsreqarch = 'S'
archive_name = 'RSREQARCH_WRITE_REQ'
_scope = '3'
_wait = 'X'
exceptions
foreign_lock = 1.
if sy-subrc = 0.
l_enq = 'X'.
CONTINUE.
endif.
enddo.
if l_enq is initial.
message i020(rsreqarch) with 'RSREQARCH'.
CONTINUE.
endif.
clear l_enq.
do 10 times.
call function 'ENQUEUE_ERSREQARCHCTRL'
exporting
archive_object = l_s_ctrl-archive_object
_scope = '3'
_wait = 'X'
exceptions
foreign_lock = 1.
if sy-subrc = 0.
l_enq = 'X'.
CONTINUE.
endif.
enddo.
if l_enq is initial.
message i020(rsreqarch) with 'RSREQARCHCTRL'.
CONTINUE.
endif.
clear l_enq.
do 10 times.
call function 'ENQUEUE_ERSREQARCH'
exporting
mode_rsreqarch = 'E'
archive_name = l_s_ctrl-archive_name
_scope = '3'
_wait = 'X'
exceptions
foreign_lock = 1.
if sy-subrc = 0.
l_enq = 'X'.
CONTINUE.
endif.
enddo.
if l_enq is initial.
message i020(rsreqarch) with 'RSREQARCH'.
CONTINUE.
endif.
do.
call function 'ENQUEUE_ERSREQDONE'
exporting
mode_rsreqdone = 'E'
rnr = l_s_reqdone-rnr
_scope = '3'
exceptions
foreign_lock = 1.
if sy-subrc = 0.
CONTINUE.
endif.
enddo.
call function 'RSREQARCH_FAKE_MONITORENTRIES'
exporting
request = l_s_reqdone-rnr.
call function 'DEQUEUE_ERSREQDONE'
exporting
rnr = l_s_reqdone-rnr
_scope = '3'
_synchron = 'X'.
call function 'DEQUEUE_ERSREQARCH'
exporting
archive_name = l_s_ctrl-archive_name
_scope = '3'
_synchron = 'X'.
call function 'DEQUEUE_ERSREQARCHCTRL'
exporting
archive_object = l_s_ctrl-archive_object
_scope = '3'
_synchron = 'X'.
call function 'DEQUEUE_ERSREQARCH'
exporting
mode_rsreqarch = 'S'
archive_name = 'RSREQARCH_WRITE_REQ'
_scope = '3'
_synchron = 'X'.
write: text-004.
ENDLOOP.
Thanks
Vijayendra