Hi All..
My requirement is to incorporate the Authority-Check for Sales Organization field ( VBAK-VKORG) inthe selection screen. In the meanwhlie, i should restrict further processing of Report, if unauthorized Sales Organzations.
Please help me in explaining the meaning of above requirement and can any one give me the code sample for this..????
Its urgent issue and kindly request you to help me out...
Hi..
When restricting the report execution by sales organization, i need to follow the logic below.
- If none of the sales organizations input in the selection screen is authorized, give a message No authorization for any Sales Org input.
- If some of the sales organizations are authorized but others not, retrieve the data of the authorized sales organizations and display them in the report.
Please give me code sample, as i am unable to make it happen... 😔
Please check if the below code helps you:
One way is as below.
DATA: BEGIN OF lt_tvko OCCURS 0, vkorg TYPE vkorg, bukrs TYPE bukrs, END OF lt_tvko. SELECT vkorg bukrs FROM tvko INTO TABLE lt_tvko WHERE vkorg IN lr_vkorg. IF sy-subrc NE 0. MESSAGE e085(wv). ENDIF. * Check all retrieved co.codes SORT lt_tvko BY bukrs. DELETE ADJACENT DUPLICATES FROM lt_tvko COMPARING bukrs. LOOP AT lt_tvko. * Error Message: No authorization for sales organization &1 PERFORM f_bukrs_auth_chk_p USING lt_tvko-bukrs 'ICC_FI_CN' 'E' '010' lt_tvko-vkorg '' '' ''. ENDLOOP. FORM f_bukrs_auth_chk_p USING value(lc_bukrs) TYPE bukrs value(lc_msgid) LIKE sy-msgid value(lc_msgty) LIKE sy-msgty value(ln_msgno) LIKE sy-msgno value(lc_msgv1) value(lc_msgv2) value(lc_msgv3) value(lc_msgv4). AUTHORITY-CHECK OBJECT 'F_BKPF_BUK' ID 'BUKRS' FIELD lc_bukrs ID 'ACTVT' FIELD '03'. IF sy-subrc NE 0. MESSAGE ID lc_msgid TYPE lc_msgty NUMBER ln_msgno WITH lc_msgv1 lc_msgv2 lc_msgv3 lc_msgv4. ENDIF. ENDFORM. "f_bukrs_auth_chk_p
Select the sales organization mapping to Company code and then restrict.
Kind Regards
Eswar
Add a comment