The statement SELECT-OPTIONS has the following effect: The statement declares a selection table in the program with the name selcrit. A selection table is an internal standard table with header line and standard key. In selection tables, multiple selection conditions can be saved. . Here we have added +2(offset) because every time IE or IEQ gets added. To remove this character we need to keep +2 or +3. If hte value is getting truncation in internal table IT, then increase the lenght of field in internaltable IT CLEAR gwmat. SELECT. FROM mara INTO TABLE itab WHERE matnr IN mat. CLEAR: mat. Mat = it.
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,26022 gold badges2929 silver badges6161 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
RS_VARIANT_ADD
(or RS_VARIANT_COPY
,RS_VARIANT_CHANGE
...)knutknut
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