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

Selection screen with character

Former Member
0 Likes
940

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

1 ACCEPTED SOLUTION
Read only

kishorepallapothula
Participant
0 Likes
753

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.

2 REPLIES 2
Read only

kishorepallapothula
Participant
0 Likes
754

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.

Read only

Former Member
0 Likes
753

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.