Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection screen problem

Former Member
0 Likes
976

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...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
790

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

6 REPLIES 6
Read only

Former Member
0 Likes
791

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

Read only

0 Likes
790

hai..

It's good idea but can anyone help in better way.

thank u

Read only

0 Likes
790

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

Read only

Former Member
0 Likes
790

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

Read only

Former Member
0 Likes
790

can anyone helps in further better way.

output list should be the list(second field contents)those depends on the first field.

Read only

0 Likes
790

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