Aug 17, 2013 Move Data from Select-Options to Internal Table TABLES: mara. TYPES: BEGIN OF tymat, matnr TYPE matnr, END OF tymat. Data: gwmat type tymat. SELECT-OPTIONS: mat FOR mara-matnr. DATA: itab TYPE STANDARD TABLE OF mara. DATA: it TYPE STANDARD TABLE OF matnr.MOVE mat TO it. LOOP AT mat INTO gwmat. APPEND gwmat+2 to it. Here we have.
Can somebody help me figure out if there is a way for the query below:
I have an internal table with one column with 69 records.
I want all these 69 records to be populated into a variant and get saved so that with this variant and the values saved in it I can run a particular program
How can I populate these values ?
Suncatcher4,24522 gold badges2929 silver badges6060 bronze badges
sumegha mukherjeesumegha mukherjee
2 Answers
Your question is a bit unclear for me.
- Do you speak about two programs or one program?
- What's the parameter you want to fill in the variant?
I'll just give you some hints - depending on your situation you must pick the correct parts.
I have an internal table with one column with 69 records.
How is the internal table filled?
I want all these 69 records to be populated into a variant and get saved so that with this variant and the values saved in it I can run a particular program
- You have a program and you want to save a selection in a variant. So you need some parameters for the selection screen.
- You want a table, so you need a
SELECT-OPTION
. - To define a
SELECT-OPTION
you need a DDIC-reference (you must say, what kind of field you want.). In the following example I use a material number (MARA-MATNR
).
So you program contains something like:
With this you would get:
You can define ranges (from-to) and list of values. As you want only single values, you need something like:
Now you get:
- When you push (1) you can enter values.
- With (2) you can load from an external file,
- with (3) you can load values from clipboard.
So you can fill your values and store the selection in a variant.
When you execute your program, the data is stored in a ranges table:
Now you can loop on this table and copy the
S_MATNR-LOW
value into your internal table for further processing.If I misunderstood you question and you want to create a variant dynamically, then take a look on function module
knutknutRS_VARIANT_ADD
(or RS_VARIANT_COPY
,RS_VARIANT_CHANGE
...)22.8k44 gold badges6969 silver badges101101 bronze badges
You could always put the values in TVARVC, either manually or via code. Then specify the TVARVC variable in the variant definition.
Bryan CainBryan Cain