ZXRMPU08

<< Click to Display Table of Contents >>

Navigation:  All About ABAP Technique > Indonesia > ABAP Tutorial > ABAP Workbench Tools  > Enhancement > Customer Exits > Contoh Customer Exits > Project ZPPWS002 > Funtions Exits > EXIT_SAPLRMPU_008 >

ZXRMPU08

*&---------------------------------------------------------------------*
*&  Include           ZXRMPU08                                         *
*&---------------------------------------------------------------------*
 
DATA: requirement_tquant TYPE RMPU_TQUANT.
DATA: requirement_details TYPE RMPU_FREQ.
DATA: vmeng TYPE resb-vmeng.
 
DATA: lv_plnum_r type resb-PLNUM.
DATA: lv_plnum_p type plaf-PLNUM.
clear: lv_plnum_r, lv_plnum_p.
 
 
*-> To check authorization based on storage location
*DATA: lv_act(2) type c value '01',
*      lv_mvt(3) type c value '261'.
 
*-> get details
*-> (exceptions may not occur if i_req_handle is forwarded correctly)
CALL FUNCTION 'RMPU_GET_REQUIREMENT_DETAILS'
    EXPORTING
         i_req_handle       = i_req_handle
    IMPORTING
*->         E_LIT              =
         E_TQUANT           = requirement_tquant
*->         E_VMENG            =
         E_FREQ             = requirement_details
*->    EXCEPTIONS
*->         INVALID_REQ_HANDLE = 1 "<<< this may not happen
*->         OTHERS             = 2
         .
 
*->dependent requirement from planned order, get planned order component
*->already checked availability
IF requirement_details-BDART = 'SB'.
  select plnum into lv_plnum_r from resb where
                    rsnum = requirement_details-rsnum and
                    rspos = requirement_details-rspos.
  endselect.
 
  IF lv_plnum_r <> ''.
    select plnum into lv_plnum_p from plaf where
                  plnum = lv_plnum_r and
                  MDPBV ne space.
*->                   STLFX = 'X'.
    endselect.
*->planned order with no availability check excluded
    IF lv_plnum_p = ''.
      CLEAR c_quantity.
 
    ENDIF.
 
  ENDIF.
 
ENDIF.
 
*-> To check authorization based on storage location
* Added by Bintang 03-102006
DATA: lv_act(2) type c value '01',
     lv_mvt(3) type c value '261'.
 
 
IF requirement_details-werks <> '' AND
  requirement_details-lgort <> ''.
 
  AUTHORITY-CHECK OBJECT 'M_MSEG_LGO'
          ID 'ACTVT' FIELD lv_act
          ID 'WERKS' FIELD requirement_details-werks
          ID 'LGORT' FIELD requirement_details-lgort
          ID 'BWART' FIELD lv_mvt.
  IF sy-subrc is not INITIAL.
    MESSAGE e398(00) WITH 'Anda tidak memiliki akses ke Storage Location' requirement_details-lgort.
  ENDIF.
ENDIF.
*--------------------------------------------------------------------*