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 through organization unit selected in select options

Former Member
0 Kudos

Hi,

i need to get all organization units selected in select options(i have a table with sign, option, low, high fields). Is there any function module or should i use st like:

- with fm SELECT_OBJECTS_FOR_OTYPE get all org units and from this units take all units which corresponds selection criteria?

thanks

JJ

4 REPLIES 4

Former Member
0 Kudos

Hi!

It's not recommendet to process a select option within a LOOP. There are many options, which makes it though to process.

Try always using the "IN" statement.

For example:

SELECT * FROM t001

INTO TABLE gt_t001

WHERE bukrs IN so_bukrs. "<<< IN

ANd after a select like this, you can use the internal table, with the FOR ALL ENTRIES, during other selects.

Regards

Tamá

Former Member
0 Kudos

Do you want the Org. Units entered in the Select-options.

Then you can use the select-option itself for that naaa....

It is having the 4 fields you have soecified and you can use select-options as a normal internal table....

0 Kudos

But what to do when user selects some interval of ids?

Former Member
0 Kudos

Hi,

You can use Between condition in Where class.

Ex.

select fields from table where field between select-option-low and select-option-high.

Regards,

Bhaskar