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 REPORT

Former Member
0 Likes
964

Hi,

please any body give me the answer to my dought.

iam using grid display in my report.i want make ths interactive functionality to this report.how to make grid dispaly in interactive way.

please reply it very urgent.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
805

Hi,

Hello,

check this sample program:

&----


report zkeerthi_alv5 .

&----


*& tables declaration

&----


tables: vbrk,vbrp.

&----


*& type-pools declaration

&----


type-pools: slis.

&----


*& data declaration

&----


data: g_repid type sy-repid.

data : it_fieldcat type slis_t_fieldcat_alv, "mara

wa_fieldcat type slis_fieldcat_alv,

wa_layout type slis_layout_alv,

wa_event type slis_alv_event,

t_event type slis_t_event.

data: v_vbeln like vbrk-vbeln,

v_matnr like vbrp-matnr.

data: begin of it_vbrk occurs 0,

vbeln like vbrk-vbeln,

waerk like vbrk-waerk,

vkorg like vbrk-vkorg,

fkdat like vbrk-fkdat,

bukrs like vbrk-bukrs,

netwr like vbrk-netwr,

end of it_vbrk.

data: begin of it_vbrp occurs 0,

vbeln like vbrp-vbeln,

posnr like vbrp-posnr,

fkimg like vbrp-fkimg,

vrkme like vbrp-vrkme,

netwr like vbrp-netwr,

matnr like vbrp-matnr,

arktx like vbrp-arktx,

end of it_vbrp.

&----


*& selection screen

&----


selection-screen begin of block b with frame title text-001.

select-options: s_vbeln for vbrk-vbeln,

s_fkdat for vbrk-fkdat,

s_matnr for vbrp-matnr.

selection-screen end of block b.

**INITIALIZATION.

initialization.

g_repid = sy-repid.

s_fkdat-low = sy-datum - 200.

s_fkdat-high = sy-datum.

append s_fkdat.

***AT SELECTION-SCREEN.

at selection-screen.

if not s_vbeln is initial.

select single vbeln from vbrk

into v_vbeln

where vbeln in s_vbeln.

if sy-subrc <> 0.

message e001(zz2).

endif.

endif.

if not s_matnr is initial.

select single matnr from mara

into v_matnr

where matnr in s_matnr.

if sy-subrc <> 0.

message e001(zz2).

endif.

endif.

***START-OF-SELECTION.

start-of-selection.

perform get_data_vbrk.

&----


*& Form GET_DATA_VBRK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_vbrk .

select vbeln

waerk

vkorg

fkdat

bukrs

netwr

into table it_vbrk

from vbrk

where vbeln in s_vbeln

and fkdat in s_fkdat.

endform. " GET_DATA_VBRK

&----


*& Form GET_DATA_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_vbrp .

select vbeln

posnr

fkimg

vrkme

netwr

matnr

arktx

from vbrp

into table it_vbrp

where vbeln = it_vbrk-vbeln.

endform. " GET_DATA_VBRP

***END-OF-SELECTION.

end-of-selection.

perform event_list.

perform get_field_catalog.

perform list_disp .

form list_disp .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = 'POPUP'

i_callback_user_command = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT = WA_LAYOUT

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrk

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.

endform. " LIST_DISP

&----


*& Form GET_FIELD_CATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_field_catalog .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = g_repid

i_internal_tabname = 'IT_VBRK'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " GET_FIELD_CATALOG

&----


*& Form event_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form event_list .

clear wa_event.

wa_event-name = 'USER_COMMAND'.

wa_event-form = 'USER_COMMAND'.

append wa_event to t_event.

clear wa_event.

endform. " event_list

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

read table it_vbrk index rs_selfield-tabindex.

perform get_data_vbrp.

perform build_fieldcatalog_vbrp .

perform display_alv_vbrp.

endcase.

endform.

&----


*& Form BUILD_FIELDCATALOG_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form build_fieldcatalog_vbrp .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = g_repid

