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

how to schedule program in background in BDC ?

Hi ,

I am downloading file from application server to presentation can I schedule it in background?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 21, 2008 at 03:12 PM

    Hi,

    Declare Parameter for file path of Application server with no DISPLAY,

    Initilize the path in INITILIZATION event.

    Schedule it with RSBDCSUB program to execute BDC program in Background.

    Ex:-

    PARAMETERS : p_file(16) NO-DISPLAY.

    ,

    ,

    ,

    ,

    SELECT * FROM APQI WHERE QSTATE = ' '

    AND GROUPID = 'RAJ'

    AND CREATOR = SY-UNAME

    AND CREDATE = SY-DATUM.

    ENDSELECT.

    SUBMIT RSBDCSUB WITH QUEUE-ID = APQI-QID AND RETURN.

    Regards,

    Bala Krishna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 04:36 AM

    Hi

    I think it is not possible to download file from application server to presentation server in background

    Regards

    MD

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 04:39 AM

    hi

    use this table

    btcevtjob

    and a sample code is also there

    Try this

    Execute the below program

    tables: btcevtjob.

    parameters: job like btcevtjob-jobname.

    data: count like btcevtjob-jobcount.

    CALL FUNCTION 'JOB_OPEN'

    EXPORTING

    DELANFREP = ' '

    JOBGROUP = ' '

    jobname = job

    SDLSTRTDT = NO_DATE

    SDLSTRTTM = NO_TIME

    JOBCLASS = JOBCLASS

    IMPORTING

    JOBCOUNT = COUNT

    CHANGING

    RET = RET

    EXCEPTIONS

    CANT_CREATE_JOB = 1

    INVALID_JOB_DATA = 2

    JOBNAME_MISSING = 3

    OTHERS = 4

    .

    IF sy-subrc 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    write:/ sy-subrc.

    CALL FUNCTION 'JOB_SUBMIT'

    EXPORTING

    ARCPARAMS = ARCPARAMS

    authcknam = authcknam

    COMMANDNAME = ' '

    OPERATINGSYSTEM = ' '

    EXTPGM_NAME = ' '

    EXTPGM_PARAM = ' '

    EXTPGM_SET_TRACE_ON = ' '

    EXTPGM_STDERR_IN_JOBLOG = 'X'

    EXTPGM_STDOUT_IN_JOBLOG = 'X'

    EXTPGM_SYSTEM = ' '

    EXTPGM_RFCDEST = ' '

    EXTPGM_WAIT_FOR_TERMINATION = 'X'

    jobcount = count

    jobname = job

    LANGUAGE = SY-LANGU

    PRIPARAMS = ' '

    REPORT = ' '

    VARIANT = ' '

    IMPORTING

    STEP_NUMBER = STEP_NUMBER

    EXCEPTIONS

    BAD_PRIPARAMS = 1

    BAD_XPGFLAGS = 2

    INVALID_JOBDATA = 3

    JOBNAME_MISSING = 4

    JOB_NOTEX = 5

    JOB_SUBMIT_FAILED = 6

    LOCK_FAILED = 7

    PROGRAM_MISSING = 8

    PROG_ABAP_AND_EXTPG_SET = 9

    OTHERS = 10

    .

    IF sy-subrc 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    write:/ sy-subrc.

    CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

    AT_OPMODE = ' '

    AT_OPMODE_PERIODIC = ' '

    CALENDAR_ID = ' '

    EVENT_ID = ' '

    EVENT_PARAM = ' '

    EVENT_PERIODIC = ' '

    jobcount = count

    jobname = job

    LASTSTRTDT = NO_DATE

    LASTSTRTTM = NO_TIME

    PRDDAYS = 0

    PRDHOURS = 0

    PRDMINS = 0

    PRDMONTHS = 0

    PRDWEEKS = 0

    PREDJOB_CHECKSTAT = ' '

    PRED_JOBCOUNT = ' '

    PRED_JOBNAME = ' '

    SDLSTRTDT = NO_DATE

    SDLSTRTTM = NO_TIME

    STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS

    STRTIMMED = ' '

    TARGETSYSTEM = ' '

    START_ON_WORKDAY_NOT_BEFORE = SY-DATUM

    START_ON_WORKDAY_NR = 0

    WORKDAY_COUNT_DIRECTION = 0

    RECIPIENT_OBJ = RECIPIENT_OBJ

    TARGETSERVER = ' '

    DONT_RELEASE = ' '

    TARGETGROUP = ' '

    DIRECT_START = DIRECT_START

    IMPORTING

    JOB_WAS_RELEASED = JOB_WAS_RELEASED

    CHANGING

    RET = RET

    EXCEPTIONS

    CANT_START_IMMEDIATE = 1

    INVALID_STARTDATE = 2

    JOBNAME_MISSING = 3

    JOB_CLOSE_FAILED = 4

    JOB_NOSTEPS = 5

    JOB_NOTEX = 6

    LOCK_FAILED = 7

    INVALID_TARGET = 8

    OTHERS = 9

    .

    IF sy-subrc 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    write:/ sy-subrc.

    note: pre-requiste for doing this is execute the report and save the variant for the report which you need to execute in bg.

    after doing this program execute it give a jobname for this.

    then provide the report , variant and authcknam in job_submit FM.

    *go to sm37

    *enable the option scheduled

    *and then enter the period for which u need to execute ur program in background providing necessary details such as jobname , time and date etc

    For BDC:

    perform <subroutine> using 'BDC_okcode' '<FCT code>

    perform <subroutine> using <transaction><screen no>

    then after BDC_close_group

    submit RSBDCSUB via selection-screen

    hope this will do for u

    if u have any doubt let me know

    With regards

    S.Janagar

    Edited by: janagar sundaramoorthy on Sep 22, 2008 6:41 AM

    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.