cancel
Showing results for 
Search instead for 
Did you mean: 

classical report to ALV Report

Former Member
0 Kudos

I have developed simple report, i want to convert this into webdynpro alv, could you throw some ideas, how to develop in webdynpro alv

Below is my code and screen shot of my report

Thanks

Vijaya

TYPES : BEGIN OF ty_str,

         remit TYPE char11,

         sno(2) TYPE n,

         ddo TYPE char50,

         voucher_no(4) TYPE n,

         voucher_date TYPE sy-datum,

         amount TYPE wrbtr,

         END OF ty_str.

DATA : it TYPE TABLE OF ty_str,

        wa TYPE ty_str.

DATA lv_count TYPE i.

CLEAR wa.

wa-remit = '8782-103-03'.

wa-sno = '01'.

wa-ddo = 'AAA'.

wa-voucher_no = '0001'.

wa-voucher_date = '20140630'.

wa-amount = '379557'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8782-103-03'.

wa-sno = '02'.

wa-ddo = 'BBB'.

wa-voucher_no = '0002'.

wa-voucher_date = '20140630'.

wa-amount = '8209'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '01'.

wa-ddo = 'ABC'.

wa-voucher_no = '0001'.

wa-voucher_date = '20140612'.

wa-amount = '198315'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '02'.

wa-ddo = 'BBC'.

wa-voucher_no = '0001'.

wa-voucher_date = '20140612'.

wa-amount = '105922'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '03'.

wa-ddo = 'CCC'.

wa-voucher_no = '0007'.

wa-voucher_date = '20140612'.

wa-amount = '2042278'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '04'.

wa-ddo = 'DDD'.

wa-voucher_no = '0008'.

wa-voucher_date = '20140612'.

wa-amount = '418735'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '05'.

wa-ddo = 'EEE'.

wa-voucher_no = '0012'.

wa-voucher_date = '20140612'.

wa-amount = '1020066'.

APPEND wa TO it.

CLEAR wa.

wa-remit = '8443-800-03'.

wa-sno = '05'.

wa-ddo = 'FFF'.

wa-voucher_no = '0012'.

wa-voucher_date = '20140612'.

wa-amount = '1020066'.

APPEND wa TO it.

SORT it BY remit DESCENDING.

LOOP AT it INTO wa.

   lv_count = lv_count + 1.

   AT NEW remit.

     WRITE :/ 'Remittance', wa-remit.

   ENDAT.

   WRITE : / wa-sno, wa-ddo, wa-voucher_no, wa-voucher_date, wa-amount.

   AT END OF remit.

     SUM.

     WRITE: / 'No of rows', lv_count.

     WRITE : /65  'Total', wa-amount.

     CLEAR lv_count.

   ENDAT.

ENDLOOP.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Vijaya,

You may not get the same way as you did it in abap but

I suggest you to use the TABLE ui element, just populate the data into context node and set the properties of table as below

     design: Transparent

     gridMode: None

     rowSelectable: False ( uncheck the check box )

Adjust other properties as required.

Hope this helps you.

Regards,

Rama

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vijaya,

There are two ways in which you can display report.

1) Using TABLE UI element  or

2) ALV Table by resuing  SALV_WD_TABLE component.

For ALV table,refer the below links

http://www.saptechnical.com/Tutorials/WebDynproABAP/ALV/page1.htm

ALV for ABAP Web dynpro

For normal table,refer below links

Using table UI element in webdynpro ABAP - Working with UI elements in webdynpro ABAP | SAPNuts

http://webdynproabap.wordpress.com/2012/07/01/table-ui-element/

Hope this will help you to build report in ALV/Normal Table.

Thanks

KH

harsha_jalakam
Active Contributor
0 Kudos

Hi,

For subtotals, there is no need to write the logic for calculating the totals in webdynpro alv , instead aggregate rule can be created as follows,

lr_column_settings ?= wd_this->lr_config.

  lt_column = lr_column_settings->get_columns( ).

loop at lt_column into ls_column.

    case ls_column-id.

      when '<col_name>'.

* aggregate field

        call method lr_config->if_salv_wd_field_settings~get_field

          exporting

            fieldname = '<col_name>'

          receiving

            value     = lr_field_amnt.

* create aggregate rule as total

        call method lr_field_amnt->if_salv_wd_aggr~create_aggr_rule

          exporting

            aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total

          receiving

            value            = lv_aggr_rule.

    endcase.

endloop.

endmethod.

Totals And Subtotals in ALV Webdynpros - Code Gallery - SCN Wiki

Regards,

Harsha

former_member204264
Participant
0 Kudos

Hi Vijaya,

I recommend you this wiki doc. It explains step by step how to Create an ALV in Web Dynpro:

Creating an ALV List in Web Dynpro Application - Web Dynpro ABAP - SCN Wiki

Regards.

Luis.