Tip

Start a DB backup from R/3 without using DB13

To start a DB backup from R/3 without using DB13 tcode, you can use the following code, and it will create a background job.


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

    Requires Free Membership to View

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'.

This was first published in October 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.