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

SAP List Viewer format with diferent functionality

Former Member
0 Likes
888

I want to develop a report in SAP List Viewer format with all functionality (Filter, Sort, Summarization, Export, Save Select and Display variants, etc). How can I add the functionalities ?How can I do this?

7 REPLIES 7
Read only

Former Member
Read only

GauthamV
Active Contributor
0 Likes
865

hi,

check this example programs for list viewer format.

BALVSD01

BCALV_TEST_FULLSCREEN_FILTCURR

BCALV_TEST_FULLSCREEN_FILTER

BCALV_TEST_FULLSCREEN_FILTQUAN

BCALV_TEST_LIST_LAYOUT

BCALV_TEST_LIST_EVENTS.

Read only

Former Member
0 Likes
865

Shweta,

these all kind of functionality are already available in ALV.

try to use this program:

report zamit_0001.


type-pools: slis.

data : w_fcat1 type slis_fieldcat_alv,
       w_fcat2 type slis_fieldcat_alv,
       w_fcat3 type slis_fieldcat_alv,
       w_events type slis_alv_event,
       flayout type slis_layout_alv.


data : t_fcat1 type slis_t_fieldcat_alv,
       t_fcat2 type slis_t_fieldcat_alv,
       t_fcat3 type slis_t_fieldcat_alv,
       t_kna1 type kna1 occurs 1,
       t_vbak type vbak occurs 1,
       t_vbap type vbap occurs 1,

       t_events1 type slis_t_event,
       t_events2 type slis_t_event,
       t_events3 type slis_t_event.

w_events-name ='TOP_OF_PAGE'.
w_events-form ='TOP1'.
append w_events to t_events1.

w_events-name ='TOP_OF_PAGE'.
w_events-form = 'TOP2'.
append w_events to t_events2.

w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP3'.
append w_events to t_events3.
TABLES:kna1.



select * from kna1 into table t_kna1 up to 5 rows.
select * from vbak into table t_vbak up to 5 rows.
select * from vbap into table t_vbap up to 5 rows.

*perform top1.
*perform top2.
*perform top3.


perform get_data.

data: repid type sy-repid.

repid = sy-repid.

call function 'REUSE_ALV_BLOCK_LIST_INIT'
  exporting
    i_callback_program             = repid
*          I_CALLBACK_PF_STATUS_SET       = ' '
*          I_CALLBACK_USER_COMMAND        = ' '
*          IT_EXCLUDING                   =
          .


call function 'REUSE_ALV_BLOCK_LIST_APPEND'
  exporting
    is_layout                        = flayout
    it_fieldcat                      = t_fcat1
    i_tabname                        = 't_kna1'
    it_events                        = t_events1
*       IT_SORT                          =
*       I_TEXT                           = ' '
  tables
    t_outtab                         = t_kna1
*     EXCEPTIONS
*       PROGRAM_ERROR                    = 1
*       MAXIMUM_OF_APPENDS_REACHED       = 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.

call function 'REUSE_ALV_BLOCK_LIST_APPEND'
  exporting
    is_layout                        = flayout
    it_fieldcat                      = t_fcat2
    i_tabname                        = 't_vbak'
    it_events                        = t_events2
*       IT_SORT                          =
*       I_TEXT                           = ' '
  tables
    t_outtab                         = t_vbak
*     EXCEPTIONS
*       PROGRAM_ERROR                    = 1
*       MAXIMUM_OF_APPENDS_REACHED       = 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.

call function 'REUSE_ALV_BLOCK_LIST_APPEND'
  exporting
    is_layout                        = flayout
    it_fieldcat                      = t_fcat3
    i_tabname                        = 't_vbap'
    it_events                        = t_events3
*       IT_SORT                          =
*       I_TEXT                           = ' '
  tables
    t_outtab                         = t_vbap.
*     EXCEPTIONS
*       PROGRAM_ERROR                    = 1
*       MAXIMUM_OF_APPENDS_REACHED       = 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.

call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
*exporting
*          I_INTERFACE_CHECK             = ' '
*          IS_PRINT                      =
*          I_SCREEN_START_COLUMN         = 0
*          I_SCREEN_START_LINE           = 0
*          I_SCREEN_END_COLUMN           = 0
*          I_SCREEN_END_LINE             = 0
*        IMPORTING
*          E_EXIT_CAUSED_BY_CALLER       =
*          ES_EXIT_CAUSED_BY_USER        =
*        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.

