Application Development 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: 

There is no dropdownlist that allow us t o enter text?

kowong
Participant
0 Kudos
98

Hi all,

I need to use dropdown list for the input, and if there is no selection available in the list, the user may need to enter data by typing instead of selecting.... and there is no such control object in SAP screen? how should i do that......

THank you alll....

1 ACCEPTED SOLUTION

Former Member
0 Kudos
61

Hi,

Yes u can attach a custom search help to the field.

Use the following code:

parameters: p_var(30).

DATA: BEGIN OF LT_tab OCCURS 0,

ret TYPE char10,

END OF LT_TAB.

initialization.

*******add the data to be displayed in dropdown

*******in the table LT_TAB

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.

PERFORM GET_VAR.

FORM GET_VAR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'RET'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_VAR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = LT_TAB

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.

ENDFORM. "show_client

4 REPLIES 4

dani_mn
Active Contributor
0 Kudos
61

use search help with the field in this way you can display values and also input manully.

Regards

Wasim Ahmed

Former Member
0 Kudos
62

Hi,

Yes u can attach a custom search help to the field.

Use the following code:

parameters: p_var(30).

DATA: BEGIN OF LT_tab OCCURS 0,

ret TYPE char10,

END OF LT_TAB.

initialization.

*******add the data to be displayed in dropdown

*******in the table LT_TAB

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.

PERFORM GET_VAR.

FORM GET_VAR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'RET'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_VAR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = LT_TAB

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.

ENDFORM. "show_client

Former Member
0 Kudos
61

Kokwei,

1) If it is a primary key it will pick up values autiomaticaly. You can enter values there.

Eg:

Parameters p_matnr like mara-matnr.

2) You can make use of searchhelp. Go to SE11 and create.(this is nothing but the match code)

3) Use FM Module <b>F4IF_INT_TABLE_VALUE_REQUEST</b>

rgds,

TM.

former_member188685
Active Contributor
0 Kudos
61

Hi,

Dropdown list is ment for selecting the values from the Drop down list , Not for Inputting the values. If there are no values why are you going for Drop down list box. Go for Input Field with Search Help . that solves your Problem. if you don't get any values from F4 help, then enter your own value.

you need to think about it once.

Regards

vijay