‎2007 Nov 18 8:35 PM
Hi, I have the select-options:
<code>
SELECT-OPTIONS: s_vkorg FOR s650-vkorg,
SELECTION-SCREEN: END OF BLOCK b1.
</code>
I need separte in several variables the content of s_vkorg.
For example, If I have selected in s_vkorg the values "ORG1,ORG2,ORG3", I need copy the content in three variables:
var1 = ORG1
var2 = ORG2
var3 = ORG3
How can I do it?
Thanks
‎2007 Nov 18 9:56 PM
What do you want to do if the contents of s_vkorg is ORG*
I would:
TABLES tvko.
SELECT-OPTIONS s_vkorg FOR tvko-vkorg.
DATA: BEGIN OF itab OCCURS 0,
vkorg TYPE tvko-vkorg,
END OF itab.
SELECT vkorg
INTO TABLE itab
FROM tvko
WHERE vkorg IN s_vkorg.
ITAB will have all the possible VKORGs.
I used table TVKO instead of S650 because S650 does not exist in our system.
Rob
‎2007 Nov 18 8:46 PM
you cant really do that because select-options are a internal table of type ranges. As you can not foresse the number of lines in that table you will have problems to have tme in separated vairiables and to be honest i cant see the advantage.
if you need the first to third value why dont you use
read table s_option index 1
read table s_option index 2
read table s_option index 3
he have a look to the component lo of the structure.
‎2007 Nov 18 9:51 PM
Since its a select option the user can also provide a range -- low to high values.
So we can't just go by index 1, 2, 3....
What you can do is to fire a select query on the master table for sales org. and fetch all the sales org IN s_option into an internal table.
Then you can loop at the internal table and assign the values to variables.
Regards,
Abhishek
‎2007 Nov 18 9:56 PM
What do you want to do if the contents of s_vkorg is ORG*
I would:
TABLES tvko.
SELECT-OPTIONS s_vkorg FOR tvko-vkorg.
DATA: BEGIN OF itab OCCURS 0,
vkorg TYPE tvko-vkorg,
END OF itab.
SELECT vkorg
INTO TABLE itab
FROM tvko
WHERE vkorg IN s_vkorg.
ITAB will have all the possible VKORGs.
I used table TVKO instead of S650 because S650 does not exist in our system.
Rob