Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9238

Re: ALV With No of Outputs

$
0
0

Hi,

 

What is the transaction table that you are refering for order actual.

Anyway just try this and change as your requirements...

 

TYPE-POOLS: slis.

 

DATA: it_fieldcat  TYPE  slis_t_fieldcat_alv,

       is_layout TYPE slis_layout_alv,

       it_sort TYPE  slis_t_sortinfo_alv,

       wa_event TYPE slis_alv_event,

       it_events TYPE  slis_t_event .

 

DATA: wa_fcat LIKE LINE OF it_fieldcat,

       wa_sort LIKE LINE OF it_sort.

 

DATA: BEGIN OF i_s001 OCCURS 0,

     kunnr LIKE s001-kunnr,

     matnr LIKE s001-matnr,

     aenetwr LIKE s001-aenetwr,

   END OF i_s001.

 

SELECT kunnr  matnr  aenetwr

   FROM s001

   INTO TABLE i_s001  UP TO 25 ROWS .

 

DEFINE add_fcat.

   wa_fcat-fieldname = &1.

   wa_fcat-seltext_m = &2.

   wa_fcat-do_sum    = &3.

   wa_fcat-ref_fieldname = &4.

   wa_fcat-ref_tabname = &5.

   APPEND wa_fcat TO it_fieldcat.

   CLEAR wa_fcat.

END-OF-DEFINITION.

 

add_fcat : 'KUNNR' 'Customer' '' 'KUNNR' 'S001',

                'MATNR' 'Material' '' 'MATNR' 'S001',

                'AENETWR' 'Net Amount' 'X' 'AENETWR' 'S001'.

 

CLEAR wa_sort.

wa_sort-fieldname = 'KUNNR'.

wa_sort-subtot    = 'X'.

APPEND wa_sort TO it_sort.

 

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

   EXPORTING

     i_callback_program = sy-repid.

 

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

   EXPORTING

     is_layout                 = is_layout

     it_fieldcat                = it_fieldcat

     it_sort                     = it_sort

     i_tabname               = 'I_S001'

     it_events                 = it_events

   TABLES

     t_outtab                  = i_s001

   EXCEPTIONS

     program_error              = 1

     maximum_of_appends_reached = 2.

 

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.


Viewing all articles
Browse latest Browse all 9238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>