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

restricting values in parameter statement

Former Member
0 Likes
1,238

hi all

can anyone tell me like s there any possibility of restrictin values durin selection thru parameters or select-ooption

for example if im using matnr as the variable tht s to be selected thru parameter stmt i jst want the first 10 values only whn i click f4 key how can i do tht

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
870

hi,

try fm F4IF_INT_TABLE_VALUE_REQUEST

Andreas

7 REPLIES 7
Read only

andreas_mann3
Active Contributor
0 Likes
871

hi,

try fm F4IF_INT_TABLE_VALUE_REQUEST

Andreas

Read only

0 Likes
870

hey i hope this will help ... and put upto 10 rows in the select statement

AT SELECTION-SCREEN.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_workc.

CLEAR: dynpfields, t_work.

REFRESH: dynpfields, t_work.

dynpfields-fieldname = 'P_PLANT'.

APPEND dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'ZPPR_GRP_DPR'

dynumb = '1000'

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

dynpfields = dynpfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11

.

IF sy-subrc <> 0.

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

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

ENDIF.

SELECT arbpl FROM

s024

INTO TABLE t_work

WHERE werks = dynpfields-fieldvalue.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ARBPL'

dynpprog = 'ZPPR_GRP_DPR'

dynpnr = '1000'

dynprofield = 'P_WORKC'

value_org = 'S'

TABLES

value_tab = t_work.

reward points if helpfull

rohit gupta

Read only

0 Likes
870

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: p_date FOR sy-datum OBLIGATORY .

PARAMETER p_plant LIKE afru-werks OBLIGATORY DEFAULT '3200'.

PARAMETER p_workc LIKE s024-arbpl .

SELECTION-SCREEN END OF BLOCK b1 .

Read only

0 Likes
870
initialization.
 

 
  select matnr into table it001 from mara up to 10 rows.
 
  sort it001 ascending by matnr.
  delete adjacent duplicates from it001 .
 
at selection-screen on value-request for s_matnr.
 
  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'MATNR'
            dynprofield = 'S_MATNR'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = it001.
 
start-of-selection.

Read only

Former Member
0 Likes
870

Hi,

There are two ways of doing this .

1. If you`d like to standard SAP SEARCH HELP attached with your parameter, you can use a SEARCH HELP EXIT to restrict values of selection.

2. Other way is don`t use a standard search help instead use your own match code object. If this`s the case you would opt for you`ll use dynamic search help function module.

I`d replied for a question in the following forum, try that your need will be addressed. Click the belowsaid link :

Hope this would be helpful, reward points if so.

Regards

Read only

Former Member
0 Likes
870

hi kishan

whn i tried your coding the value is bein restricted but the issue now is in the screen i get the status as 10 etries found but the values r not displayed in the screen jst the plain screen with the status is display where am i goin wrong

Read only

0 Likes
870

hi do like this :

data : p_matnr like mara-matnr.

data : begin of itab occurs 0,

matnr like mara-matnr,

end of itab.

select matnr

into table itab

from mara up to 10 rows.

if sy-subrc = 0.

sort itab by matnr.

endif.

<b>at selection-screen on value-request for p_matnr.</b>

call function <b>'F4IF_INT_TABLE_VALUE_REQUEST'</b>

exporting

retfield = 'MATNR'

dynprofield = p_matnr

tables

value_tab = itab.

Regards

Ashok P