2008 Oct 28 3:43 PM
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
2008 Oct 28 3:52 PM
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
2008 Oct 28 3:46 PM
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.
2008 Oct 28 3:52 PM
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
2008 Oct 28 8:21 PM
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
2008 Oct 29 8:43 AM
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
2008 Oct 28 4:02 PM
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
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |