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

data enter in parameters & display accordingly

Former Member
0 Likes
968

Hi all,

If I have say 6 (fields or) parameters on selection screen & if user enters any 1 any 2 or any combination or all then also data show for that I have to write all permutation combination in if else condition instead of that is there any function module or any logic to do so please help me for that

Ketan

ABAP consultant

Edited by: ketan pande on Feb 16, 2009 8:23 AM

Hi all,

If I have say 6 (fields or) parameters on selection screen & if user enters any 1 any 2 or any combination or all then also data show for that I have to write all permutation combination in if else condition instead of that is there any function module or any logic to do so please help me for that

Ketan

ABAP consultant

Edited by: ketan pande on Feb 16, 2009 8:23 AM

6 REPLIES 6
Read only

Former Member
0 Likes
841

Hi,

use at selection-screen output validations.

at selection-screen output.

if f1 eq ' ' OR f2 eq ' ' OR f3 eq ' ' OR f4 eq ' ' OR f5 eq ' ' OR f6 eq ' '.( If u want all fields to be entered)

message 'Please make an entry in all fields' type 'S'.

endif.

If u want only some fields to be mandatory use

addition mandatory to parameters declaration.

( Then automatically,system prompts to enter values if user doesnot enter and tries to execute )

Read only

Former Member
0 Likes
841

use select-options instead of parameters in your selection-screen . also use "IN" instead of "EQ" in your database query. You don't need for the permutation of the fields entered.

Regards,

Mon Magallanes

Read only

Former Member
0 Likes
841

You have to use If else endif conditions for all the combinations if selecting from different tables for parameters.

regards,

Jinson.

Read only

Former Member
0 Likes
841

Hi..Use this codings

AT SELECTION-SCREEN OUTPUT .

LOOP AT SCREEN.

IF SCREEN-NAME = 'PARAM1'

OR SCREEN-NAME = PARAM2'

OR SCREEN-NAME = PARAM3'

OR SCREEN-NAME = PARAM4'

OR SCREEN-NAME = PARAM5'

OR SCREEN-NAME = PARAM6'

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

dev_parbutteea
Active Contributor
0 Likes
841

Hi,

Either you use

- a single select option

- if you have to use multiple parameters, you have to append all values in a range and use it in your select.

Regards.

Read only

Former Member
0 Likes
841

Hello Ketan,

Try the following code-snap, hope it helps you.


DATA:
  BEGIN OF fs_table,
    carrid TYPE spfli-carrid,
    connid TYPE spfli-connid,
    fltime TYPE spfli-fltime,
    cityfrom TYPE spfli-cityfrom,
    cityto TYPE spfli-cityto,
  END OF fs_table.

DATA:
  t_table LIKE STANDARD TABLE OF fs_table.

PARAMETERS:
  p_carrid TYPE spfli-carrid,
  p_connid TYPE spfli-connid,
  p_fltime TYPE spfli-fltime,
  p_cityfr  TYPE spfli-cityfrom,
  p_cityto TYPE spfli-cityto.

SELECT carrid
       connid
       fltime
       cityfrom
       cityto
FROM spfli
INTO TABLE t_table
WHERE carrid EQ p_carrid OR
      connid EQ p_connid OR
      fltime EQ p_fltime OR
      cityfrom EQ p_cityfr OR
      cityto EQ p_cityto.

LOOP AT t_table INTO fs_table.
  WRITE:/ fs_table-carrid,
  fs_table-connid,
  fs_table-fltime,
  fs_table-cityfrom,
  fs_table-cityto.
ENDLOOP.

If you have got 5 parameters and you mention AND in SELECT query, all the 5 parameters have to fulfill the condition, whereas if you mention OR that checks for only the given value.

Thanks: Zahack