Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I read and print a generic internal table?

I'm pretty new to this. I'm currently studying abap for my job and I have a problem that I can't seem to work out. How would I go about creating a Function Module that takes any kind of internal table and write it to the screen? I'm looking for a very generic solution that can work with any kind of internal table as input.

like image 470
tis.sandor Avatar asked Jan 24 '26 04:01

tis.sandor


1 Answers

This is the exact reason SAP has developed ALV (ABAP List Viewer). One of the shortest way to display any (non-nested) table is the following.

  DATA: go_alv  TYPE REF TO cl_salv_table.

  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = go_alv
    CHANGING
      t_table      = itab.

  go_alv->display( ).
like image 77
Guillaume Avatar answered Jan 27 '26 01:01

Guillaume



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!