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

filtering programatically in alv report

Former Member
0 Likes
4,933

please let me know is it posible to filering in alv report.please respond immediately....

6 REPLIES 6
Read only

Former Member
0 Likes
2,365

Yes, U hav the Feature called Filtering Option once you call the FM: Reuse_ALV_grid_display. By using this Filter feature user can display the report according the values set in the filter.

By

Sunil

Read only

Former Member
0 Likes
2,365

Yes It is possible to apply filters on ALV programatically .

Use the sample code in OOPS

DATA ls_filt TYPE lvc_s_filt .

ls_filt-fieldname = 'FLDATE' .

ls_filt-sign = 'E' .

ls_filt-option = 'BT' .

ls_filt-low = '20030101' .

ls_filt-high = '20031231' .

APPEND ls_filt TO pt_filt .

and pass the table pt_filt to set_table_display

IN alv list or GRID

FILL the structure SLIS_T_FILTER_ALV.

PLease reward if useful.

Read only

p291102
Active Contributor
0 Likes
2,365

HI,

Filtering option is there. That icon is white colour icon (set filter ctrl+f5) is there. It is very much useful for the values are coming in the output to be modifyed by the endusers.

Thanks,

Shankar

Read only

Former Member
0 Likes
2,365

Hi,

You can filter the ALV output. Click on filter icon and filter the output.

Use structure to initialise the field catalog

othewise the filter wont work perfectly.

regards

Shiva

Read only

Former Member
0 Likes
2,365

Hi anil,

here a short extract with 2 Filter-Parameters as i use:

DATA: FILTER_1 TYPE SLIS_T_FILTER_ALV.

DATA: BEGIN OF ITEM_ALL OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

VBELN LIKE VBAP-VBELN,

POSNR LIKE VBAP-POSNR,

MATNR LIKE VBAP-MATNR,

MATKL LIKE MARA-MATKL,

MAKTX LIKE MAKT-MAKTX,

KWMENG LIKE VBAP-KWMENG, "Menge Auftrag

VRKME LIKE VBAP-VRKME,

RFMNGJ LIKE VBFA-RFMNG, "Menge Lieferung

RFMNGR LIKE VBFA-RFMNG, "Menge Warenbewegung

RFMNGM LIKE VBFA-RFMNG, "Menge Faktura

END OF ITEM_ALL.

  • Filter für detail setzen

WA_FILTER-TABNAME = 'ITEM_ALL'.

WA_FILTER-FIELDNAME = 'KUNNR'.

WA_FILTER-SIGN0 = 'I'.

WA_FILTER-OPTIO = 'BT'.

WA_FILTER-VALUF_INT = KUNNR. "From Kunnr

WA_FILTER-VALUT_INT = KUNNR. "TO Kunnr

APPEND WA_FILTER TO FILTER_1.

*

WA_FILTER-TABNAME = 'ITEM_ALL'.

WA_FILTER-FIELDNAME = 'MATNR'.

WA_FILTER-SIGN0 = 'I'.

WA_FILTER-OPTIO = 'BT'.

WA_FILTER-VALUF_INT = MATNR. "From Matnr

WA_FILTER-VALUT_INT = MATNR. "To Matnr

APPEND WA_FILTER TO FILTER_1.

*

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = PROGNAME

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IT_FIELDCAT = FIELDCAT_1

IT_FILTER = FILTER_1

IT_EVENTS = EVENTS

IT_EVENT_EXIT = EVENT_EXIT

I_SCREEN_START_COLUMN = 20

I_SCREEN_START_LINE = 05

I_SCREEN_END_COLUMN = 100

I_SCREEN_END_LINE = 30

TABLES

T_OUTTAB = ITEM_ALL

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

Regards, Dieter

Read only

0 Likes
2,365

Hi Anil,

problem solved?

regards, Dieter