Application Development and Automation 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: 
Read only

Authorization-check and Match code

Former Member
0 Likes
1,147

Hi

How do we declare authorization check?Plase provide me syntax?

does match code relates to it?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
823

Hi RK,

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

AUTHORITY – CHECK OBJECT <object name>

ID <name1> FIELD <f1>

ID <name2> FIELD <f2>

IF SY-SUBRC NE 0.

For Matchcode (which is now called Search help) go to the link

http://help.sap.com/saphelp_nw04s/helpdata/en/c9/83eb02be4c11d1950200a0c929b3c3/content.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee93446011d189700000e8322d00/content.htm

Reward points if this helps.

Manish

4 REPLIES 4
Read only

Former Member
0 Likes
823

Hi

What do you really need to do?

In generally a matchcode doesn't use any authorization-check, you need to create an exit if you need to use it into a matchcode.

Max

Read only

Former Member
0 Likes
823

I would like to know where exactly authority-check use and why?

whats the diff between match-code and authorization-check?

Read only

0 Likes
823

Hi

The matchcode is an dictionary object to select an hit from a list, now it's called SEARCH HELP and you can find it by trx SE11.

AUTHORITY-CHECK is a statament to check if the user can do something, the authoriztion object are defined in ABAP WORKBENCH.

So you use it in your abap code:

  AUTHORITY-CHECK OBJECT <object>     
    ID name1  FIELD f1 
    ID name2  FIELD f2 
    ... 
    ID name10 FIELD f10.
    IF SY-SUBRC <> 0.
 ----> User can't do it   
    ENDIF.

The value of authorizations for every user are inserted in the user profile (see trx PFCG).

So SEARCH HELP and AUTHORITY-CHECK are different object and there isn't a link between them.

Max

Read only

Former Member
0 Likes
824

Hi RK,

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

AUTHORITY – CHECK OBJECT <object name>

ID <name1> FIELD <f1>

ID <name2> FIELD <f2>

IF SY-SUBRC NE 0.

For Matchcode (which is now called Search help) go to the link

http://help.sap.com/saphelp_nw04s/helpdata/en/c9/83eb02be4c11d1950200a0c929b3c3/content.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee93446011d189700000e8322d00/content.htm

Reward points if this helps.

Manish