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

JOB_OPEN

Former Member
0 Likes
4,064

hi,

In the funtion module Job_open we have a export prametrer Jobclass.

what is the use of the Jobclass and what all values can a jobclass have.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname =

jobclass =

IMPORTING

jobcount =

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

1 ACCEPTED SOLUTION
Read only

Former Member

hi,

In the funtion module Job_open we have a export prametrer Jobclass.

what is the use of the Jobclass and what all values can a jobclass have.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname =

jobclass =

IMPORTING

jobcount =

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

5 REPLIES 5
Read only

Former Member
0 Likes
2,553

hi,

If you want to directly schedule a Job and assign the job classification as A in SE38

then go to program -> execute ->Background.

Then to Goto -> Job definition.

Here you can set the Job Classification to 'A'.

Job Priority always set by default to class 'C'.

Refer this thread.

https://forums.sdn.sap.com/click.jspa?searchID=4208981&messageID=1324442

Rgds

Reshma

Read only

Former Member
0 Likes
2,553

Sample Program: Adding an ABAP Job Step

  • Add a job step: ABAP program

CALL FUNCTION 'JOB_SUBMIT'

EXPORTING

AUTHCKNAM = SY-UNAME " Runtime authorizations

" user

JOBCOUNT = JOBNUMBER " Value from JOB_OPEN

JOBNAME = JOBNAME " Value from JOB_OPEN

REPORT = 'REPORT' " Report to be run

VARIANT = 'VARIANT' " Variant to use with

" report

PRIPARAMS = USER_PRINT_PARAMS " User printing options

ARCPARAMS = USER_ARC_PARAMS " User archiving options

" Both sets of options

" come from

" GET_PRINT_PARAMETERS

EXCEPTIONS

BAD_PRIPARAMS = 01

INVALID_JOBDATA = 02

JOBNAME_MISSING = 03

JOB_NOTEX = 04

JOB_SUBMIT_FAILED = 05

LOCK_FAILED = 06

PROGRAM_MISSING = 07

PROG_ABAP_AND_EXTPG_SET = 08

OTHERS = 99.

IF SY-SUBRC > 0.

<Error processing>

ENDIF.

  • Error processing in the event of a non-recoverable error should

  • include a call to BP_JOB_DELETE with FORCEDMODE = 'X' to remove

  • the job from the database. This is required for error

  • processing in all calls after JOB_OPEN. (The background system

  • cleans up automatically in the event of a problem in JOB_OPEN).

  • Please see Selecting and Deleting a Job for a programming

  • example.

Read only

Former Member
0 Likes
2,553

Hi,

Job class contains job header data. For values look at this structure TBTCJOB.

Rewards Points.

Regards,

Bohra.

Read only

Former Member
Read only

Former Member
0 Likes
2,553

Hi

Use JOB_OPEN to create a background job. The function module returns the unique ID number which, together with the job name, is required for identifying the job.

Once you have "opened" a job, you can add job steps to it with JOB_SUBMIT and submit the job for processing with JOB_CLOSE.

For more information, please see the online documentation in the function module facility (transaction SE37)

Job Class



You can reserve any number of background processing work processes to be kept free for high-priority, or class A, jobs. Reserving work processes for class A jobs does not reserve any particular work process in a server for class A jobs, but rather makes sure a certain number of work processes is free at all times. To set the number of class A background work processes, you’ll need to set the work process distribution and assign each work process to an operation mode. For more information, see Prioritization Strategies for Class A Jobs.

Procedure

To set the number of work processes to keep free for high-priority jobs in the definition of an instance (SAP application server):

Call Transaction RZ04 or choose CCMS ® Configuration ® Operation Modes / Instances.
To review the current configuration of SAP instances and operation modes and begin defining up background processing servers, choose Instances/operation modes.
If the server you want to set up as a background processing server doesn’t appear in this list, create a new instance. Choose Instance ® Create new instance. Complete the instance definition in this Maintain Instance Data window, then save.
Once the server you want to set up as a background processing server appears in this list, select the mode for that server then select Choose.
In the Maintain Work Process Distribution screen, set the number of work process by selecting the current number and increasing or decreasing it with the "-" or "+" buttons.
Save here, return to the previous screen, and save again. These changes will take effect when the operation mode is next activated.
Numbers of Class A background work processes:

0
The default number. Use this value if you do not have mission- or system-critical class A jobs that must always start immediately when they become eligible to start. In this case, jobs are simply run according to their priority, or "class". Work processes are not kept free for class A jobs.

1 or more
Use this value to guarantee that mission- or system-critical jobs start immediately once they become eligible to start. One background processing work process will always be kept free for class A jobs, ensuring no class A job has to wait for a free background work process.

To keep background work processes available for jobs that aren’t class A, be sure that the number of class A work processes is less than the total number of background work processes in an application server. Otherwise, only class A jobs will be eligible to run on that server.

To reserve an entire application server exclusively for class A jobs, set the number of class A work processes to the total number of background work processes. For example, if an SAP server offers 4 background work processes and the class A reservation for the server is set to 4, only class A jobs can start at that server.

The class A setting is in effect whenever the operation mode(s) in which it is defined are active.



You can define and schedule background jobs in two ways from the Job Overview:

· Directly from Transaction SM36. This is best for users already familiar with background job scheduling.

· The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.

Procedure

...

1. Call Transaction SM36 or choose CCMS ® Jobs ® Definition.

2. Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.

3. Set the job’s priority, or “Job Class”:

· High priority: Class A

· Medium priority: Class B

· Low priority: Class C

4. In the Target server field, indicate whether to use system load balancing.

· For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.

· To use a particular application server to run the job, enter a specific target server.

5. If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.

6. Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.

7. Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.

8. Save the fully defined job to submit it to the background processing system.

9. When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.

Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.

.Check this links too

http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f53505211d189550000e829fbbd/frameset.htm

Reward all helpfull answers

Regards

Pavan