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

Module pool

Former Member
0 Likes
391

I have displayed records from DB table to a table control.There are more than 100 records.Now i want to keep a search button in which we want to give the key value and it want to take to tht particular line(either it is 99th line or 12th line)

Note : In the screen we can only view 10 records at a time.

can any tell how to get this

2 REPLIES 2
Read only

Former Member
0 Likes
365

Mahesh,

FIELD-SYMBOLS: <F1>.

CALL FUNCTION 'TABLE_GET_KEY_TO_SET_CUR_ROW'

EXPORTING

TABLE = TABLE

F4_FORMNAME = 'TSFP_F4'

F4_PROGRAMNAME = 'SAPLSVIX'

IMPORTING

TABLE_KEY = READ_TABLE

TABLES

SELLIST = SELLIST

EXCLUDE_FIELDS = EXCLUDE_FIELDS

EXCEPTIONS

CANCELLED_BY_USER = 01

TABLE_NOT_FOUND = 02.

CASE SY-SUBRC.

WHEN 1. RAISE CANCELLED_BY_USER.

WHEN 2. RAISE TABLE_NOT_FOUND.

ENDCASE.

RETURNCODE = 0000.

POSITION = 1.

SY-FDPOS = STRLEN( READ_TABLE ).

IF SY-FDPOS = 0. SY-FDPOS = 1. ENDIF. "Leereintrag SW 20.08.1997

ASSIGN READ_TABLE(SY-FDPOS) TO <F1>.

READ TABLE READ_TABLE WITH KEY <F1> BINARY SEARCH.

POSITION = SY-TABIX.

RETURNCODE = SY-SUBRC.

Don't forget to reward if useful......

Read only

0 Likes
365

Thanks,

here u have given tht functionmodule right.In tht in importing u have given read_table..

How we want to define the read_table.