i_internal_tabname = 'IT_VBRP'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " BUILD_FIELDCATALOG_VBRP

&----


*& Form DISPLAY_ALV_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_alv_vbrp .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrp

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.

endform. " DISPLAY_ALV_VBRP

Kishi.

Hi,

Hello,

check this sample program:

&----


report zkeerthi_alv5 .

&----


*& tables declaration

&----


tables: vbrk,vbrp.

&----


*& type-pools declaration

&----


type-pools: slis.

&----


*& data declaration

&----


data: g_repid type sy-repid.

data : it_fieldcat type slis_t_fieldcat_alv, "mara

wa_fieldcat type slis_fieldcat_alv,

wa_layout type slis_layout_alv,

wa_event type slis_alv_event,

t_event type slis_t_event.

data: v_vbeln like vbrk-vbeln,

v_matnr like vbrp-matnr.

data: begin of it_vbrk occurs 0,

vbeln like vbrk-vbeln,

waerk like vbrk-waerk,

vkorg like vbrk-vkorg,

fkdat like vbrk-fkdat,

bukrs like vbrk-bukrs,

netwr like vbrk-netwr,

end of it_vbrk.

data: begin of it_vbrp occurs 0,

vbeln like vbrp-vbeln,

posnr like vbrp-posnr,

fkimg like vbrp-fkimg,

vrkme like vbrp-vrkme,

netwr like vbrp-netwr,

matnr like vbrp-matnr,

arktx like vbrp-arktx,

end of it_vbrp.

&----


*& selection screen

&----


selection-screen begin of block b with frame title text-001.

select-options: s_vbeln for vbrk-vbeln,

s_fkdat for vbrk-fkdat,

s_matnr for vbrp-matnr.

selection-screen end of block b.

**INITIALIZATION.

initialization.

g_repid = sy-repid.

s_fkdat-low = sy-datum - 200.

s_fkdat-high = sy-datum.

append s_fkdat.

***AT SELECTION-SCREEN.

at selection-screen.

if not s_vbeln is initial.

select single vbeln from vbrk

into v_vbeln

where vbeln in s_vbeln.

if sy-subrc <> 0.

message e001(zz2).

endif.

endif.

if not s_matnr is initial.

select single matnr from mara

into v_matnr

where matnr in s_matnr.

if sy-subrc <> 0.

message e001(zz2).

endif.

endif.

***START-OF-SELECTION.

start-of-selection.

perform get_data_vbrk.

&----


*& Form GET_DATA_VBRK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_vbrk .

select vbeln

waerk

vkorg

fkdat

bukrs

netwr

into table it_vbrk

from vbrk

where vbeln in s_vbeln

and fkdat in s_fkdat.

endform. " GET_DATA_VBRK

&----


*& Form GET_DATA_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_vbrp .

select vbeln

posnr

fkimg

vrkme

netwr

matnr

arktx

from vbrp

into table it_vbrp

where vbeln = it_vbrk-vbeln.

endform. " GET_DATA_VBRP

***END-OF-SELECTION.

end-of-selection.

perform event_list.

perform get_field_catalog.

perform list_disp .

form list_disp .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = 'POPUP'

i_callback_user_command = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT = WA_LAYOUT

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrk

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.

endform. " LIST_DISP

&----


*& Form GET_FIELD_CATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_field_catalog .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = g_repid

i_internal_tabname = 'IT_VBRK'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " GET_FIELD_CATALOG

&----


*& Form event_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form event_list .

clear wa_event.

wa_event-name = 'USER_COMMAND'.

wa_event-form = 'USER_COMMAND'.

append wa_event to t_event.

clear wa_event.

endform. " event_list

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

read table it_vbrk index rs_selfield-tabindex.

perform get_data_vbrp.

perform build_fieldcatalog_vbrp .

perform display_alv_vbrp.

endcase.

endform.

&----


*& Form BUILD_FIELDCATALOG_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form build_fieldcatalog_vbrp .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = g_repid

