Skip to Content
author's profile photo Former Member
Former Member

Search functionality

Hi,

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

Could anyone explain me in detail.

Thanks!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2007 at 04:32 PM

    run Report BALVBUFDEL once

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.