Call a New Standard Table Display (SE16N) from Report

By | October 22, 2008 | Table Maintenance | 8,101 | 0

Shows another way to call the new Standard Table Display (SE16N), more efficient than calling SE16

As we have seen in the previous post, how easy it is to call the Standard Table Display from a report program. Today, we will see the more powerful and more efficient way to call the Table Display from the Report.

We will call the function module SE16N_INTERFACE to call the new standard table display.

Code Snippet to call SE16N from Report

*&---------------------------------------------------------------------*
*& Describes a way to call the SE16n with the Selection from report.
*&
*&---------------------------------------------------------------------*
*
REPORT  ztest_tmp.
*
START-OF-SELECTION.
*
* data declaration for the FM
  DATAl_tab      TYPE se16n_tab,
        t_sel      TYPE se16n_or_t,
        la_sel     LIKE LINE OF t_sel,
        t_sel_tab  TYPE se16n_or_seltab_t,
        la_sel_tab LIKE LINE OF t_sel_tab.
*
* Table name
  l_tab 'VBAK'.
*
* Selection for VBELN
  la_sel_tab-field   'VBELN'.
  la_sel_tab-sign    'I'.
  la_sel_tab-option  'BT'.
  la_sel_tab-low     '0000001000'.
  la_sel_tab-high    '0000002000 '.
  APPEND la_sel_tab TO t_sel_tab.
*
* Selection for ERDAT
  la_sel_tab-field   'ERDAT'.
  la_sel_tab-sign    'I'.
  la_sel_tab-option  'BT'.
  la_sel_tab-low     '20081001'.
  la_sel_tab-high    sy-datum.
  APPEND la_sel_tab TO t_sel_tab.
*
* Fill the main selection table
  la_sel-pos 1.
  la_sel-seltab t_sel_tab.
  APPEND la_sel TO t_sel.
*
* Function module for the SE16N
  CALL FUNCTION 'SE16N_INTERFACE'
    EXPORTING
      i_tab                  l_tab
      i_clnt_dep             'X'
    TABLES
*     IT_OUTPUT_FIELDS       =
      it_or_selfields        t_sel
    EXCEPTIONS
      no_values              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.

The output would be like:

As we can from the code, here we have passed the Actual Field name instead of the parameter name of the report program. This makes it more powerful and more efficient compare to standard table display using SE16.

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{274 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 274 articles.

Load comments

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.