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

Filter on select-options

Former Member
0 Likes
2,709

Hi,

i have a select-options like "select-options p_mstae for mara-mstae." and, on the selection screen, it displays this list :

MMSTA | MTSTB

01 | Art. fab -creation

02 | ...

03 | ...

04 | ...

05 | ...

06 | ...

07 | ...

... | ...

But i want only the lines with the values 01, 02, 04 on the display list of the select-options.

Is there a way to do that plz ? a way to filter the list ?

Thanks,

Gabriel

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,189

use liek dis...

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

SELECT MMSTA MTSTB

FROM t141

INTO TABLE it_t141.

WHERE ur conditions. "or filter out later

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MMSTA'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_MSTAE-LOW'

value_org = 'S'

TABLES

value_tab = it_t141

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.

Repeat the same for 'P_MSTAE-HIGH'

3 REPLIES 3
Read only

Former Member
0 Likes
1,189

If this is a custom program, you need to change the code which pre-populates the selection list, within

AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field name>

for the respective field.

Read only

Former Member
0 Likes
1,190

use liek dis...

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

SELECT MMSTA MTSTB

FROM t141

INTO TABLE it_t141.

WHERE ur conditions. "or filter out later

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MMSTA'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_MSTAE-LOW'

value_org = 'S'

TABLES

value_tab = it_t141

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.

Repeat the same for 'P_MSTAE-HIGH'

Read only

Former Member
0 Likes
1,189

Thanks for your accurate answers.

Gabriel.