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: 

re : Authorization-check

Former Member
0 Kudos

hi

i wand to check authorization before select statement not in selection-screen, can any one send me coding for this.

mani.r

6 REPLIES 6

Former Member
0 Kudos

You can achieve it in the INITIALIZATION event

Former Member
0 Kudos

Call this function module with TCODE as the input befoer your select statement


  CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
    EXPORTING
      tcode  = tcode
    EXCEPTIONS
      ok     = 0
      not_ok = 1.
  IF sy-subrc NE 0.
    MESSAGE e059(eu) WITH tcode.
  ENDIF.

If you are trying to get data from Infotypes through select query, you can use the function module

HR_READ_INFOTYPE

It will take care of authorizations

Reward points please

0 Kudos

hi

not for t-code. for field.

thank u

mani.r

0 Kudos

can you explain more on your requirement

What field, where is the field (in which TCODE)

Why are you trying to check authorization

0 Kudos

hi

i dont want to check the authorization in at selection-screen level. i want to check the object and field in selection level. for eg vtweg in v_kna1_vko.

thanks

mani.r

Former Member
0 Kudos

Hi,

You can use this sample code:


at selection-screen output.

if sy-uname <> 'Some_User'.
message 'No Authorization'.
endif.

OR

"You can use authority check object.

Thanks,

Sriram Ponna.