06-17-2008 10:43 AM
Hi All,
Was hoping someone could help me with this.......I'll try and describe the situation and then post my code.
I need to create multiple background jobs dependant on a the volume of an itab - which in this case is a range that is built up within the program. A single job will be SUBMITTED for processing when the range previously built up is less or equal to a constant value. (In this case 20,000).
I can accomplish this quite easily by using the following code.
DESCRIBE TABLE grvbeln LINES gv_vbeln_count._
PERFORM getrange_vol. u201CGet ZVALUE_
IF gvdel_range => gv_vbeln_count._
PERFORM pgishipment. u201C Create single Job_
ENDIF.
SUBMIT wsmonitor_outb_del_gdsi_
VIA JOB lvjobname_
NUMBER lvjobcount_
WITH ifvstel IN lr_vstel_
WITH itvbeln IN gr_vbeln_
However i'm getting stuck when trying to solve how to create mutplie jobs dependant on when the range is greater than the constant value.
If the range is greater than the constant how can i divide the range into block of the constant value (i.e groups of 20,000) and submit all for processing no matter how many entries are contained within the range....??
Heres hoping....
Thanks in advance all.
06-17-2008 3:51 PM
do sth like this:
1) determine proc.
IF cnt BETWEEN 1 AND 20000.
cnt_job = 1.
ENDIF.
IF cnt BETWEEN 20001 AND 40000.
cnt_job = 2.
ENDIF.
u2026
IF cnt > 100001
cnt_job = 5.
ENDIF.
*2)
do cnt_job times
your process and submitt
u2026
enddo.
hope that helps
A.
06-17-2008 4:09 PM
Hi Guys.....Tried these suggestions but no luck.
I'll try and make myself clearer....
Essentially i have to split the range table into volumes to process with stipulated by the value taken from a parameter table so.....where constant value taken is 20,000
19, 999 dels = 1 Job created
20,000 dels = 1 job created
20,001 dels = 2 jobs created (split into segments - 1 job being 20,000 dels- the other job containing 1 del)
40,000 dels = 2 jobs
40,000 dels = 3 jobs and so on.....
Any ideas...???
Thanks
D
Edited by: david steele on Jun 17, 2008 5:31 PM
06-17-2008 3:58 PM
20,000 is pretty big for a range table and probably won't work in a SELECT.
Rob
06-17-2008 4:04 PM
Hi David,
data: counter type i.
_DESCRIBE TABLE gr_vbeln LINES gv_vbeln_count._
_PERFORM get_range_vol. u201CGet ZVALUE_
_IF gv_del_range => gv_vbeln_count._
_PERFORM pgi_shipment. u201C Create single Job_
ELSE..
do
counter = gv_del_range + counter.
if counter <= gv_vbeln_count
else.
_SUBMIT ws_monitor_outb_del_gdsi_
_VIA JOB lv_jobname_
_NUMBER lv_jobcount_
_WITH if_vstel IN lr_vstel_
_WITH it_vbeln IN gr_vbeln_
endif.
enddo.
ENDIF.
I think this will solve your problem
&******** Reward Point if helpful*********&