‎2005 Jul 08 12:06 PM
HAI,
I HAVE INPUT 2 FIELDS IN THE SELECTION SCREEN.
SECOND FIELD ALWAYS DEPENDS ON THE FIRST FIELD.
IF I DOESN'T SELECT FIRST FIELD(BLANK), THE OUTPUT SHOULD DISPLAY ALL THE ENTRIES .
IF I SELECT PARTICULAR VALUE IN THE FIRST FIELD(NOT BLANK), THE OUTPUT SHOULD BE THE SECONDFIELDS THOSE DEPEND ON THE FIRST FIELD.
PLZ...
IMMEDIATE...
‎2005 Jul 08 12:17 PM
Hi,
let us say if we two parameters:
parameters : p1 like mara-matnr,
p2 like to23-matkl.
if p1 is initial.
select * from mara into table i_mara.
select spart
wwdga
from to23
into table i_final for all entries in i_mara
where matkl = i_mara-matkl.
else.
select * from mara into table i_mara where matnr = p1.
select spart
wwdga
from to23
into table i_final for all entries in i_mara
where matkl = i_mara-matkl.
Regards,
Jagath
Message was edited by: Jagathguru Chandrasekharan
‎2005 Jul 08 12:17 PM
Hi,
let us say if we two parameters:
parameters : p1 like mara-matnr,
p2 like to23-matkl.
if p1 is initial.
select * from mara into table i_mara.
select spart
wwdga
from to23
into table i_final for all entries in i_mara
where matkl = i_mara-matkl.
else.
select * from mara into table i_mara where matnr = p1.
select spart
wwdga
from to23
into table i_final for all entries in i_mara
where matkl = i_mara-matkl.
Regards,
Jagath
Message was edited by: Jagathguru Chandrasekharan
‎2005 Jul 08 1:06 PM
‎2005 Jul 08 1:24 PM
Hi,
Try this.
parameters : p_1 type makt-matnr,
p_2 type makt-maktx.
data : itab type standard table of makt,
wa type makt.
if p_1 is initial.
select * from makt into table itab.
else.
Here I assumed that p_2 is mandatory
select * from makt into table itab where maktx = p_2.
endif.
loop at itab into wa.
write : / wa.
endloop.
Message was edited by: Jayanthi Jayaraman
‎2005 Jul 08 1:14 PM
HI,
for the second case where in if you are having values for the first parameter then you can select the data from the table for entries which are related to P2 for all values of P1.
this can be acheived by using a join for the two tables in the above case and thus reducing the compile time.
select val1
val2
from table table1
inner join table2 on table1val3 = table2val3
into itab
where table2~val1 = p1.
loop at itab into wa.
write : / wa.
endloop.
Message was edited by: Jagathguru Chandrasekharan
‎2005 Jul 08 1:16 PM
can anyone helps in further better way.
output list should be the list(second field contents)those depends on the first field.
‎2005 Jul 08 2:21 PM
define the first one (or both) as select-option. If you want to allow only one value for select-options you can use 'NO INTERVAL' 'NO RANGES' options of select-options.
-Sanjeev