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

problem in selection criteria

Former Member
0 Likes
796

Hi folks,

In my report i have five selections screen feilds.for each selection i have different selection criteria.for each selection -criteria i have to write seprate code.if i select first feild i want that selection criteria only.if i select second one i want that particular selection only.how can i achieve this.for this iam trying to write in seprate form for each selection but iam getting the first selection data only for all the selections.

please do needful.

Thx in advance,

Neelima.N

7 REPLIES 7
Read only

Former Member
0 Likes
769

Hi,

write the code as

AT SELECTION SCREEN ON <fieldname>

for 5 fields .

Regards,

jaya

Read only

0 Likes
769

Hi,

can you please provide me sample coding.

Do needful.

Thanks & Regards,

Neelima.N

Read only

Former Member
0 Likes
769

check the following code

selection-screen begin of block a with frame title text-001.
select-options: mydate for sy-datum no-extension obligatory.
parameters: sel1 radiobutton group  a,
            sel2 radiobutton group a,
            sel3 radiobutton group a,
            sel4 radiobutton group a,

selection-screen end of block a.

"<----End of selection screen ----------->

start-of-selection.
  if sel1 = 'X'.
    " Ur code for selection
  elseif sel2 = 'X'.
    " Ur code for selection
elseif sel3 = 'X'.
  " Ur code for selection
elseif sel4 = 'X'.
  " Ur code for selection

  endif.

Read only

0 Likes
769

Hi,

My requirement is i hav five selection criteria.for example if i enter material number regarding material number data has to print.if i enter manufacturer number,regarding manufacturer number data has to print.for each selection the data is changing.

how to print the data.bcoz for each selection the data is changing.

i have to select the data from all together 4 tables.so iam using joins.

how can i achieve this.

Thanks in advance,

Neelima.N

Edited by: neelima natta on Feb 24, 2009 6:56 AM

Read only

Former Member
0 Likes
769

Hi Neelima,

If you have to select the data from same table with different conditions for different selection fields, you can build dynamic query depending upon slection criteria. It should solve your problem.

You populate internal table and pass it in the where clause.

data :begin of querytab occurs 0 with header line,

query(1028) type c,

end of querytab.

***Popultae querytab.

IF not p_1 is initial.

*populate querytab

elseif not p_2 is initial.

*populate querytab

elseif not p_3 is initial.

*populate querytab

elseif not p_4 is initial.

*populate querytab

elseif not p_5 is initial.

*populate querytab

endif.

select *

from dbtab

where ( querytab )

Regards,

Anil.

Read only

Former Member
0 Likes
769

please put code of the selection screen block, then we will get an idea

Read only

Former Member
0 Likes
769

solved myself.