2007 Oct 01 5:16 PM
Hi Experts,
I have field(mara-matnr) in selection screen.(F4IF_FIELD_VALUE_REQUEST).
Here it selects all values from that database table(mara) and displays in popup screen on F4 .But i want only first 100 values in popup screen.
How to achieve this?
Please help me.
2007 Oct 01 7:31 PM
Hi Vijay,
Do this way and you can restrict the number of hits to 100....
Report ztest.
TABLES: mara.
types: BEGIN OF i_matnr,
matnr type mara-matnr,
END OF i_matnr.
DATA: i_matnr TYPE STANDARD TABLE OF i_matnr.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
AT SELECTION-SCREEN on VALUE-REQUEST FOR s_matnr-low.
Refresh: i_matnr[].
SELECT matnr FROM mara into TABLE i_matnr UP TO 100 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'MATNR'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = i_matnr
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
AT SELECTION-SCREEN on VALUE-REQUEST FOR s_matnr-high.
Refresh: i_matnr[].
SELECT matnr FROM mara into TABLE i_matnr UP TO 100 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'MATNR'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = i_matnr
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Hope this helps.
Regards,
Vivek
Hi Vijay,
Do this way and you can restrict the number of hits to 100....
Report ztest.
TABLES: mara.
types: BEGIN OF i_matnr,
matnr type mara-matnr,
END OF i_matnr.
DATA: i_matnr TYPE STANDARD TABLE OF i_matnr.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
AT SELECTION-SCREEN on VALUE-REQUEST FOR s_matnr-low.
Refresh: i_matnr[].
SELECT matnr FROM mara into TABLE i_matnr UP TO 100 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'MATNR'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = i_matnr
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
AT SELECTION-SCREEN on VALUE-REQUEST FOR s_matnr-high.
Refresh: i_matnr[].
SELECT matnr FROM mara into TABLE i_matnr UP TO 100 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'MATNR'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = i_matnr
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Hope this helps.
Regards,
Vivek
2007 Oct 01 6:35 PM
Hi
You create a Z table with MATNR and MAKTX fields and write a small program to fetch the first 100 values from MARA and movr them to this Z table
Now create a search help(elementary) for this field MATNR with this Z table
and add that search help name to the field MATNR.
If you won't give any search help by default it takes the std search help from MARA and uses it.
This will work
Regards
Anji
2007 Oct 01 6:44 PM
Hi,
Why can't you use the standard sap search help MAT1
PARAMETERS: P_MATNR LIKE MARA-MATNR.
Thanks
Naren
2007 Oct 01 7:31 PM
Hi Vijay,
Do this way and you can restrict the number of hits to 100....
Report ztest.
TABLES: mara.
types: BEGIN OF i_matnr,
matnr type mara-matnr,
END OF i_matnr.
DATA: i_matnr TYPE STANDARD TABLE OF i_matnr.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
AT SELECTION-SCREEN on VALUE-REQUEST FOR s_matnr-low.
Refresh: i_matnr[].
SELECT matnr FROM mara into TABLE i_matnr UP TO 100 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'MATNR'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = i_matnr
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
AT SELECTION-SCREEN on VALUE-REQUEST FOR s_matnr-high.
Refresh: i_matnr[].
SELECT matnr FROM mara into TABLE i_matnr UP TO 100 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'MATNR'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_MATNR-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = i_matnr
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Hope this helps.
Regards,
Vivek
2007 Oct 02 1:55 AM
As Narendran says, why not use the default search help for MARA-MATNR... then your user should see a parameter screen with one of the options being the number of entries to return (default 500)...?
Jonathan
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |