Skip to Content
author's profile photo Former Member
Former Member

Backup program

Hi,

I want the backup program to be run in my application server

can anybody help me on this its very urgent.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 12:33 PM

    Hi Sunil,

    Try this code to backup in your presentation server.

    REPORT YCL_GENERATE_BACKUP1.

    ----


    • Parameters Declaration *

    ----


    parameters: p_file(500)

    DEFAULT 'D:\BACKUP\'

    OBLIGATORY. " File Name

    ----


    • Constants Declaration *

    ----


    constants: c_txt(6) value '.txt'. " Store EXtension of file name

    ----


    • Data Declaration *

    ----


    data w_file type string.

    ----


    • Field Strings Declaration *

    ----


    DATA: FS_PROG TYPE PROGNAME.

    ----


    • Internal tables Declaration *

    ----


    DATA: T_PROG TYPE PROGNAME OCCURS 10,

    T_CODE(150) occurs 10.

    ----


    • Satrt of Selection *

    ----


    Start-of-selection.

    w_file = p_file.

    perform read_programs. " Read Programs

    perform Download_programs. " Download Programs

    &----


    *& Form read_programs

    &----


    • text

    ----


    FORM read_programs.

    SELECT PROGNAME

    FROM REPOSRC

    INTO TABLE T_PROG

    WHERE UDAT EQ sy-datum

    AND UNAM EQ 'CLUSER03'

    OR UNAM EQ 'CLUSER02'

    OR UNAM EQ 'CLUSER01'.

    ENDFORM. " Read_programs

    ----


    *& Form Download_programs

    &----


    • Download all our programs

    ----


    FORM Download_programs .

    WRITE: / text-001.

    uline.

    LOOP AT T_PROG INTO FS_PROG.

    read report FS_prog into t_CODE.

    concatenate p_file

    FS_prog

    c_txt

    into w_file.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    FILENAME = w_file

    TABLES

    DATA_TAB = t_CODE

    EXCEPTIONS

    FILE_WRITE_ERROR = 1

    NO_BATCH = 2

    GUI_REFUSE_FILETRANSFER = 3

    INVALID_TYPE = 4

    NO_AUTHORITY = 5

    UNKNOWN_ERROR = 6

    HEADER_NOT_ALLOWED = 7

    SEPARATOR_NOT_ALLOWED = 8

    FILESIZE_NOT_ALLOWED = 9

    HEADER_TOO_LONG = 10

    DP_ERROR_CREATE = 11

    DP_ERROR_SEND = 12

    DP_ERROR_WRITE = 13

    UNKNOWN_DP_ERROR = 14

    ACCESS_DENIED = 15

    DP_OUT_OF_MEMORY = 16

    DISK_FULL = 17

    DP_TIMEOUT = 18

    FILE_NOT_FOUND = 19

    DATAPROVIDER_EXCEPTION = 20

    CONTROL_FLUSH_ERROR = 21

    OTHERS = 22.

    IF SY-SUBRC <> 0.

    write: / text-000.

    uline.

    write: / fs_prog.

    else.

    write: / w_file.

    ENDIF. " IF SY-SUBRC <> 0.

    ENDLOOP. " LOOP AT T_PROG

    ENDFORM. " Download_programs

    plz Reward if help.

    Mahi.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.