Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Session

Former Member
0 Kudos
219

Hi All,

I have created a batch input session and scheduled in background with the help of the standard program RSBDCSUB.

Please find the below code.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = 'zxy'

user = sy-uname

keep = 'X'.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

SUBMIT rsbdcsub WITH mappe = 'zxy'

WITH von = sy-datum

WITH bis = sy-datum

WITH z_verarb = 'X'

WITH logall = 'X'

EXPORTING LIST TO MEMORY

AND RETURN.

My problem is the above code is working fine. The background job is craeted but created in schedule status but my background job should be in release state...

can you please guide me how to get the job in relaese state with the help of the standard program RSBDCSUB.

Healthy points will be rewarded..

awaiting for your reply.

Thank you.

Regards,

Ravi Ganji

2 REPLIES 2
Read only

Former Member
0 Kudos
194

Hi Ravi,

Try this:

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = jobname

IMPORTING

jobcount = jobcount_test

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE x000(yp) WITH 'JOB-START ' jobname ' failed !!!'.

ELSE.

*--Step insert

SUBMIT rsbdcsub

USER sy-uname VIA JOB jobname NUMBER jobcount_test

WITH mappe = map

WITH von = pdatum

WITH z_verarb = 'X'

AND RETURN .

*

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = jobcount_test

jobname = jobname

strtimmed = strtimmed

targetsystem = sy-host

IMPORTING

job_was_released = job_released

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

IF sy-subrc > 1.

MESSAGE x000(yp) WITH 'JOB-CLOSE ' jobname ' failed!!!'.

ENDIF.

ENDIF.

Regards,

David D

Read only

Former Member
0 Kudos
194

Hi,

u need to assign date and time in submit to current execution date and time of program being executed:-

NUMB LIKE RSJOBINFO-JOBNUMB, "jobnummer

NAME LIKE APQI-GROUPID, "jobname

QID LIKE APQI-QID , "jobqid

DATE LIKE SY-DATUM, "creationdate mappe

TIME LIKE SY-UZEIT, "creationtime mappe

SDATE LIKE SY-DATUM, "jobdatum submit

STIME LIKE SY-UZEIT, "jobzeit submit

USER LIKE SY-UNAME, "jobuser

BUSER LIKE SY-UNAME, "Batchberechtigter

GROUP LIKE APQI-GROUPID, "jobgruppe

i think:-

SUBMIT rsbdcsub WITH mappe = 'zxy'

USER sy-uname VIA JOB jobname NUMBER jobcount_test

WITH mappe = map

with DATE = sy-datum "creationdate mappe

with TIME = sy-UZEIT, "creationtime mappe

with SDATE = SY-DATUM, "jobdatum submit

with STIME = SY-UZEIT, "jobzeit submit

WITH z_verarb = 'X'

AND RETURN .