*&---------------------------------------------------------------------*
*& 包括 ZXMBCU08
*&---------------------------------------------------------------------*
DATA :
* c TYPE p,
* errstr(40) TYPE c,
*gs_resb_new LIKE resb,
*gs_mara LIKE mara,
gs_rkpf LIKE rkpf.
*CALL FUNCTION 'DAY_IN_WEEK'
* EXPORTING
* datum = sy-datum
* IMPORTING
* wotnr = c.
CLEAR gs_rkpf.
IF ti_rkpf IS NOT INITIAL and sy-tcode eq 'MB21'.
READ TABLE ti_rkpf INTO gs_rkpf.
gs_rkpf-dabrz = sy-datum.
COMMIT WORK AND WAIT.
UPDATE rkpf FROM gs_rkpf.
IF sy-subrc EQ 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.
ENDIF.
*
*
*IF sy-datum+6(2) > 24 AND sy-datum+6(2) < 28.
*ELSE.
* LOOP AT ti_resb_new INTO gs_resb_new.
* SELECT SINGLE * FROM mara INTO gs_mara WHERE matnr = gs_resb_new-matnr.
* IF gs_mara-fashgrd EQ 'X'.
* IF sy-tcode EQ 'MB21'.
* DELETE resb FROM gs_resb_new.
* ELSEIF sy-tcode EQ 'MB22'.
* IF ti_resb_old IS NOT INITIAL.
* READ TABLE ti_resb_old INTO gs_resb_new WITH KEY rspos = gs_resb_new-rspos.
* MODIFY resb FROM gs_resb_new.
* ENDIF.
* ENDIF.
* CONCATENATE gs_resb_new-matnr ' 今天你不能下预留或者修改预留' INTO errstr.
* MESSAGE errstr TYPE 'E'.
* ENDIF.
* CLEAR:errstr,gs_mara,gs_resb_new.
* ENDLOOP.
*
*
*
*
* AUTHORITY-CHECK OBJECT 'ZMMOBJ005' ID 'ZMMID001' FIELD 'OK'.
* IF sy-subrc EQ 0.
* IF c NE 2.
* IF sy-tcode EQ 'MB21'.
* DELETE resb FROM ti_resb_new.
* ELSEIF sy-tcode EQ 'MB22'.
* IF ti_resb_old IS NOT INITIAL.
* MODIFY resb FROM ti_resb_old.
* ENDIF.
* ENDIF.
* MESSAGE '今天你不能下预留或者修改预留' TYPE 'E'.
* ENDIF.
* ENDIF.
*
* AUTHORITY-CHECK OBJECT 'ZMMOBJ005' ID 'ZMMID002' FIELD 'OK'.
* IF sy-subrc EQ 0.
* IF c NE 2.
* IF c NE 4.
* IF sy-tcode EQ 'MB21'.
* DELETE resb FROM ti_resb_new.
* ELSEIF sy-tcode EQ 'MB22'.
* IF ti_resb_old IS NOT INITIAL.
* MODIFY resb FROM ti_resb_old.
* ENDIF.
* ENDIF.
* MESSAGE '今天你不能下预留或者修改预留' TYPE 'E'.
*
* ENDIF.
* ENDIF.
* ENDIF.
*ENDIF.
*& 包括 ZXMBCU08
*&---------------------------------------------------------------------*
DATA :
* c TYPE p,
* errstr(40) TYPE c,
*gs_resb_new LIKE resb,
*gs_mara LIKE mara,
gs_rkpf LIKE rkpf.
*CALL FUNCTION 'DAY_IN_WEEK'
* EXPORTING
* datum = sy-datum
* IMPORTING
* wotnr = c.
CLEAR gs_rkpf.
IF ti_rkpf IS NOT INITIAL and sy-tcode eq 'MB21'.
READ TABLE ti_rkpf INTO gs_rkpf.
gs_rkpf-dabrz = sy-datum.
COMMIT WORK AND WAIT.
UPDATE rkpf FROM gs_rkpf.
IF sy-subrc EQ 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.
ENDIF.
*
*
*IF sy-datum+6(2) > 24 AND sy-datum+6(2) < 28.
*ELSE.
* LOOP AT ti_resb_new INTO gs_resb_new.
* SELECT SINGLE * FROM mara INTO gs_mara WHERE matnr = gs_resb_new-matnr.
* IF gs_mara-fashgrd EQ 'X'.
* IF sy-tcode EQ 'MB21'.
* DELETE resb FROM gs_resb_new.
* ELSEIF sy-tcode EQ 'MB22'.
* IF ti_resb_old IS NOT INITIAL.
* READ TABLE ti_resb_old INTO gs_resb_new WITH KEY rspos = gs_resb_new-rspos.
* MODIFY resb FROM gs_resb_new.
* ENDIF.
* ENDIF.
* CONCATENATE gs_resb_new-matnr ' 今天你不能下预留或者修改预留' INTO errstr.
* MESSAGE errstr TYPE 'E'.
* ENDIF.
* CLEAR:errstr,gs_mara,gs_resb_new.
* ENDLOOP.
*
*
*
*
* AUTHORITY-CHECK OBJECT 'ZMMOBJ005' ID 'ZMMID001' FIELD 'OK'.
* IF sy-subrc EQ 0.
* IF c NE 2.
* IF sy-tcode EQ 'MB21'.
* DELETE resb FROM ti_resb_new.
* ELSEIF sy-tcode EQ 'MB22'.
* IF ti_resb_old IS NOT INITIAL.
* MODIFY resb FROM ti_resb_old.
* ENDIF.
* ENDIF.
* MESSAGE '今天你不能下预留或者修改预留' TYPE 'E'.
* ENDIF.
* ENDIF.
*
* AUTHORITY-CHECK OBJECT 'ZMMOBJ005' ID 'ZMMID002' FIELD 'OK'.
* IF sy-subrc EQ 0.
* IF c NE 2.
* IF c NE 4.
* IF sy-tcode EQ 'MB21'.
* DELETE resb FROM ti_resb_new.
* ELSEIF sy-tcode EQ 'MB22'.
* IF ti_resb_old IS NOT INITIAL.
* MODIFY resb FROM ti_resb_old.
* ENDIF.
* ENDIF.
* MESSAGE '今天你不能下预留或者修改预留' TYPE 'E'.
*
* ENDIF.
* ENDIF.
* ENDIF.
*ENDIF.