i_internal_tabname = 'IT_VBRP'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " BUILD_FIELDCATALOG_VBRP

&----


*& Form DISPLAY_ALV_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_alv_vbrp .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrp

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.

endform. " DISPLAY_ALV_VBRP

Kishi.

5 REPLIES 5
Read only

Former Member
0 Likes
806

Hi,

Hello,

check this sample program:

&----


report zkeerthi_alv5 .

&----


*& tables declaration

&----


tables: vbrk,vbrp.

&----


*& type-pools declaration

&----


type-pools: slis.

&----


*& data declaration

&----


data: g_repid type sy-repid.

data : it_fieldcat type slis_t_fieldcat_alv, "mara

wa_fieldcat type slis_fieldcat_alv,

wa_layout type slis_layout_alv,

wa_event type slis_alv_event,

t_event type slis_t_event.

data: v_vbeln like vbrk-vbeln,

v_matnr like vbrp-matnr.

data: begin of it_vbrk occurs 0,

vbeln like vbrk-vbeln,

waerk like vbrk-waerk,

vkorg like vbrk-vkorg,

fkdat like vbrk-fkdat,

bukrs like vbrk-bukrs,

netwr like vbrk-netwr,

end of it_vbrk.

data: begin of it_vbrp occurs 0,

vbeln like vbrp-vbeln,

posnr like vbrp-posnr,

fkimg like vbrp-fkimg,

vrkme like vbrp-vrkme,

netwr like vbrp-netwr,

matnr like vbrp-matnr,

arktx like vbrp-arktx,

end of it_vbrp.

&----


*& selection screen

&----


selection-screen begin of block b with frame title text-001.

select-options: s_vbeln for vbrk-vbeln,

s_fkdat for vbrk-fkdat,

s_matnr for vbrp-matnr.

selection-screen end of block b.

**INITIALIZATION.

initialization.

g_repid = sy-repid.

s_fkdat-low = sy-datum - 200.

s_fkdat-high = sy-datum.

append s_fkdat.

***AT SELECTION-SCREEN.

at selection-screen.

if not s_vbeln is initial.

select single vbeln from vbrk

into v_vbeln

where vbeln in s_vbeln.

if sy-subrc <> 0.

message e001(zz2).

endif.

endif.

if not s_matnr is initial.

select single matnr from mara

into v_matnr

where matnr in s_matnr.

if sy-subrc <> 0.

message e001(zz2).

endif.

endif.

***START-OF-SELECTION.

start-of-selection.

perform get_data_vbrk.

&----


*& Form GET_DATA_VBRK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_vbrk .

select vbeln

waerk

vkorg

fkdat

bukrs

netwr

into table it_vbrk

from vbrk

where vbeln in s_vbeln

and fkdat in s_fkdat.

endform. " GET_DATA_VBRK

&----


*& Form GET_DATA_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_vbrp .

select vbeln

posnr

fkimg

vrkme

netwr

matnr

arktx

from vbrp

into table it_vbrp

where vbeln = it_vbrk-vbeln.

endform. " GET_DATA_VBRP

***END-OF-SELECTION.

end-of-selection.

perform event_list.

perform get_field_catalog.

perform list_disp .

form list_disp .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = 'POPUP'

i_callback_user_command = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT = WA_LAYOUT

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrk

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.

endform. " LIST_DISP

&----


*& Form GET_FIELD_CATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_field_catalog .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = g_repid

i_internal_tabname = 'IT_VBRK'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " GET_FIELD_CATALOG

&----


*& Form event_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form event_list .

clear wa_event.

wa_event-name = 'USER_COMMAND'.

wa_event-form = 'USER_COMMAND'.

append wa_event to t_event.

clear wa_event.

endform. " event_list

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

read table it_vbrk index rs_selfield-tabindex.

perform get_data_vbrp.

perform build_fieldcatalog_vbrp .

