07-23-2008 12:19 PM
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.
07-23-2008 12:23 PM
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.
07-23-2008 12:23 PM
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.
07-23-2008 12:31 PM
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.
07-23-2008 12:44 PM
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
07-23-2008 12:49 PM
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