效果:
code;
REPORT zlm_view_002
.
START-OF-SELECTION .
*
* data declaration for the FM
DATA
: l_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
=
'0000000001'
.
la_sel_tab
-high
=
'0000000010 '
.
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
=
'20130809'
.
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
.
START-OF-SELECTION .
*
*
*
*
*
*
*
*
*
*
*
*
*