Code:
REPORT ZPM_X_TEMP .
data: gt_t132t type sorted table of t132t
with unique key mandt spras statm
with header line.
data: i type i,
c type c,
status type mara-pstat.
parameters: p_matnr type matnr.
start-of-selection.
select * into table gt_t132t from t132t where spras = sy-langu.
end-of-selection.
select single pstat into status from mara where matnr = p_matnr.
check sy-subrc = 0.
write: / 'Материал', p_matnr, 'расширен на ракурсы:'.
clear i.
do.
move status+i(1) to c.
if sy-subrc ne 0.
exit.
endif.
read table gt_t132t with key mandt = sy-mandt
spras = sy-langu
statm = c.
if sy-subrc = 0.
write: / gt_t132t-statm, gt_t132t-sttxt.
endif.
add 1 to i.
enddo.