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

batch input session in background

Former Member
0 Likes
2,384

hai guys,

Can we execute Batch input session in background scheduling thru jobs.

i tried with sm37. but there is not option i guess.

could you pls guide us.

ambichan.

10 REPLIES 10
Read only

Former Member
0 Likes
1,499

Hi,

In SM35, there's an option to process the session in background. Look at the first menu: Session--> Process in background.

Regards,

Anand Mandalika.

Read only

Former Member
0 Likes
1,499

Actually i want to schedule this session program in background job defining it(like when date, etc)..,

i dont want to execute this program in background by interactively as such clicking menus in screen or foreground as u said..

i want to define or schdule this program.how to do this.

hope u understand.

ambichan.

Read only

0 Likes
1,499

Hello Ambichan,

In SHDB, you can create a program using the option EDIT-->Create Program.

Then you can schedule this program in background. Is this what you're looking for ?

Regards,

Anand Mandalika.

Read only

0 Likes
1,499

Hi,

you can also take a look at these posts:

1.

2.

3.

And the report program RSBDCSUB.

Regards,

Anand Mandalika.

Read only

0 Likes
1,499

Let me explain the real requirement first.

i have BI program "zfb05" creating session "T_TEST"

now client wants to execute this "t_test" session

in background at particular "FROM DATE"(not immediately).

how to do this. pls explain.

since i dont have variant for my program i can schedule this in SM37 also.hope now its understandable.

using SHDB, I have already created program as Zfb05.

ambichan.

Read only

0 Likes
1,499

Hi,

then what is the problem ?

1. Go to SE38 and enter the program name.

2. Use the menu path <i>Program>Execute>Background.</i>

3. In the next screen, choose <b>Schedule</b>.

By the way, are you sure that your program doesn't have any variant? I think there would be one. Because the program you have created using SHDB, ZFB05, will have a selection screen. Just create a variant and use it in the step 3 above.

Hope that helps.

Regards,

<a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=zwcc%2fwm4ups%3d">anand Mandalika</a>.

Read only

0 Likes
1,499

hey Anand,

Thanks for your reply.I am sorry, I fail to explain u Completely.Actually i want to execute the session created in SM35 thru background.

ie.i want to execute the session not a program.

I created session and want to execute this in background

(for eg)from tomorrow DATE, not immediately. how to do this. sorry for my poor explanation.

do we have any option to schedule this session job

in R3.

ambichan.

Read only

0 Likes
1,499

Hello Ambichan,

I don't think there's any way that you can schedule a session directly in a background job, without wrapping it up in some program. (The only option is to execute it immediately, as explained in the earlier post)

<i>The job step has to be a program.</i>

So you can create the program from SHDB for your session in SM35 and then schedule it.

Regards,

Anand Mandalika.

Read only

0 Likes
1,499

Hello,

you could use the report RSBDCSUB. Create a variant for this report and create a job executing teh programm RSBDCSUB with your variant.

Wolfgang

Read only

0 Likes
1,499

Hi Ambi,

As Anand and Wolfgang suggested, what you need to do in your ZFB05 program is as follows. Insert this after you create the sessions.

Add parameters to your ZFB05 program for the session background processing like date, session name etc.

Then after you create your sessions, insert the following code


*-- run in the background
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = 'YOURJOBNAME'
           IMPORTING
                jobcount         = v_jobcount
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
      submit rsbdcsub  with mappe    = 'YOURSESSIONNAME'
                       with z_verarb = 'X'
                       with fehler   = 'X'
                       USER sy-uname 
                       VIA JOB 'YOURJOBNAME'
                       NUMBER v_jobcount AND RETURN.
*-- close the job
           CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                jobcount             = v_jobcount
                jobname              = 'YOURJOBNAME'
                strtimmed            = 'X'
           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 <> 0.
        MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

Hope this helps,

Srinivas