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

Former Member
0 Likes
386

hi experts,

in alv reporting give me an idea about alv interactive an drilldown reporting.

hi experts,

in alv reporting give me an idea about alv interactive an drilldown reporting.

2 REPLIES 2
Read only

Former Member
0 Likes
346

Hi raghuveer,

1. There are some parameters

in the FM which are passed,

and a new FORM has to be written.

2. Just copy paste this code in new program.

3. It will display list of company.

On double-clicking on the alv,

it will again display the clicked company code.

Important code has been marked.

4.

REPORT abc.

TYPE-POOLS : slis.

*----


Data

DATA : ITAB LIKE T001 OCCURS 0 WITH HEADER LINE.

DATA : PTAB LIKE T001 OCCURS 0 WITH HEADER LINE.

DATA : alvfc TYPE slis_t_fieldcat_alv.

*----


Select Data

SELECT * FROM t001 INTO TABLE itab.

*------- Field Catalogue

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


Display

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

i_callback_program = sy-repid "<-------Important

i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

*----


  • CALL BACK FORM

*----


FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE

slis_selfield.

READ TABLE itab INDEX whatrow-tabindex.

SELECT * FROM t001 INTO TABLE Ptab

WHERE BUKRS = ITAB-BUKRS.

CLEAR ALVFC.

REFRESH ALVFC.

*------- Field Catalogue

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'PTAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


Display

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

TABLES

t_outtab = Ptab

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM. "ITAB_user_command

regards,

amit m.

Read only

Former Member
0 Likes
346

Check this example BCALV_GRID_02.

Regards,

Arun.