2006 Jun 16 8:15 AM
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....
2006 Jun 16 8:56 AM
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
2006 Jun 16 8:19 AM
use search help with the field in this way you can display values and also input manully.
Regards
Wasim Ahmed
2006 Jun 16 8:56 AM
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
2006 Jun 16 9:01 AM
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.
2006 Jun 16 9:23 AM
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