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

logic

Former Member
0 Likes
715

hi guys,

I have some 100 values in an internal table.

From that 100 values first i have to pass the 1 st value and 10th value to another Functional module

then again 11th value and 20th value and again 21st value and 30th value so on upto 100

How i can do this?

Regards

senthil

1 ACCEPTED SOLUTION
Read only

former_member404244
Active Contributor
0 Likes
683

hI,

Index1 = 1.

index2 = 10.

do 10 times.

read table itab into wa1 index index1.

read table itab into wa2 index index2.

from above reads u will get 1st and 10th record.

call the function module andpass the values.

index1 = index1 + 10.

index2 = index2 + 10.

clear : wa,wa1,wa2.

enddo.

Regards,

Nagaraj

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
683

hi Senthil,

DATA : lv_index TYPE i VALUE 1.

DO 10 TIMES.

READ TABLE itab INDEX i.

  • call FM

i = i + 9.

READ TABLE itab INDEX i.

  • call FM

i = i + 1.

ENDDO.

hope this helps

ec

Read only

former_member404244
Active Contributor
0 Likes
684

hI,

Index1 = 1.

index2 = 10.

do 10 times.

read table itab into wa1 index index1.

read table itab into wa2 index index2.

from above reads u will get 1st and 10th record.

call the function module andpass the values.

index1 = index1 + 10.

index2 = index2 + 10.

clear : wa,wa1,wa2.

enddo.

Regards,

Nagaraj

Read only

Former Member
0 Likes
683

Hi Senthil

Below logic might give you some idea on handling your scenario:


data: add type i,
      ind type tabix.

do.

  if add = 1.
     add = 9.
  else.
     add = 1.
  endif.
  ind = ind + add.
  read table itab into wa index ind.
  if sy-subrc ne 0.
     exit.
  endif.

enddo.

Kind Regards

Eswar