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: 

Search functionality

Former Member
0 Kudos

Hi,

I would like to add the "Search" functionality to my ALV report.

Could anyone explain me in detail.

Thanks!!

4 REPLIES 4

Former Member
0 Kudos

run Report BALVBUFDEL once

0 Kudos

unable to do it. It says "%F buffer of EUINFO/LTEX has been reset"

Can you explain me in more detail how it is related?

0 Kudos

HELLO,

DO U WANT ALV SEARCH HELP?

0 Kudos

TYPE-POOLS: slis.

DATA: BEGIN OF itab OCCURS 0,

VBELN TYPE VBELN,

END OF itab.

DATA: BEGIN OF itab1 OCCURS 0,

VBELN TYPE VBELN,

POSNR TYPE POSNR,

NETPR TYPE NETPR,

matnr type matnr,

END OF itab1.

DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.

DATA: s_fieldcatalog TYPE slis_fieldcat_alv.

s_fieldcatalog-col_pos = '1'.

s_fieldcatalog-fieldname = 'VBELN'.

s_fieldcatalog-tabname = 'ITAB1'.

s_fieldcatalog-rollname = 'VBELN'.

APPEND s_fieldcatalog TO t_fieldcatalog.

s_fieldcatalog-col_pos = '2'.

s_fieldcatalog-fieldname = 'POSNR'.

s_fieldcatalog-tabname = 'ITAB1'.

s_fieldcatalog-rollname = 'POSNR'.

APPEND s_fieldcatalog TO t_fieldcatalog.

clear: s_fieldcatalog.

s_fieldcatalog-col_pos = '3'.

s_fieldcatalog-fieldname = 'NETPR'.

s_fieldcatalog-tabname = 'ITAB1'.

s_fieldcatalog-rollname = 'NETPR'.

s_fieldcatalog-do_sum = 'X'.

APPEND s_fieldcatalog TO t_fieldcatalog.

clear: s_fieldcatalog.

s_fieldcatalog-col_pos = '4'.

s_fieldcatalog-fieldname = 'MATNR'.

s_fieldcatalog-tabname = 'ITAB1'.

s_fieldcatalog-rollname = 'MATNR'.

s_fieldcatalog-ref_tabname = 'MARA'.

s_fieldcatalog-ref_fieldname = 'MATNR'.

s_fieldcatalog-edit = 'X'.

s_fieldcatalog-input = 'X'.

APPEND s_fieldcatalog TO t_fieldcatalog.

SELECT VBELN UP TO 10 ROWS

FROM

VBAK

INTO TABLE ITAB.

IF NOT ITAB[] IS INITIAL.

SELECT VBELN POSNR NETPR matnr

FROM VBAP

INTO TABLE ITAB1

FOR ALL ENTRIES IN ITAB

WHERE VBELN = ITAB-VBELN.

ENDIF.

DATA: v_repid TYPE syrepid.

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = v_repid

IT_FIELDCAT = t_fieldcatalog

TABLES

t_outtab = itab1

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.