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

ALV_GRID Functionality

Former Member
0 Likes
520

Hi Guys I am working on ALV_GRID Rrport and I want to add few functionalities to my report:

1. when I see the output of my report, I want some of the fields to have that F4 feature in wich the field will have a drop down list.

2. My report has got millions of records, so what I want is when User execute this report he should get a pop up where he can enter how may records he wants to see, for example if he enters 200 then only 200 records will be displayed.

can you please tell how can I achieve these.

Thanks,

Rajeev

4 REPLIES 4
Read only

Former Member
0 Likes
492

hi check this simple report ...for popup..

report zalv_sample .

tables vbak.

data it_vbak like vbak occurs 0 with header line.

select * from vbak

into corresponding fields of table it_vbak

up to 100 rows.

call function 'REUSE_ALV_POPUP_TO_SELECT'

exporting

i_title = 'SALES ORDER INFO'

i_zebra = 'X'

i_tabname = 1

i_structure_name = 'vbak'

tables

t_outtab = it_vbak .

regards,

venkat .

Read only

Former Member
0 Likes
492

Hi,

For the first question you can do the following:

you have to pass a parameter in the field catalog Referencefield. Then you will get F4 help for that field in the ALV grid.

REF_FIELDNAME : field

It worked for us.

W_FIELDCAT-REF_FIELDNAME = 'MATNR'.

W_FIELDCAT-FIELDNAME = 'MATNR'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'MATERIAL NUMBER'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '2'.

APPEND W_FIELDCAT TO I_FIELDCAT.

So if you want to have F4 functinality then provide the fieldcatalog as above for the fields.

<REMOVED BY MODERATOR>

Thanks and Regards.

Edited by: Alvaro Tejada Galindo on Apr 24, 2008 3:34 PM

Read only

Former Member
0 Likes
492

1)use this statements for your fields in whcih you want f4 help:

it_fieldcat-field = <ur field >.

it_fieldcat-REF_FIELDNAME = 'MATNR'.

it_fieldcat-REF_TABNAME = 'MARA'.

append it_fieldcat.

2)use FM: REUSE_ALV_POP_UP_TO_SELECT.

Regards.

Dara.

Read only

former_member125661
Contributor
0 Likes
492

For the 2), u can have a parameter in the selection screen of your report - say n which limits the # of entries picked.and when you do the select query, use select * from db_table up to n rows into table intab_name .

Now for 1) To have F4 pop up for certain fields, you have 2 options. One is to use proper reference fields , mark F4AVAILABL as 'X' in the field catalog or fill checktable in the field catalog. If many fields need F4 , it is easier to create a structure with proper reference,check tables and use it directly.