*&---------------------------------------------------------------------*
*& Form authority_check
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM authority_check.
DATA: ldt_tvko TYPE TABLE OF tvko,
lds_tvko TYPE tvko.
* Check Authorization for Sales Org
* SELECT vkorg INTO TABLE ldt_tvko "EJ3K943661
SELECT mandt vkorg INTO TABLE ldt_tvko "EJ3K943661 Include MANDT in selection
FROM tvko WHERE vkorg IN p_vkorg.
IF sy-subrc NE 0.
SET CURSOR FIELD 'S_VKORG-LOW'.
MESSAGE e313(vf) WITH p_vkorg-low.
ELSE.
LOOP AT ldt_tvko INTO lds_tvko.
AUTHORITY-CHECK OBJECT 'V_VBRK_VKO'
ID 'VKORG' FIELD lds_tvko-vkorg
ID 'ACTVT' FIELD '03'.
IF sy-subrc NE 0.
SET CURSOR FIELD 'S_VKORG-LOW'.
MESSAGE e514(vf) WITH lds_tvko-vkorg.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " authority_check
No comments:
Post a Comment