ABAP

ABAP

Monday, April 11, 2011

Authorization

*** Kayıt Silmeli Auth ***

LOOP AT gt_filedata.

(lv_tabix = sy-tabix.)
authority-check object 'YRGNPM01'
                         id 'ACTVT' field '01'
                         id 'WERKS' field gt_filedata-werks.

if sy-subrc ne 0
delete gt_filedata (index lv_tabix).
lv_check = 'X'.
continue.
endif.



  if lv_check is not initial.
    message text-005 type 'I'.
  endif.


**** Kontrol ve mesaj parametre


  form f_authority_check .

      AUTHORITY-CHECK OBJECT 'YRGNMM10'
       ID 'CEERKRS' FIELD p_erkrs
       ID 'ACTVT' field '03'.

      IF sy-subrc <> 0.
        MESSAGE e001(yuauth) WITH p_erkrs.

      ENDIF.

endform.


*** Çoklu (Select-options) da Authorization 2

 1- data: lr_vkorg like table of sdsls_vkorg_range.
  call function 'YUSD_AUTHORITY_CHECK'
    exporting
      r_vkorg   = s_vkorg[]
      chk_vkorg = 'X'
    tables
      er_vkorg  = lr_vkorg.

  if lr_vkorg[] is initial.
    message e130(yusd) with s_vkorg-low s_vkorg-high.
  endif.
  clear : s_vkorg[], s_vkorg.
  s_vkorg[] = lr_vkorg[].



2-form f_authority_check_bukrs .
data : begin of lt_t001 occurs 0,
         bukrs like t001-bukrs,
         end of lt_t001.

  clear : lt_t001, lt_t001[].

  select bukrs into table lt_t001
               from t001
               where bukrs in s_bukrs.
  clear : s_bukrs, s_bukrs[].
  loop at lt_t001.
    authority-check object 'YRGNCO01'
              id 'BUKRS' field lt_t001-bukrs
              id 'ACTVT' field '03'.
    if sy-subrc eq 0.
      s_bukrs-sign    = 'I'  .
      s_bukrs-option  = 'EQ' .
      s_bukrs-low     = lt_t001-bukrs.
      append s_bukrs.
    endif.
  endloop.
  if s_bukrs[] is initial.
    message e000(yuauth) with text-001.
  endif.
endform.


No comments:

Post a Comment

Total Pageviews