Key word: MR01, MRHG, MRHR, Authorization
You want to post an invoice for an account-assigned purchase order. If the user is not authorized to post to the G/L account of the purchase order, E message M8121 is issued: "You are not authorized to post to this G/L account". There is then no way for the user to change the account assignment.
Symptom in Release 3.x: the error occurs when the user tries to correct the line.
This is caused by a program error.
SolutionThis error is corrected in Release 3.0. You can solve the problem with
the following advance correction.
From Release 3.0a to 3.0e there was an additional problem with the
correction. This problem can be solved by implementing the statements
marked with <-3.x.
This lines also appy to Releases 2.1 and 2.2.
I) Structure logic in screen:
SAPMM08R0120
*-------- PAI-Module --------------------------
process after input.
module exit_bearbeiten at exit-command.
module sachkonto_auth_check. <------New
chain.
field bseg-wrbtr.
II) Reportsource :
1) Program MM08RFS0, Form SACHKONTO_LESEN:
....
*------- Berechtigungsprüfung -------------------------------------
move skb1-begru to xek08r-begru. <------Neu
move skb1-begru to dm08r-begru. <------Neu
if skb1-begru ne space. <------Neu
if sak_auth_check = 'X'. <------Neu
. <------Neu
else. <------Neu
perform authority_check(sapfm08r) using 'BES' 'BRGRU'
skb1-begru.
endif. <------Neu
endif. <------Neu
In program MM08RFS0, AFTER
form SACHKONTO_LESEN:
insert following form:
*--------------------------------------------------- <------New
* FORM SACHKONTO_AUTH_CHECK
*--------------------------------------------------- <------New
<-----New
form sachkonto_auth_check. < -----New
<-----New
if xek08r-begru ne space or dm08r-begru ne space <-----New
and xek08r-selkz ne space. <-----New
if dm08r-begru ne space. <-3.x-New
perform authority_check(sapfm08r) using 'BES' 'BRGRU' <-----New
dm08r-begru. <-----New
else. <-3.x-New
perform authority_check(sapfm08r) using 'BES' 'BRGRU' <-3.x-New
xek08r-begru. <-3.x-New
endif. < -3.x-New
endif. < -----New
endform. <-----New
2) Program MM08RFX0, Form XEK08B_ERGAENZEN:
...
* Kontierung
IF XEK08R-KNTTP NE SPACE.
SAK_AUTH_CHECK = 'X'. <------New
PERFORM SACHKONTO_LESEN USING XEK08R-BUKRS XEK08R-SAKNR.
CLEAR SAK_AUTH_CHECK. <------New
...
3) Program MM08RI10, Module FELDAUSWAHL:
....
XEK08R_INDEX = XEK08R_PAGIND + SY-STEPL - 1.
READ TABLE XEK08R INDEX XEK08R_INDEX.
IF SY-SUBRC NE 0.
MESSAGE E008 WITH 'FELDAUSWAHL(SAPMM08R)'.
ENDIF.
FAUS1_ALT = XEK08R-FAUS1.
FAUS2_ALT = XEK08R-FAUS2.
* globales Feld für die Berechtigungsprüfung für SachKonto setzen
SAK_AUTH_CHECK = 'X'. <----NEW.
PERFORM SACHKONTO_LESEN USING XEK08R-BUKRS EK08R-SAKNR.
PERFORM SACHKONTO_AUTH_CHECK. <----NEW
CLEAR SAK_AUTH_CHECK. <----NEW.
IF SKB1-XINTB NE SPACE.
MESSAGE E001 WITH SKA1-SAKNR.
...
else.
...
FAUS1_ALT = DM08R-FAUS1.
FAUS2_ALT = DM08R-FAUS2.
* globales Feld für die Berechtigungsprüfung von Konto setzen
SAK_AUTH_CHECK = 'X'. <----NEW.
PERFORM SACHKONTO_LESEN USING BSEG-BUKRS BSEG-SAKNR.
PERFORM SACHKONTO_AUTH_CHECK. <----NEW.
CLEAR SAK_AUTH_CHECK. <----NEW.
IF SKB1-XINTB NE SPACE OR SKB1-MITKZ NE SPACE.
MESSAGE E001 WITH SKA1-SAKNR.
....
4) Program MM08RI10: insert new module after RW_PRUEFUNG_POSITION:
*--------------------------------------- <----NEW
* MODULE SACHKONTO_AUTH_CHECK <----NEW
*--------------------------------------- <----NEW
<----NEW
module sachkonto_auth_check. <----NEW
perform sachkonto_auth_check. < ----NEW.
endmodule. <----NEW.
<----NEW.
5) Program MM08RTOP, define new field
DATA: SAK_AUTH_CHECK TYPE C . " Flag Berechtig.prüfung
6) Program FM08REA0:
FORM AUTHORITY_CHECK USING AUTH_OBJ AUTH_ID AUTH_VAL.
DATA: AUTH_ACTVT LIKE TACT-ACTVT.
CASE AKT_TYP.
WHEN AKT_TYP-H.
AUTH_ACTVT = '01'.
WHEN AKT_TYP-P. <----NEW
AUTH_ACTVT = '01'. <----NEW
WHEN AKT_TYP-K.
AUTH_ACTVT = '02'.
WHEN AKT_TYP-A.
AUTH_ACTVT = '03'.
ENDCASE.
III) Table definition:
1) Table DM08R:
Field nm Data elem. Cat Length Short text
BEGRU BEGRU CHAR 4 Berechtigungsgruppe <----NEW
2) Table EK08R:
Field nm Data elem. Cat Length Short text
BEGRU BEGRU CHAR 4 Berechtigungsgruppe <----NEW
Additional key words
MR01, MRHG, MRHR, authorization, MR42, M8121
No comments:
Post a Comment