perform display_alv_vbrp.

endcase.

endform.

&----


*& Form BUILD_FIELDCATALOG_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form build_fieldcatalog_vbrp .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = g_repid

i_internal_tabname = 'IT_VBRP'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " BUILD_FIELDCATALOG_VBRP

&----


*& Form DISPLAY_ALV_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_alv_vbrp .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrp

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.

endform. " DISPLAY_ALV_VBRP

Kishi.

Read only

Former Member
0 Likes
805
Read only

Former Member
0 Likes
805

Hi,

Give ur mail id,

So that i can send some documents

regarding ALV.

<b>Regards,

Jackie..</b>

Read only

Former Member
0 Likes
805

hi,

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = 'POPUP'

i_callback_user_command = 'USER_COMMAND' [ for user command events ]

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT = WA_LAYOUT [layout header created by u]

it_fieldcat = it_fieldcat [fieldcatalog u have to create n giv it here]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT = [ for sorting purpose ]

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS = [for events in alv]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbrk [internal table]

if helpful reward some points.

with regards,

suresh babu aluri.

Read only

Former Member
0 Likes
805

Hi,

Check this URL.

<b>Reprots</b>

http://www.sapgenie.com/abap/reports.htm

http://www.allsaplinks.com/material.html

http://www.sapdevelopment.co.uk/reporting/reportinghome.htm

<b>ALV</b>

<b>1. Please give me general info on ALV.</b>

http://www.sapfans.com/forums/viewtopic.php?t=58286

http://www.sapfans.com/forums/viewtopic.php?t=76490

http://www.sapfans.com/forums/viewtopic.php?t=20591

http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.

<b>

2. How do I program double click in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=11601

http://www.sapfans.com/forums/viewtopic.php?t=23010

<b>3. How do I add subtotals (I have problem to add them)...</b>

http://www.sapfans.com/forums/viewtopic.php?t=20386

http://www.sapfans.com/forums/viewtopic.php?t=85191

http://www.sapfans.com/forums/viewtopic.php?t=88401

http://www.sapfans.com/forums/viewtopic.php?t=17335

<b>4. How to add list heading like top-of-page in ABAP lists?</b>

http://www.sapfans.com/forums/viewtopic.php?t=58775

http://www.sapfans.com/forums/viewtopic.php?t=60550

http://www.sapfans.com/forums/viewtopic.php?t=16629

<b>5. How to print page number / total number of pages X/XX in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)

<b>6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.</b>

http://www.sapfans.com/forums/viewtopic.php?t=64320

http://www.sapfans.com/forums/viewtopic.php?t=44477

<b>7. How can I set the cell color in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=52107

<b>

8. How do I print a logo/graphics in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=81149

http://www.sapfans.com/forums/viewtopic.php?t=35498

http://www.sapfans.com/forums/viewtopic.php?t=5013

<b>9. How do I create and use input-enabled fields in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=84933

http://www.sapfans.com/forums/viewtopic.php?t=69878

<b>10. How can I use ALV for reports that are going to be run in background?</b>

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

<b>11. How can I display an icon in ALV? (Common requirement is traffic light icon).</b>

http://www.sapfans.com/forums/viewtopic.php?t=79424

http://www.sapfans.com/forums/viewtopic.php?t=24512

<b>12. How can I display a checkbox in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=88376

http://www.sapfans.com/forums/viewtopic.php?t=40968

http://www.sapfans.com/forums/viewtopic.php?t=6919

<b>Check this for basic concepts of OOPS</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

<b>Tabstrip</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

<b>Editable ALV</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

<b>Tree</b>

http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm

<b>General Tutorial for OOPS</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20ea...

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

http://www.sap-img.com/abap/what-is-alv-programming.htm

http://www.sap-img.com/abap-function.htm

http://www.geocities.com/mpioud/Abap_programs.html

http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm

http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf

http://www.sap-img.com/abap-function.htm

Reward if it helps you.

Regards,

Jackie..