I am using 5 Parameters to fetch the details from DB table (mara, makt, marc, mard).
PARAMETERS :number TYPE matnr MATCHCODE OBJECT MAT1 ,
type TYPE MTART MATCHCODE OBJECT H_T134 ,
sector TYPE MBRSH MATCHCODE OBJECT H_T137 ,
group TYPE MATKL MATCHCODE OBJECT H_T023 ,
unit TYPE MEINS MATCHCODE OBJECT H_T006 .
First I tried to fetch data from MARA table using the select query. In that to retrieve the particulare record, I have to use the WHERE condition. But I get confused in the condition part. We can check which parameter has value by using INITIAL condition.
But there is a chanced for 2/3/4/5 parameters to have values. For each case we have to write select query (if so it will lead to performance issue) or is there any way for using dynamic condition part in select query?
You can use
SELECT-OPTIONS
:When you do so, you selection screen will allow multiple values and ranges for the data.
If you need single values like the
parameter
-command, you must set aditional options for theSELECT-OPTION
:NO INTERVALS
to allow only single valuesNO-EXTENSION
to allow only one value.OBLIGATORY
if an empty value is not allowed (As far I understand your question, you have the opposite situation, so you don't need it).So your selection is:
Remark:
MARA
must be defined as aTABLE
if you useSELECT-OPTIONS
MATCHCODE OBJECT
? Normally the usage of theFOR
already defines the correct matchcode object (via data element/domain).Disclaimer: