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

AUTHORITY_CHECKs ??

Former Member
0 Likes
842

Hi Experts,

I worked with AUTHORITY_CHECK_TCODE, AUTHORITY_CHECK_DATASET, AUTHORITY_CHECK_VIEW function modules, fine..........but, I got a requirement from SECURITY guys, which asks me to do.........

"The program Z_my_prog_for_creating_POs(this prog. basically, creates the POs-purchase orders) needs to include authorization objects that provide restrictions on activity, organizational level, etc. "

1- I do not know wht does it mean?

2 - Wht func modules i hv to use to meet this requitement?

replies appreciated

thanq

Edited by: SAP ABAPer on Oct 28, 2008 4:45 PM

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
804

How do you create the POs?

With batch input or call transaction, all checks of the standard transaction (ME21 or ME21N) are processed, no need to code your own.

Same might be true for direct input programs or BAPIs, but you should double check.

Thomas

Hi Experts,

I worked with AUTHORITY_CHECK_TCODE, AUTHORITY_CHECK_DATASET, AUTHORITY_CHECK_VIEW function modules, fine..........but, I got a requirement from SECURITY guys, which asks me to do.........

"The program Z_my_prog_for_creating_POs(this prog. basically, creates the POs-purchase orders) needs to include authorization objects that provide restrictions on activity, organizational level, etc. "

1- I do not know wht does it mean?

2 - Wht func modules i hv to use to meet this requitement?

replies appreciated

thanq

Edited by: SAP ABAPer on Oct 28, 2008 4:45 PM

5 REPLIES 5
Read only

Former Member
0 Likes
804

Hi

You have to use.

AUTHORITY-CHECK OBJECT 'X_XXXX_XXX'

ID 'ACTVT' FIELD 'XX'.

IF sy-subrc EQ 0.

" Has authorization"

Else.

" Has No authorization"

Endif.

Read only

ThomasZloch
Active Contributor
0 Likes
805

How do you create the POs?

With batch input or call transaction, all checks of the standard transaction (ME21 or ME21N) are processed, no need to code your own.

Same might be true for direct input programs or BAPIs, but you should double check.

Thomas

Read only

0 Likes
804

thanq

am creating by using BAPI_PO_CREATE1. So, as u said, from this BAPI, i found the below code, so, let me now that, here in this piece of code, is the SAP is validating the user authenatication?

FORM pre_processing

TABLES

poitem STRUCTURE bapimepoitem

poitemx STRUCTURE bapimepoitemx

poaddrdelivery STRUCTURE bapimepoaddrdelivery

poschedule STRUCTURE bapimeposchedule

poschedulex STRUCTURE bapimeposchedulx

poaccount STRUCTURE bapimepoaccount

poaccountx STRUCTURE bapimepoaccountx

poaccountprofitsegment STRUCTURE bapimepoaccountprofitsegment

pocondheader STRUCTURE bapimepocondheader

pocondheaderx STRUCTURE bapimepocondheaderx

pocond STRUCTURE bapimepocond

pocondx STRUCTURE bapimepocondx

polimits STRUCTURE bapiesuhc

pocontractlimits STRUCTURE bapiesucc

poservices STRUCTURE bapiesllc

posrvaccessvalues STRUCTURE bapiesklc

poservicestext STRUCTURE bapieslltx

extensionin STRUCTURE bapiparex

poexpimpitem STRUCTURE bapieipo

poexpimpitemx STRUCTURE bapieipox

potextheader STRUCTURE bapimepotextheader"#EC ENHOK

potextitem STRUCTURE bapimepotext "#EC ENHOK

popartner STRUCTURE bapiekkop

return STRUCTURE bapiret2

pocomponents STRUCTURE bapimepocomponent

pocomponentsx STRUCTURE bapimepocomponentx

poitemship STRUCTURE bapiitemship

poitemshipx STRUCTURE bapiitemshipx

USING

im_aktyp LIKE t160-trtyp

CHANGING

my_handler TYPE REF TO cl_message_handler_mm

poheader LIKE bapimepoheader

poheaderx LIKE bapimepoheaderx

poaddrvendor STRUCTURE bapimepoaddrvendor

poexpimpheader STRUCTURE bapieikp

poexpimpheaderx STRUCTURE bapieikpx

versions STRUCTURE bapimedcm

ponumber LIKE bapimepoheader-po_number

testrun TYPE xfeld

memory_complete TYPE xfeld

memory_uncomplete TYPE xfeld

no_messaging TYPE xfeld

no_message_req TYPE xfeld

no_authority TYPE xfeld

no_price_from_po TYPE xfeld.

DATA: no_user_exit TYPE xfeld,

wa_poitemx TYPE bapimepoitemx.

  • docu: message handler

CALL METHOD cl_message_handler_mm=>get_handler

IMPORTING

ex_handler = my_handler.

CALL METHOD my_handler->set_config_for_mepo( ).

CALL METHOD my_handler->remove_all( ).

CALL METHOD my_handler->cleanup( ).

thanq

Edited by: SAP ABAPer on Oct 28, 2008 9:21 PM

Read only

0 Likes
804

Yes, when you set NO_AUTHORITY to space (default value), then the BAPI will perform the relevant authority checks, also on organizational level (according to online documentation of BAPI_PO_CREATE1).

Thomas

Read only

former_member156446
Active Contributor
0 Likes
804
You have to use.

AUTHORITY-CHECK OBJECT 'X_XXXX_XXX'
ID 'ACTVT' FIELD 'XX'.

IF sy-subrc EQ 0.
" Has authorization"
Else.
" Has No authorization"
Endif.

that 'X_XXX_X' can be created using Tr su21 and create/ add in a appropriate object