Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Authority check of sales organization

Former Member
0 Kudos

Hi All,

in my abap program, i used AUTHORITY-CHECK object V_VBKA_VKO.

And i have already assign check value '123' to VKGRP in tcode-PFCG.

But when i excute the program and pass the value 123 to field VKGRP.

Return result sy-subrc is not 0.

So how can i solve the problem?

Looking forward u reply!!

3 REPLIES 3

Former Member
0 Kudos

looking forward your help!

Former Member
0 Kudos

Can you paste your code.

Regards,

Atish

uwe_schieferstein
Active Contributor
0 Kudos

Hello Andrea

If you only want to check for the sales organisation then your coding should look like:

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_AUTHORITY_CHECK
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_authority_check.


PARAMETERS:
  p_vkorg    TYPE vkorg  DEFAULT '123'.




START-OF-SELECTION.

  " Only check for sales organisation. All other AUTH fields are
  " NOT checked for.
  AUTHORITY-CHECK OBJECT 'V_VBKA_VKO'
           ID 'VKORG' FIELD p_vkorg
           ID 'VTWEG' DUMMY
           ID 'SPART' DUMMY
           ID 'VKBUR' DUMMY
           ID 'VKGRP' DUMMY
           ID 'KTAAR' DUMMY
           ID 'ACTVT' DUMMY.
  IF ( syst-subrc = 0 ).
    MESSAGE 'has authority'  TYPE 'S'.
  ELSE.
    MESSAGE 'has NOT authority'  TYPE 'S'.
  ENDIF.

END-OF-SELECTION.

However, if your coding check for

             ID 'VTWEG' FIELD '*'

this means the user must have authorizations for <b>all </b>distribution channels.

Regards

Uwe