To start a DB backup from R/3 without using DB13 tcode, you can use the following code, and it will create a background...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
REPORT ZSAVE_ONLINE. DATA: ok_code TYPE sy-ucomm, save_ok LIKE ok_code, output(8) TYPE c, zsid type sy-sysid, zhost type sy-host, zuser type sy-uname. DATA: CMDSTR LIKE SXPGCOLIST-NAME VALUE 'CHECK_QXDAEDRSQL', RESULT LIKE BTCXPM OCCURS 10 WITH HEADER LINE. DATA: ZJOBCOUNT LIKE TBTCJOB-JOBCOUNT. DATA: ZRELEASED LIKE BTCH0000-CHAR1. DATA: ZPARAM(255) type c. zhost = SY-HOST. zsid = sy-sysid. zparam = ''. ZPARAM = '-u / -c force -t online -m all -p initSID.sap'. concatenate ZPARAM ' -a -c force -p initSID.sap -cds' INTO ZPARAM. CALL FUNCTION 'JOB_OPEN' EXPORTING JOBNAME = 'Zbackup_BD_online' JOBCLASS = 'C' IMPORTING JOBCOUNT = ZJOBCOUNT EXCEPTIONS CANT_CREATE_JOB = 01 INVALID_JOB_DATA = 02 JOBNAME_MISSING = 03 OTHERS = 99. CALL FUNCTION 'JOB_SUBMIT' EXPORTING AUTHCKNAM = SY-UNAME JOBCOUNT = ZJOBCOUNT JOBNAME = 'Zbackup_BD_online' EXTPGM_NAME = 'brbackup' EXTPGM_PARAM = zparam EXTPGM_SYSTEM = zhost EXTPGM_WAIT_FOR_TERMINATION = 'X' EXTPGM_STDOUT_IN_JOBLOG = 'X' EXTPGM_SET_TRACE_ON = 'X' EXTPGM_STDERR_IN_JOBLOG = 'X' EXCEPTIONS INVALID_JOBDATA = 02 JOBNAME_MISSING = 03 JOB_NOTEX = 04 JOB_SUBMIT_FAILED = 05 LOCK_FAILED = 06 PROGRAM_MISSING = 07 PROG_ABAP_AND_EXTPG_SET = 08 BAD_XPGFLAGS = 09 OTHERS = 99. CALL FUNCTION 'JOB_CLOSE' EXPORTING JOBCOUNT = ZJOBCOUNT JOBNAME = 'Zbackup_BD_online' STRTIMMED = 'X' IMPORTING JOB_WAS_RELEASED = zreleased EXCEPTIONS INVALID_STARTDATE = 01 JOBNAME_MISSING = 02 JOB_CLOSE_FAILED = 03 JOB_NOSTEPS = 04 JOB_NOTEX = 05 LOCK_FAILED = 06 OTHERS = 99. MESSAGE 'the backup was started .....' TYPE 'I'. Call TRANSACTION 'DB14'.