‎2006 Aug 07 10:18 AM
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
‎2006 Aug 07 10:25 AM
‎2006 Aug 07 10:25 AM
‎2006 Aug 07 10:27 AM
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
‎2006 Aug 07 10:29 AM
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 .
‎2006 Aug 07 10:30 AM
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.
‎2006 Aug 07 10:34 AM
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
‎2006 Aug 08 11:15 AM
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
‎2006 Aug 08 11:36 AM
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