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

processing the session in background

Former Member
0 Likes
795

Hi experts,

I have created a BDC program in session method. Once i executed the program, it creates a session name.

Then i select the corresponding session name in SM35 and process it in background.

But i dont want to goto SM35 and process the session explicitely.

How to process the session in background without going to SM35 tcode?

Regards,

Shanthi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
738

Hi shanti,

check with below code... but one point keep remember. when your trying to post a question check SDN and if your not succeeded then only post the question. so it will avoid the duplicate postings on the same topic i am right ?.

Hi,

Use this sample code

DATA: RUNTIME TYPE I. "Runtime

DATA: GROUP LIKE APQI-GROUPID, " Mappenname

BDCIMMED LIKE RFIPI-BDCIMMED, " nur BDC: sof. Abspielen

BDCSTRTDT LIKE TBTCJOB-SDLSTRTDT, "nur BDC: Startdatum

BDCSTRTTM LIKE TBTCJOB-SDLSTRTTM. "nur BDC: Startzeit

  • form mappe_abspielen_im_batch.

GET RUN TIME FIELD RUNTIME.

JOBNAME = 'RFEBFD00-FIEB'.

JOBNAME+14 = RUNTIME.

  • eak-point.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = JOBNAME

JOBGROUP = 'FIEB'

IMPORTING

JOBCOUNT = JOBCOUNT

EXCEPTIONS

CANT_CREATE_JOB = 01

INVALID_JOB_DATA = 02

JOBNAME_MISSING = 03.

IF SY-SUBRC NE 0.

MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.

ENDIF.

SUBMIT RSBDCSUB AND RETURN

USER SY-UNAME

VIA JOB JOBNAME NUMBER JOBCOUNT

  • with mappe = group

WITH MAPPE = BI-NAME

WITH VON = SY-DATUM

WITH BIS = SY-DATUM

WITH Z_VERARB = 'X'.

BDCSTRTDT = SY-DATUM.

BDCSTRTDT = SPACE.

BDCSTRTTM = SPACE.

BDCIMMED = 'X'.

  • bdcstrttm = runtime.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

JOBNAME = JOBNAME

JOBCOUNT = JOBCOUNT

STRTIMMED = BDCIMMED

SDLSTRTDT = BDCSTRTDT

SDLSTRTTM = BDCSTRTTM

EXCEPTIONS

CANT_START_IMMEDIATE = 01

JOBNAME_MISSING = 02

JOB_CLOSE_FAILED = 03

JOB_NOSTEPS = 04

JOB_NOTEX = 05

LOCK_FAILED = 06.

IF SY-SUBRC NE 0.

MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.

ENDIF.

CLEAR BDCIMMED.

BDCSTRTDT = SPACE.

BDCSTRTTM = SPACE.

~lingannna

6 REPLIES 6
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
738

This message was moderated.

Read only

Former Member
0 Likes
738

This message was moderated.

Read only

0 Likes
738

Please don't post link-farms. The person can do their own search before asking the question...

Read only

0 Likes
738

HI Julius,

Is this a new moderation policy,

I didnt know about this, I was confused from last three days, all my replies which holds reference to a link were deleted.

So this was the reason, Good move.

So no more links to be referred ... Let the OP make the search .... !!!! Cool

Regards,

Keshu

Read only

0 Likes
738

Hi,

No, there is nothing new about it.

The link-farms posted here have been rejected as well.

An occasional link to support some thoughts of your own is fine, but posting just links is something we don't want to go back to...

Cheers,

Julius

Read only

Former Member
0 Likes
739

Hi shanti,

check with below code... but one point keep remember. when your trying to post a question check SDN and if your not succeeded then only post the question. so it will avoid the duplicate postings on the same topic i am right ?.

Hi,

Use this sample code

DATA: RUNTIME TYPE I. "Runtime

DATA: GROUP LIKE APQI-GROUPID, " Mappenname

BDCIMMED LIKE RFIPI-BDCIMMED, " nur BDC: sof. Abspielen

BDCSTRTDT LIKE TBTCJOB-SDLSTRTDT, "nur BDC: Startdatum

BDCSTRTTM LIKE TBTCJOB-SDLSTRTTM. "nur BDC: Startzeit

  • form mappe_abspielen_im_batch.

GET RUN TIME FIELD RUNTIME.

JOBNAME = 'RFEBFD00-FIEB'.

JOBNAME+14 = RUNTIME.

  • eak-point.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = JOBNAME

JOBGROUP = 'FIEB'

IMPORTING

JOBCOUNT = JOBCOUNT

EXCEPTIONS

CANT_CREATE_JOB = 01

INVALID_JOB_DATA = 02

JOBNAME_MISSING = 03.

IF SY-SUBRC NE 0.

MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.

ENDIF.

SUBMIT RSBDCSUB AND RETURN

USER SY-UNAME

VIA JOB JOBNAME NUMBER JOBCOUNT

  • with mappe = group

WITH MAPPE = BI-NAME

WITH VON = SY-DATUM

WITH BIS = SY-DATUM

WITH Z_VERARB = 'X'.

BDCSTRTDT = SY-DATUM.

BDCSTRTDT = SPACE.

BDCSTRTTM = SPACE.

BDCIMMED = 'X'.

  • bdcstrttm = runtime.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

JOBNAME = JOBNAME

JOBCOUNT = JOBCOUNT

STRTIMMED = BDCIMMED

SDLSTRTDT = BDCSTRTDT

SDLSTRTTM = BDCSTRTTM

EXCEPTIONS

CANT_START_IMMEDIATE = 01

JOBNAME_MISSING = 02

JOB_CLOSE_FAILED = 03

JOB_NOSTEPS = 04

JOB_NOTEX = 05

LOCK_FAILED = 06.

IF SY-SUBRC NE 0.

MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.

ENDIF.

CLEAR BDCIMMED.

BDCSTRTDT = SPACE.

BDCSTRTTM = SPACE.

~lingannna