Skip to Content
author's profile photo Former Member
Former Member

logic

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 09, 2008 at 08:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2008 at 07:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 08:20 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.