cancel
Showing results for 
Search instead for 
Did you mean: 

RSXMB_DELETE_MESSAGES

Former Member
0 Kudos

Hi everybody,

I am going to delete not only successful(status = 03) xml message but also all messages.

I know i can delete message by using standard program 'RSXMB_DELETE_MESSAGES’ only successful message.

I want to delete all xml messages by modifing standard program.

Could you give me a teach?

Thanks regards

Jeong Bok.

&----


*& Report RSXMB_DELETE_MESSAGES *

*& *

&----


*& *

*& *

&----


REPORT rsxmb_delete_messages .

DATA: persist TYPE REF TO cl_xms_persist.

DATA: oref TYPE REF TO CX_XMS_syserr_PERSIST.

DATA: text TYPE string.

DATA: dellines TYPE i.

DATA: state TYPE sxmsflag.

DATA: lv_msgtext(72) TYPE c.

  • runmode = D2

  • => D = deletion cycle

  • => 2 = second job of deletion cycle

CONSTANTS: gc_runmode(2) VALUE 'D2'.

  • Test run. Send no messages to screen.

PARAMETERS test_run TYPE c DEFAULT '' NO-DISPLAY.

AUTHORITY-CHECK OBJECT 'S_XMB_AUTH'

ID 'SXMBAREA' FIELD 'MESSAGE'

ID 'ACTVT' FIELD '65'.

IF sy-subrc <> 0.

MESSAGE e304(xms_adm).

ENDIF.

CALL FUNCTION 'ENQUEUE_E_SXMSSWITCH'

EXPORTING

mode_sxmsjinfo = 'U'

runmode = 'C'

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • job conflict - cannot run reorg and copy job parallel

MESSAGE e360(xms_adm).

ENDIF.

  • update job info

CALL FUNCTION 'SXMB_UPDATE_JOB_INFO'.

  • check for conflict jobs

CALL FUNCTION 'SXMB_CHECK_JOB_INFO'

EXPORTING

runmode = gc_runmode

EXCEPTIONS

invalid_mode = 1

job_conflict = 2

copy_job_failed = 3

OTHERS = 4.

CASE sy-subrc.

WHEN '0'.

  • ok - set enqueue

CALL FUNCTION 'ENQUEUE_E_SXMSSWITCH'

EXPORTING

mode_sxmsjinfo = 'S'

runmode = 'R'

_scope = '1'

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

WHEN '3'.

*copy job failed, other reorg job running?

CALL FUNCTION 'ENQUEUE_E_SXMSSWITCH'

EXPORTING

mode_sxmsjinfo = 'V'

runmode = 'R'

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc = 1.

  • other reorg job running - means reorg job can run

CALL FUNCTION 'ENQUEUE_E_SXMSSWITCH'

EXPORTING

mode_sxmsjinfo = 'S'

runmode = 'R'

_scope = '1'

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

ELSE.

  • no other reorg-job running -> check once more

  • if copy-job is running

CALL FUNCTION 'ENQUEUE_E_SXMSSWITCH'

EXPORTING

mode_sxmsjinfo = 'U'

runmode = 'C'

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • job conflict - cannot run reorg and copy job parallel

MESSAGE e360(xms_adm).

ELSE.

  • the reason for failed copy-job is unknown, have to quit

MESSAGE e361(xms_adm).

ENDIF.

ENDIF.

WHEN OTHERS.

  • job conflict

MESSAGE e360(xms_adm).

ENDCASE.

  • set begin of job

CALL FUNCTION 'SXMB_SET_JOB_INFO'

EXPORTING

runmode = gc_runmode

start = '1'

end = '0'

status = '0'

EXCEPTIONS

invalid_mode = 1

date_info_not_unique = 2

job_info_missing = 3

OTHERS = 4.

COMMIT WORK.

CLEAR: text.

state = '1'. " assume that no errors will occur

CREATE OBJECT persist.

TRY.

CALL METHOD persist->delete_msg

IMPORTING

ex_dellines = dellines.

CATCH CX_XMS_syserr_PERSIST INTO oref.

text = oref->get_text( ).

state = '0'. " error occured

ENDTRY.

  • set end of job

CALL FUNCTION 'SXMB_SET_JOB_INFO'

EXPORTING

runmode = gc_runmode

start = '0'

end = '1'

status = state

EXCEPTIONS

invalid_mode = 1

date_info_not_unique = 2

job_info_missing = 3

OTHERS = 4.

COMMIT WORK.

IF test_run IS INITIAL.

IF state = '1'.

MESSAGE i351(xms_adm) WITH dellines.

ELSE.

MESSAGE e100(xms_adm) WITH text.

ENDIF.

ELSE.

IF state = '1'.

MESSAGE i351(xms_adm) WITH dellines INTO lv_msgtext.

ELSE.

MESSAGE e100(xms_adm) WITH text INTO lv_msgtext.

ENDIF.

WRITE: / lv_msgtext.

ENDIF.

Accepted Solutions (0)

Answers (1)

Answers (1)

dhagigeorgiou
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jeong,

We have faced a similar problem.

I would suggest not to go another way:

Try getting all background jobs to work. After that XI will work like a charm.

Very important to get the archiving right. After that all delete jobs will work as they should.

Good luck

Dimitris