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

SELECT-OPTIONS Restriction..

Former Member
0 Likes
831

Hi friends,

i have SELECT-OPTIONS statement is there.. but i dont want to display all values in that F4 help.. in selection screen.. I mean. i want to restrict specific values..

for example.. when i execute the program user can able to see only some values..(from e101 to e199 values only) but my data base having thousends of data...

so, for that what statement can i write..

thanks

babu

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
771

Hi,

You can create your own search help and with the help of search help exit you can filter the data.

Alternatively you can use the option if providing your own list at the followsing event blocks.

<b>Assuming you select-options name as selcrit.</b>

AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-low.

*USE the IF_F4 function module to show the filtered data.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-high.

*USE the IF_F4 function module to show the filtered data.

Regards,

Sesh

6 REPLIES 6
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
772

Hi,

You can create your own search help and with the help of search help exit you can filter the data.

Alternatively you can use the option if providing your own list at the followsing event blocks.

<b>Assuming you select-options name as selcrit.</b>

AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-low.

*USE the IF_F4 function module to show the filtered data.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-high.

*USE the IF_F4 function module to show the filtered data.

Regards,

Sesh

Read only

Former Member
0 Likes
771

HI,

You can do that in

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prd-low.

make a select on database table into it_value table and delete the unnecessary values

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

dynpprog = lv_dynprog

dynpnr = lv_dynpnr

TABLES

value_tab = it_valuetab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

you will get in F4 help.

rewards if useful,

regards,

nazeer

Read only

Former Member
0 Likes
771

try this one........

tables:mara.

data: BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

MBRSH LIKE MARA-MBRSH,

END OF ITAB.

.

selection-screen: begin of block b1 with frame title t1.

select-options: p_matnr for ITAB-matnr.

selection-screen: end of block b1.

INITIALIZATION.

select MATNR MBRSH UP TO 10 ROWS from mara into table itab.

at selection-screen on value-request for p_matnr-LOW.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MATNR'

  • PVALKEY = ' '

DYNPPROG = sy-cprog

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_MATNR'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = ITAB

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

Former Member
0 Likes
771

Hi,

you can also use the following code during validation:

CALL FUNCTION 'F4IF_MAXRECORDS_ALL'

EXPORTING

client = sy-mandt

user = sy-uname

IMPORTING

maxrecords = lv_max_row.

Read only

0 Likes
771

Hi friends,

I'm not a ABAPer.. so, i did't understand what i have to do.. but.. MOHITH gave that one is .. he is telling upto internal table.. we are retriving only 10 rows..from DB table..

my situation is , upto internal table.. I'm getting entire data.. so, we have to restrict in select options only...

so, plz give me clear statements.. what i have to write..

thanks

babu

Read only

0 Likes
771

Hi,

USE

<b>AT SELECTION-SCREEN ON VALUE-REQUEST FOR SELCRIT-HIGH</b>

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'TYPE_OF_YOUR_FIELD' "<b> Enter the TYPE of your Select-options</b>

DYNPPROG = sy-cprog

DYNPNR = sy-dynnr

DYNPROFIELD = 'SELCRIT-HIGH'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB <b>" Your internal table"</b>

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

<b>AT SELECTION-SCREEN ON VALUE-REQUEST FOR SELCRIT-LOW</b>

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'TYPE_OF_YOUR_FIELD' "<b> Enter the TYPE of your Select-options</b>

DYNPPROG = sy-cprog

DYNPNR = sy-dynnr

DYNPROFIELD = 'SELCRIT-LOW'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB <b>" Your internal table"</b>

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

Regards,

Sesh