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: 

Loop in select options

Former Member
0 Kudos

Hi,

In DEV in debugging mode, S_VENDO is showing three entries but

in PRD in debugging mode it shows one table entry.

and thats why looping in not happening in PRD properly.

I am inserting three entries.

So how to loop in select option field.

Edited by: Anurodh Jindal on Jun 5, 2008 1:32 PM

10 REPLIES 10

Former Member
0 Kudos

HI

data: s_sel like line of <select-option name>.

loop at <select-option name> into s_sel.

*write your code

endloop.

select option is an internal table without header line.

Aditya

Former Member
0 Kudos

Hi Buddy,

Pls elaborate on your query...what is s_vendno etc etc..

Thanks

Nayan.

Former Member
0 Kudos

Better if U have all the entries in S_VENDO-low ..

loop at S_VENDO.

use ... S_VENDO-low to pass

endloop.

0 Kudos

in debugging it shows like this...

SIGN OPTION LOW HIGH

I BT 600 603

and thats why loop read 1 st entry i.e 600 only and after that it terminate.

I have to make them read all entries

0 Kudos

Anurodh,

You really need to post the code you are trying to debug. What you are stating doesn't make a lot of sense.

The select-option field is generally used as a RANGE in IF, CHECK, SELECT and others.

Why would you want to loop thru this?

If you are building this range in the INITIALIZATION section, or AT SELECT-SCREEN OUTPUT, Might be better to write each line to the RANGE it self.

You also may want to check and see if the the records actually exist in your PRD system.

0 Kudos

Hi Anurodh,

I have a similar problem in my program.

//   in debugging it shows like this...

SIGN    OPTION LOW  HIGH

I             BT         600       603

and thats why loop read 1 st entry i.e 600 only and after that it terminate.

I have to make them read all entries //

What was the solution you used to solve this issue. Kindly reply. Thanks.

0 Kudos

Hi Bala,

Please let us know why you need to loop in the range table as you can directly use it in your query or condition. Still if you want to loop, you will have to check the low as well as high values, and then adjust the loop accordingly. For ex.

LOOP AT s-vendo INTO ls_vendo.

   lv_vendo = s_vendo-low.

   IF s_vendo-high IS NOT INITIAL.

     WHILE lv_vendo <= s-vendo-high.

       "write your code here using lv_vendo

       lv_vendo = lv_vendo + 1.

     ENDWHILE.

   ELSE.

     "write your code here using lv_vendo

   ENDIF.

ENDLOOP.


Let me know if you have any further doubts.


Regards,

Rachna

0 Kudos

Hi Rachna,

Thanks a lot for your reply.

Yes, in the current requirement, I cannot use the Select Value in where condition and so, I will have to loop it.

I solved the issue in an other way.

Collected all the user values in a Select-option which has restrictions placed on it, allowing only multiple low values. (I used an FM Select_options_restrict). I then looped the Select table and processed the further code. There by, arrived at the right output.

Thanks again, Cheers

Former Member
0 Kudos

Hello,

Are you looking in the new debugger? Try entering the table S_VENDO[] in the debugger.

Regards.

Former Member
0 Kudos

Hi,

Try this

loop at S_VENDO.

use S_VENDO-low

endloop.

let me know if u have any question.

Regards,

Kinjal