删除请求号(网上转载)
第一步:
REPORT ZR_DELREQNO.
DATA :
ITAB_E070 LIKE E070 OCCURS 0 WITH HEADER LINE,
IWA_E070C LIKE E070C, "Request client
ITAB_E071 LIKE E071 OCCURS 0 WITH HEADER LINE ,
IWA_E07T LIKE E07T , "Requst short text(desc)
IWA_E070A LIKE E070A ,
ITAB_TLOCK LIKE TLOCK OCCURS 0 WITH HEADER LINE .
PARAMETER REQNO LIKE E070-TRKORR DEFAULT '' .
SELECT * INTO TABLE ITAB_E070 FROM E070
WHERE TRKORR EQ REQNO OR STRKORR EQ REQNO.
IF SY-SUBRC NE 0 .
WRITE : 'The Request No.:' , REQNO , ' not exist !' .
ENDIF.
SELECT SINGLE * INTO IWA_E070C FROM E070C
WHERE TRKORR EQ REQNO .
SELECT * INTO TABLE ITAB_E071 FROM E071
WHERE TRKORR EQ REQNO .
SELECT SINGLE * INTO IWA_E07T FROM E07T
WHERE TRKORR EQ REQNO .
SELECT SINGLE * INTO IWA_E070A FROM E070A
WHERE TRKORR EQ REQNO .
IF ITAB_E070 IS INITIAL .
SELECT * INTO TABLE ITAB_TLOCK FROM TLOCK
WHERE TRKORR EQ REQNO .
ELSE.
SELECT * INTO TABLE ITAB_TLOCK FROM TLOCK
FOR ALL ENTRIES IN ITAB_E070
WHERE TRKORR EQ ITAB_E070-TRKORR .
ENDIF.
IF SY-SUBRC NE 0 .
WRITE : / 'No Locked object for the request NO. was found!'.
ENDIF.
DELETE :
E070 FROM TABLE ITAB_E070 ,
E070C FROM IWA_E070C,
E071 FROM TABLE ITAB_E071,
E07T FROM IWA_E07T ,
E070A FROM IWA_E070A ,
TLOCK FROM TABLE ITAB_TLOCK .
WRITE : / 'The Request No.:' , REQNO .
第二步:删除请求号后,必须删除TLOCK表中的相应的请号,不然还是编辑不了