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 queries

Former Member
0 Likes
834

Hi all,

i have 7 inputs in selection screen from the 3 difrnt tables (4from one table and 2 from one table and 1 from one table.). and i want to fetch data in difrnt combinations.and in start of selection i m writing condition like below. but it is not performaing.there is no mandatory field. can anybody give me short way to fetch data from difrnt combinations. very urgent....

im writing the if condition like this. for two combinations.

START-OF-SELECTION.

IF S_WERKS EQ ' ' AND S_MATNR EQ ' ' AND S_LIFNR EQ ' ' AND S_MTART EQ 'X' OR S_MATKL EQ 'X'.

PERFORM GET_MARA.

ELSEIF S_WERKS EQ 'X' OR S_MATNR EQ 'X' OR S_LIFNR EQ 'X'.

PERFORM GET_MSEG.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
801

Sameer,

what are the 7 input fields & 3 db tables?

Satish

Read only

0 Likes
801

Hi satish.

inputs:

plant-mseg

matnr-mseg

vendor-mseg

taxcode-mseg

mtart-mara

matkl-mara

date-mkpf

Read only

former_member194152
Contributor
0 Likes
801

Hi,

In selection screen you have declare parameter or select-option because if you declare select-option then 'EQ' will not work for that you have to change it with 'IN' operator or for parameter 'EQ' will work.so just confirm.

Rewards if helpful.

Cheers

Gagan

Read only

Former Member
0 Likes
801

Hi,

try like this,

START-OF-SELECTION.

IF S_WERKS is initial AND S_MATNR is initial AND S_LIFNR is initial AND ( not S_MTART is initial OR not S_MATKL is initial ).

PERFORM GET_MARA.

ELSEIF not S_WERKS is initial OR not S_MATNR is initial OR not S_LIFNR is initial .

PERFORM GET_MSEG.

ENDIF.

Thanks!

Brunda

'Reward is useful'.

Read only

Former Member
0 Likes
801

u can use table join i.e inner join.

is there any relationship b/w the tables?

'eq' is not associated with select-options

u have to use 'in'.

reward if useful

umakanth

Read only

Former Member
0 Likes
801

instead of writing EQ '' write is initial