*&--------------------------------------------------------------------*
*&      Form  top1
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
form top1.
  write: / 'customer information list'.
endform.                                                    "top1

*&--------------------------------------------------------------------*
*&      Form  top2
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
form top2.
  write:/ 'sales order information list'.
endform.                                                    "top2


*&--------------------------------------------------------------------*
*&      Form  top3
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
form top3.
  write:/ 'sales item list'.
endform.                                                    "top3

*&--------------------------------------------------------------------*
*&      Form  get_data
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
form get_data.

  w_fcat1-col_pos = 1.
  w_fcat1-fieldname = 'KUNNR'.
  w_fcat1-seltext_m = 'customer number'.
  w_fcat1-tabname = 'T_KNA1'.
  append w_fcat1 to t_fcat1.

  w_fcat1-col_pos = 2.
  w_fcat1-fieldname = 'NAME1'.
  w_fcat1-seltext_m = 'customer name'.
  w_fcat1-tabname = 'T_KNA1'.
  append w_fcat1 to t_fcat1.

  w_fcat1-col_pos = 3.
  w_fcat1-fieldname = 'LAND1'.
  w_fcat1-seltext_m = 'country'.
  w_fcat1-tabname = 'T_KNA1'.
  append w_fcat1 to t_fcat1.




  w_fcat2-col_pos = 1.
  w_fcat2-fieldname = 'VBELN'.
  w_fcat2-seltext_m = 'order number'.
  w_fcat2-tabname = 'T_VBAK'.
  append w_fcat2 to t_fcat2.

  w_fcat2-col_pos = 2.
  w_fcat2-fieldname = 'ERDAT'.
  w_fcat2-seltext_m = 'order date'.
  w_fcat2-tabname = 'T_VBAK'..
  append w_fcat2 to t_fcat2.

  w_fcat2-col_pos = 3.
  w_fcat2-fieldname = 'NETWR'.
  w_fcat2-seltext_m = 'order value'.
  w_fcat2-tabname = 'T_VBAK'.
  append w_fcat2 to t_fcat2.





  w_fcat3-col_pos = 1.
  w_fcat3-fieldname = 'POSNR'.
  w_fcat3-seltext_m = 'order item '.
  w_fcat3-tabname = 'T_VBAP'..
  append w_fcat3 to t_fcat3.

  w_fcat3-col_pos = 2.
  w_fcat3-fieldname = 'ARKTX'.
  w_fcat3-seltext_m = 'item description'.
  w_fcat3-tabname = 'T_VBAP'..
  append w_fcat3 to t_fcat3.

  w_fcat3-col_pos = 3.
  w_fcat3-fieldname = 'WERKS'.
  w_fcat3-seltext_m = 'plant'.
  w_fcat3-tabname = 'T_VBAP'..
  append w_fcat3 to t_fcat3.

endform.

Read only

uwe_schieferstein
Active Contributor
0 Likes
865

Hello Sharma

You get all these functions for free (that's the reason why to use ALV instead of stone age WRITE lists).

If you are not yet ready to use OO-based ALV (CL_GUI_ALV_GRID, CL_SALV_TABLE) I recommend to use fm REUSE_ALV_GRID_DISPLAY_LVC for simple (non-hierarchical) lists.

Very useful documentation: [An Easy Reference For ALV Grid Control|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907]

Regards

Uwe

Read only

Former Member
0 Likes
865

Hi Shweta.

I would like to suggest a few references,

[SDN - Standard Reference - SAP list viewer in WEBDynpro - Editing ALV|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]

[SDN - Standard Reference - SAP list viewer in WEBDynpro - Simple example for using ALV|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d]

[SDN - Standard Reference - SAP list viewer in WEBDynpro - Using Events with ALV tables|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]

[SAP HELP - Standard Reference for SAP List Viewer (ALV): Classic - All Functionalities|http://help.sap.com/saphelp_nw04/helpdata/en/66/bc7aab43c211d182b30000e829fbfe/content.htm]

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Read only

Former Member
0 Likes
865

Hi,

All these functionalities are possible using ALV, please refer the link below:

http://www.sapdev.co.uk/reporting/alv/alvgrid.htm

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
865

Hi Shweta,

[http://www.sap-img.com/abap/an-interactive-alv-report.htm]

[http://www.sapdevelopment.co.uk/reporting/alv/alvlist_code.htm]

Regards,

Sravanthi