Application Development 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: 

select option

Former Member
0 Kudos

Hello All,

I have 4 select options in program.If user will not enter one secect option on screen.

Then in program it should select the data for that select option which is not entered by user.

5 REPLIES 5

Former Member
0 Kudos

check if the select-option is initial .. as

if s_s1[] is initial.

*--write select using this select option

elseif s_s2[] is initial.

*--write select using this select option

elseif s_s3[] is initial.

*--write select using this select option

elseif s_s4[] is initial.

*--write select using this select option

endif.

Former Member
0 Kudos

Hi,

Check this code...

TABLES:
spfli.

DATA:
  t_spfli LIKE STANDARD TABLE OF spfli.
PARAMETERS:
     p_carrid  TYPE spfli-carrid,
     p_connid TYPE spfli-connid.

*Check the condition if the parameter is initial and proceed depending on logic

IF P_CONNID IS INITIAL
    SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid NE  p_carrid.

ELSE IF P_carrid IS  INITIAL
    SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid NE p_connid.

ELSE.
   SELECT * FROM spfli INTO TABLE t_spfli .

ENDIF.

Loop the table and display entries if needed.

Hope this would help you.

Regards

Narin Nandivada.

Former Member
0 Kudos

hi you need to write the combinations like this for the 4 select options

if s_s1[] is initial or s_s2[] is initial or s_s3[] is initial.

elseif ...

elseif..

endif.

Former Member
0 Kudos

hi,

Each select-option is a Internal table in itself. So you can check of their blank value and write the code there.

If s_one is initial.

select query.

elseif s_two is initial.

....

endif.

Regards

Sumit Agarwal

Former Member
0 Kudos

Hii!

Check out this sample code.


REPORT z_sdn.

TABLES:
  sflight.
SELECT-OPTIONS:
  s_carrid FOR sflight-carrid,
  s_connid FOR sflight-connid.



IF s_connid IS INITIAL.
  SELECT connid
    FROM sflight
    INTO s_connid-low
   WHERE carrid IN s_carrid.
  ENDSELECT.
  APPEND s_connid.
ENDIF.



START-OF-SELECTION.
  IF s_connid IS INITIAL.
    SELECT connid
      FROM sflight
      INTO s_connid-low
     WHERE carrid IN s_carrid.
    ENDSELECT.
    APPEND s_connid.
  ENDIF.

  WRITE:
    s_carrid-low,
    s_connid-low.

Regards

Abhijeet