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

About authorization object

Former Member
0 Likes
1,051

hi all,

can u tell me if i am keeping company code authorization then, i used tables vbak, and vbap. Shall i select bukrs from vbak and pass to authorization object or shall i take bukrs from t001 table.

6 REPLIES 6
Read only

Former Member
0 Likes
969

Hi,

It's better select the company code from T001 and then validate.

Read only

Former Member
0 Likes
969

Hi,

It is better to check authorization of Company Codes based on the table T001 as that is the base table which holds all the company codes.

<REMOVED BY MODERATOR>

Kiran

Edited by: Alvaro Tejada Galindo on Feb 26, 2008 12:10 PM

Read only

0 Likes
969

here i dont have company code as input , only vbeln is input, then what should i do then, can u give me a sample code

Read only

Former Member
0 Likes
969

Authorization Object is different from just doing data validation for that compancy code.

Authorization object checks for the is that user having the authorization to execute the program or to do some job with that program or tcode.

validattion that you will to for check wether the data is correct or not.

Authorization object:

Take the authorzation object from your basis/security consultant after that write following code in start-of-selection or at selection screen.

example:

parameters: p_bukrs like t001-bukrs.

authority-check object 'BUKRS' " Your autho object

id 'ACTVT' field '03'

id 'BUKRS' field p_bukrs.

if sy-subrc ne 0 .

message e444 with text-022.

endif.

Validation:

at selection-screen on p_bukrs.

select single * from t001 where bukrs = p_bukrs.

if sy-subrc ne 0.

message e444 with text-022.

endif.

Thanks,

Read only

0 Likes
969

thank u for the reply, but my question here is that , i dont have input company code , i have only sales order no., then how should, i collect company code for that and keep authorization.

Read only

0 Likes
969

you are all missing the main theme here:

There is no direct relation from a sales document (using 'sales organization' for an org-object and thus for an authorization object) to a company code.

so - kiran kumar - i'm not an abaper, i cannot give you a code but i will describe in words how you have to make that relation:

take your sales organisation from your sd-document (VBAK), go to table TVKO and search with that sales-organization. in field TVKO-BUKRS you will find the company-code related to your sales organisation. with the value of this field you can check against table T001.