*&---------------------------------------------------------------------*
*& Report ZLMN_USER_STATUS_CHANGE
*&
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZLMN_USER_STATUS_CHANGE.
data : gt_out type aufk occurs 0 with header line,
lv_gunfarki type d.
data : es_header like bapi_alm_order_header_e,
sys_status(40) type c,
USR_STATUS like BAPI_STATUS.
data: bret like table of bapiret2,
bretrec like bapiret2,
ordnum like aufk-aufnr .
USR_STATUS-INTERN = 'ACIK'.
USR_STATUS-EXTERN = 'GECK'.
USR_STATUS-LANGU = 'TR'.
lv_gunfarki = sy-datum - 7.
select * from aufk
into corresponding fields of table gt_out
where auart = 'ZPMP' and erdat ge lv_gunfarki.
loop at gt_out.
call function 'BAPI_ALM_ORDER_GET_DETAIL'
exporting
number = gt_out-aufnr
IMPORTING
es_header = es_header
tables
return = bret.
sys_status = es_header-sys_status.
if sy-subrc eq 0.
if sys_status CN 'KTYT' or sys_status CN 'TYT '.
CALL FUNCTION 'BAPI_ISUSMORDER_USERSTATUSSET'
EXPORTING
NUMBER = gt_out-AUFNR
STATUS = USR_STATUS.
* IMPORTING
* RETURN = WA_RETURN.
ENDIF.
ENDIF.
endloop.
***********************************************************
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com
SAP ve ABAP konusunda tüm sorun ve sorularınızı gönderebilirsiniz.
Social Plugin