Hi,
The code works fine when select-options is used. But when I use parameters instead (changing in to eq) I am not getting any ouptput. Can you please tell me what I am doing wrong?
Regards,
bindazme
-
report zdel8.
type-pools : slis.
types : begin of ty_data,
art type qpart,
matnr type matnr ,
werks type werks_d,
aktiv type qmataktiv,
end of ty_data.
data : wa_matnr type matnr,
w_werks type werks_d,
w_aktiv type qmat-art,
t_data type standard table of ty_data,
t_field type slis_t_fieldcat_alv,
w_field type slis_fieldcat_alv.
selection-screen : begin of block blk1 with frame title text-001.
*select-options : s_matnr for wa_matnr,
s_werks for w_werks,
s_aktiv for w_aktiv.
parameter : s_matnr LIKE qmat-matnr.
parameter : s_werks LIKE qmat-werks.
parameters: s_aktiv like qmat-art.
selection-screen : end of block blk1.
selection-screen : begin of block blk2 with frame title text-002,
begin of line,
pushbutton 2(10) but1 user-command clk1.
selection-screen : end of line,
end of block blk2.
at selection-screen output.
but1 = 'Display'.
&----
Start of seleection
&----
at selection-screen.
clear : t_data.
select art
matnr
werks
aktiv
from qmat
into table t_data
where art eq s_aktiv
and matnr eq s_matnr
and werks eq s_werks.
if sy-ucomm = 'CLK1'.
clear t_field[].
w_field-col_pos = 1.
w_field-fieldname = 'ART'.
w_field-seltext_l = 'Inspection Type'.
append w_field to t_field.
*
w_field-col_pos = 2.
w_field-fieldname = 'MATNR'.
w_field-seltext_l = 'Material Number'.
*
append w_field to t_field.
*
w_field-col_pos = 3.
w_field-fieldname = 'WERKS'.
w_field-seltext_l = 'Plant'.
append w_field to t_field.
w_field-col_pos = 4.
w_field-fieldname = 'AKTIV'.
w_field-seltext_l = 'TYPE'.
*
append w_field to t_field.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = t_field
TABLES
t_outtab = t_data
EXCEPTIONS
PROGRAM_ERROR = 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.
clear : t_data.
endif.