Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8975

Re: Problem in fetching line items based on header record

$
0
0

Hi Kranthi,

 

May be you can do something like this.

Modify it as per your need.

 

data: lv_line type int4,

      lv_div type int4,

      lv_mod type int4,

lv_from type i,

lv_to type i.

loop at itab1 into lstab1.

read table itab2 into lstab2 with key key1 = lstab1-key1.

if sy-subrc = 0.

append lstab2 to itab3.

endif.

endloop.

describe itab3 into lv_line.

lv_div = lv_line div 9.

lv_rem = lv_line mod 9.

 

 

if lv_rem is not initial.

lv_div = lv_div + 1.

endif.

 

 

do lv_div times.

    lv_from = ( sy-index - 1 ) * 9 + 1.

    lv_to   = lv_to + 9.

 

 

loop at itab3 into wa3 from lv_from to lv_to.

append wa3 to itab4.

read table itab1 into ls_tab1 with key key1 = wa3-key1.

call the function with itab4 and the lstab1.

endloop.

enddo.

 

Regards.

Dhananjay


Viewing all articles
Browse latest Browse all 8975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>