SAP SD价格隐藏.docx
《SAP SD价格隐藏.docx》由会员分享,可在线阅读,更多相关《SAP SD价格隐藏.docx(42页珍藏版)》请在冰豆网上搜索。
SAPSD价格隐藏
Tableofcontents
1
Description
根据用户的权限隐藏价格信息。
2Functionality
3TechnicalSpecification
3.1ProgramProcess
FlowChat
3.2Input-OutputParameters
N/A
ParameterName
I/O
Type
Length
3.3InputData
N/A
Filename
Description
Fieldname
Description
Type
Length
3.4OutputData
N/A
Filename
Description
Fieldname
Description
Type
Length
3.5ScreenSelection
Field
Description
I/O
3.6Reports
3.7Objectscreatedfortheprogram
Name
Objecttype
Description
3.8UnitTests
Testcase
Description
Executionnumber
Executiondate
Result
1
2
3.9TransactionsandAuthorizations
Transaction
Description
Authorization
Object
Description
Parameters
N/A
Solution
Youcancreatetwoadditionalauthorizationfields,anewauthorization
objectandusetheuserexits.
oUSEREXIT_FIELD_MODIFICATION,
oUSEREXIT_FIELD_MODIFIC_LEER,
oUSEREXIT_FIELD_MODIFIC_KZWI,and
oUSEREXIT_FIELD_MODIFIC_KOPF
todisplayandmanuallychangeconditionsandtheuserexit
oUSEREXIT_PRICING_CHECK
tocreatenewconditionsasolutionisavailablewhichonlyallows
creation,manualchanginganddisplayofthoseconditionlinesofa
pricingprocedureforwhichtheuserhasanauthorization.For
conditionsandsubtotallinesforwhichtheuserhasnoauthorization
onlytheconditionkeyandthedescriptionareshown,allotherfields
arehidden.
Restrictions
1.Inthisconsultingnote,wedemonstrateinanexamplehowtheSAP
authorizationconceptcanbeusedinpricingandwhichimportant
pointsyouhavetotakeintoaccounthere.Here,especially,
everythingthatdiffersfromthisexamplebelongsintotheareaof
consulting.
2.Youthenhavetoassingaccessauthorizationsforeveryuserforall
pricingproceduresusedandthelevelnumbersusedinthese.Ifyou
donotdothis,thesystemdoesnolongerdisplaytheconditionlines
ornolongerdisplaytheminthesamescopeasyouneedthemforyour
work.Thiscanconsiderablyhinderyourwork.
3.Inthechangemode(forexampleVA02),thedeletionofconditionsor
startingofanewpricingwithinthissolutioncannotbeprevented
(thenecessaryuserexitsaremissingforthis).
4.Ifthecreationofaconditionisnotallowedduetoamissing
authorization,thenthesystemdisplaysanerrormessagewhich
preventsfurtherprocessing.Thislinecanonlybeeliminatedagain
bydeletion.
5.Ontheemptyconditionlines,onlythefieldfortheconditionkeyis
readyforinput.Theconditionratecanbeenteredonlyafteryou
pressedthereturnkeyandasuccessfulauthorizationcheckhasbeen
entered.
Procedureindetail
1.Maintenanceoftheauthorizationfields(TransactionSU20):
UsetransactionSU20tocreatethetwonewauthorizationfields'ZKALSM'and'ZSTUNR'.Todothis,usethedataelements'KALSM'(or'KALSM_D')and'STUNR'.
2.CreateauthorizationobjectZ_KONH_KLS(TransactionSU21):
a)ChooseSD(salesanddistribution)
b)Choosethebutton'Create'
c)Enterthefollowingvalues:
oObject:
Z_KONH_KLS
oShortText:
Condition:
Authorizationcostingprocedureandlevel
number
oClass:
SD(Salesanddistribution)
oIncludethefollowingauthorizationfieldsintheauthorization
object:
-ZKALSM
-ZSTUNR
-ACTVT.
3.Inmessageclass'VH'createamessagewithnumber609withthe
followingtext(TransactionSE91):
"Noauthorizationtocreatethe
condition".
4.CreatetheIncludesZZAUTH01andZZAUTH02inthecustomernamerange
anew(TransactionSE38)asdescribedbelow.Selectthefollowing
attributes:
oType='I'(INCLUDEprogram)
oStatus='K'(Customerproductionprogram)
oApplication='V'(Sales)
oDevelopmentclass='VF'(ApplicationdevelopmentR/3billing).
Astitlechoose
oforZZAUTH01:
'Authorizationcheckfortheconditionscreen',
oforZZAUTH02:
'Authorizationcheckforthecreationofconditions'
5.Changetheuserexits
oUSEREXIT_FIELD_MODIFICATION(lv69afzz,MV45AFZZ),
oUSEREXIT_PRICING_CHECK(lv69afzz),
oUSEREXIT_FIELD_MODIFIC_LEER(lv69afzz),
oUSEREXIT_FIELD_MODIFIC_KZWI(lv69afzz),
oUSEREXIT_FIELD_MODIFIC_KOPF(lv69afzz)
asdescribedbelow(TransactionSE38);check,save,andgenerate.
6.Create(accordingtothepreviousstandard)atleastone
authorizationwhichallowstheaccesstoallpricingproceduresand
conditionlines(TransactionSU03):
oDouble-clickon'Salesanddistribution':
Amongotherthingsthe
systemdisplaystheauthorizationobject'Condition:
Authorization
pricingprocedureandlevelnumber',whichwascreatedinthe
abovesteps.
oDouble-clickonthisauthorizationobject:
thesystemdisplaysa
listoftheauthorizationswhichhavebeencreatedalreadyfor
thisauthorizationobject.
oButton'Create':
AuthorizationCOND_ALL,Text'Authorizationfor
allconditions'
oOneaftertheother,positionthecursoron'Action','Procedure'
and'Levelnumber'andbychoosing'Maintainvalues'enterthe
value'*'(thatisauthorizationforallactions,allpricing
proceduresandlevelnumbers).
oFinallychoose'Activate'.
7.Createatleastonesingleprofile(TransactionSU02):
oChoose'Createworkarea':
thesystemdisplaysalistofall
profilesavailable
oChoosethebutton'Create'andinthedialogboxenter:
-Profile:
ZCOND_ALL
-Text:
'Authorizationforallconditions'
-Profiletype:
'Singleprofiles'
-SelecttheauthorizationobjectZ_KONH_KLScreatedintheabove
steps(Condition:
Authorizationcostingprocedureandstep
number).
-Behindthisenterthepreviouslycreatedauthorization
COND_ALL.
-Saveandactivate.
8.AssigntheprofileZCOND_ALLtotheusers,whoshouldhavethe
unrestrictedauthorizationfortheworkintheconditionscreen.This
ensuresthatinspiteoftheimplementationofanauthorizationcheck
theseuserscancontinueworkingasbefore(however,thechanged
authorizationsonlybecomeeffectivewiththenextlog-inofthe
user).
*&---------------------------------------------------------------------*
*&ObjectREPSZZAUTH01
*&---------------------------------------------------------------------*
*&Thisobjecthasbeengeneratedfromanadvancecorrection*
*&attachedtoaR/3note.*
*&---------------------------------------------------------------------*
...
***INCLUDEZZAUTH01.
*BeimerstenAufrufistKOMVinitial;OLD_KOMKl#schen,
*damitaufjedenFallBerechtigungspr#fungdurchgef#hrtwird.
*Sicherheitshalberzun#chstBerechtigungverweigern.
*ifkomvisinitial.
IFSCREEN-NAME='FCODE'.
CLEAROLD_KOMK.
AUTH_SUBRC=4.
ENDIF.
*Berechtigungspr#fungaufKalkulationsschemaundStufen-Nr.
*BeimWechselderKOMV-ZeileeinmaligeineBerechtigungspr#fung
*durchf#hren
IFKOMK-KALSMNEOLD_KOMK-KALSMORKOMV-STUNRNEOLD_KOMV-STUNR.
AUTHORITY-CHECKOBJECT'Z_KONH_KLS'
ID'ZKALSM'FIELDKOMK-KALSM
ID'ZSTUNR'FIELDKOMV-STUNR
ID'ACTVT'DUMMY.
AUTH_SUBRC=SY-SUBRC.
OLD_KOMK=KOMK.
OLD_KOMV=KOMV.
ENDIF.
IFAUTH_SUBRCNE0AND(SCREEN-NAME='RV61A-SELKZ'
ORSCREEN-NAME='KOMV-KAWRT'
ORSCREEN-NAME='RV61A-AWEIN'
ORSCREEN-NAME='KOMV-KBETR'
ORSCREEN-NAME='RV61A-KOEIN'
ORSCREEN-NAME='KOMV-KPEIN'
ORSCREEN-NAME='KOMV-KMEIN'
ORSCREEN-NAME='KOMV-KWERT').
SCREEN-ACTIVE=0.
ENDIF.
MODIFYSCREEN.
●EndeBerechtigungspr#fung
...
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&ObjectREPSZZAUTH02
*&---------------------------------------------------------------------*
*&Thisobjecthasbeengeneratedfromanadvancecorrection*
*&attachedtoaR/3note.*
*&---------------------------------------------------------------------*
...
***INCLUDEZZAUTH02.
AUTHORITY-CHECKOBJECT'Z_KONH_KLS'
ID'ZKALSM'FIELDKOMK-KALSM
ID'ZSTUNR'FIELDKOMV-STUNR
ID'ACTVT'DUMMY.
IFSY-SUBRCNE0.
MESSAGEE609(VH).
ENDIF.
*EndeBerechtigungspr#fung
...
*&---------------------------------------------------------------------*
***********************************************
MV45AFZZ
FORMUSEREXIT_FIELD_MODIFICATION.
*{INSERTXZ3K9035472
DATA:
OLD_KOMVLIKEXKOMV,
OLD_KOMKLIKEKOMK.
DATA:
AUTH_SUBRCLIKESY-SUBRC.
*}INSERT
*CASESCREEN-GROUP3.
*WHEN'900'.
*IFVBAK-VBTYPNE'A'.
*SCREEN-ACTIVE=0.
*ENDIF.
*ENDCASE.
*{INSERTXZ3K9035471
*ifkomvisinitial.
IFSY-MANDT='200'.
IFSCREEN-NAME='FCODE'.
CLEAROLD_KOMK.
AUTH_SUBRC=4.
ENDIF.
IFKOMK-KALSMNEOLD_KOMK-KALSMORXKOMV-STUNRNEOLD_KOMV-STUNR.
AUTHORITY-CHECKOBJECT'Z_KONH_KLS'
ID'ZKALSM'FIELDKOMK-KALSM
ID'ZSTUNR'FIELDXKOMV-STUNR
ID'ACTVT'DUMMY.
AUTH_SUBRC=SY-SUBRC.
OLD_KOMK=KOMK.
OLD_KOMV=XKOMV.
ENDIF.
IFAUTH_SUBRCNE0AND(screen-name='VBAP-NETPR'OR
screen-name='KOMV-KBETR').
SCREEN-ACTIVE=0.
MODIFYSCREEN.
ENDIF.
ENDIF.
*
*}INSERT
*CASESCREEN-NAME.
*WHEN'VBAK-VBELN'.
*SCREEN-ACTIVE=0.
*ENDCASE.
ENDFORM.
lv69afzz
*----------------------------------------------------------------------*
***INCLUDELV69AFZZ.
*----------------------------------------------------------------------*
*{INSERTXZ3K9035471
DATA:
OLD_KOMVLIKEKOMV,
OL