|
<< Click to Display Table of Contents >> Navigation: All About ABAP Technique > English > ABAP Tutorial > ABAP Workbench Tools > Enhancement > Customer Exits > Customer Exits Examples > Project ZPPWS003 > Funtions Exits > EXIT_SAPLCOZV_001 > ZXCO1U06 |
*&---------------------------------------------------------------------*
*& Include ZXCO1U06 *
*&---------------------------------------------------------------------*
* check std cost estimate for material
TABLES: mbew.
DATA lv_caufv LIKE caufv.
DATA lv_mara LIKE mara.
RANGES: lr_mtart FOR lv_mara-mtart.
lv_mara-matnr = header_imp-plnbez.
SELECT SINGLE mtart INTO lv_mara-mtart
FROM mara
WHERE matnr = lv_mara-matnr.
IF lv_mara-mtart IN lr_mtart.
SELECT SINGLE *
FROM mbew
WHERE matnr EQ lv_mara-matnr AND
bwkey EQ header_imp-werks AND
bwtar EQ ' '.
IF sy-subrc IS INITIAL AND
mbew-pprdl IS INITIAL AND mbew-pdatl IS INITIAL AND
mbew-pprdz IS INITIAL AND mbew-pdatz IS INITIAL AND
mbew-vprsv = 'S' AND mbew-ekalr = 'X'.
MESSAGE e398(00) WITH
'No valid current std cost estimate exists for '
lv_mara-matnr.
ENDIF.
ENDIF.
**Check authorization during prod order create
**Production scheduler as check object
data: s_message_text(20) type c.
DATA : begin of zmbew occurs 0.
include structure mbew.
DATA : end of zmbew.
concatenate HEADER_IMP-werks 'Scheduler' into s_message_text separated
by space.
concatenate s_message_text HEADER_IMP-fevor into s_message_text
separated by space.
AUTHORITY-CHECK OBJECT 'Z_AFKO_FEV'
ID 'ACTVT' FIELD '01'
ID 'ZFEVOR' FIELD HEADER_IMP-FEVOR
ID 'WERKS' FIELD HEADER_IMP-werks.
if not sy-subrc is initial.
message e004(CO) with s_message_text.
endif.