Application Development 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: 

Dividing range(itab) supplied to submit.....?

Former Member
0 Kudos

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.

4 REPLIES 4

andreas_mann3
Active Contributor
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

20,000 is pretty big for a range table and probably won't work in a SELECT.

Rob

former_member598013
Active Contributor
0 Kudos

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*********&