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

Loop in select options

Former Member
0 Likes
15,527

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
Read only

Former Member
0 Likes
2,413

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

Read only

Former Member
0 Likes
2,413

Hi Buddy,

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

Thanks

Nayan.

Read only

Former Member
0 Likes
2,413

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

loop at S_VENDO.

use ... S_VENDO-low to pass

endloop.

Read only

0 Likes
2,413

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

Read only

0 Likes
2,413

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.

Read only

0 Likes
2,413

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.

Read only

0 Likes
2,413

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

Read only

0 Likes
2,413

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

Read only

Former Member
0 Likes
2,413

Hello,

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

Regards.

Read only

Former Member
0 Likes
2,413

Hi,

Try this

loop at S_VENDO.

use S_VENDO-low

endloop.

let me know if u have any question.

Regards,

Kinjal