‎2007 Aug 23 3:59 AM
Hi Friends,
I have a requirement like user wants to select the data based on the character field that is.,
In select option he wants to keep the character field and wants to pick data from the database table on this selection critenia.
Please tell me how to do this.
Regards,
Line
‎2007 Aug 23 4:07 AM
Hi Turbin,
try this.
select-options : a type c.
in start-of-selection event use a.
example.
start-of-selection.
maildt1 = a.
use this maidt1 in your select statement. Hope this will work out.
reward if useful.
all the best.
kishore.
‎2007 Aug 23 4:07 AM
Hi Turbin,
try this.
select-options : a type c.
in start-of-selection event use a.
example.
start-of-selection.
maildt1 = a.
use this maidt1 in your select statement. Hope this will work out.
reward if useful.
all the best.
kishore.
‎2007 Aug 23 8:31 AM
Hiii, to get data from a database table for slection screen field which is decalred as character field for that you need to declare the selection screen field wiht the similar length if the database table field name.
for example the database table field length is 15 chars then you have to declare the selection screen text also 15 char length.
I am forwarding sample code for that.
SELECT-OPTIONS: chr(15) type c.
AT SELECTION-SCREEN ON VALUE-REQUEST for chr.
PERFORM CHR_HELP
FORM CHR_HELP
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = '<database table name>'
fieldname = '<Field name>'
SEARCHHELP = ' '
SHLPPARAM = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
VALUE = ' '
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
RETURN_TAB =
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
.
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.
Hope it will works.
Reward points if helpful.