The original blog can be found here: ekessler.de
Inthis blog Iwould like to trysome clarityintheprocessingofexit variables(EXIT_SAPLRRS0_001) to bring.TheemergedwithBW7.30BAdIRSROA_VARIABLES_EXIT_BADIhasto dealwithExitvariablenot exactlysimplified.In addition,theBAdIisunfortunatelynotdocumentedintheSAPHelp. Furthermore,it has nowalsochanged60withthe7.4domainRSCHAVLofCHARtoSSTRING.
Allexit variablesdescribedhereare used tothe range of valuesof a reportlimit orexpandthescopeofpermissions. In addition,thepropertiesdescribedhereby ExitvariablesforExitvariables areto beusedas part of thestaginginDTP's orInfoPackages.
First, however,let usfirst of alldealwith the differenttypesofexitvariables and theirprocessing order.
1.1 Variablentypen
If I talk about exit variablesIdistinguish the followingtypes of use:
- Ready for input
- Not ready for input
- Use for authorization or staging
Ready for inputvariablescomethentouseiftheuser shouldbe given the opportunityto influence theoutcomereportindividually. The basic concept ofan input-readyvariablesprovidestheuserdetermines the valueforthe variable, and the value could not be changed by internalprocessingprocesses(customer exit). Insection 1.3,"Overriding inputvalues", I describe how this conceptcanbebypassedandtheuser-enteredvalue of aninput-readyvariablesin the customer exitcanbeoverwritten.
Reday for inputvariables would be processed in I_STEP=1andI_STEP=3, seeSection 1.2"processing steps(I_STEP)".
Notready for inputvariablescomethentouseifthe value is tobedetermined byrules. Hererulesare often defined(implemented) in whichthe variable valuesforinput-readyvariablesnotdepending on ready for input variables aredetermined.
Notready for inputvariables would be processed inI_STEP=1andI_STEP=2, seeSection 1.2"processing steps(I_STEP)".
Exitvariablescan also be usedas partofauthorization or tostaging. At exitvariablesthat must be consideredare used here, that there is nointeraction with a userisusuallyheld. This meanshereisthe processing orderanother.
Therefore,it must be ensuredherethatcombinationsasready for input, mandatoryandnodefault value(Default value)thatcauseavariable dialogis needed. Processofstaging(DTP, InfoPackage) are usuallyscheduledprocessesinplacethat are executed bybackground-users.
Variablesof usageauthorization andstagingareprocessedonlyinI_STEP = 0, seeSection 1.2"processing steps(I_STEP)".
1.2 Processingsteps(I_STEP)
Exitvariablesdepending on theusageandpurposeinone or more steps, theI_STEP's processed. In the section "Dependencies for Variables ofTypeCustomer Exit" theSAPHelptheI_STEP's are briefly explained.The descriptioninthe online help is unfortunately incomplete and omitted entirely on examples. Therefore, I willbrieflyexplain eachstep again using examples.
1.2.1AuthorizationandStaging(I_STEP =0)
InI_STEP=0exit variablesare processedin theauthorization andare usedinstaging. Figure1.1shows the useof an exitvariableswithintheauthorization. FortheprocessingofexitvariableswithintheentitlementonlytheI_STEP=0is traversed.
![Figure_1_1.jpg]()
Figure1.1: Exitvariableswithintheauthorization
Figure1.2showsthe use of anexit variablesinstagingthe example ofselectionwithin anInfoPackage.
![Figure_1_2.jpg]()
Figure1.2: Exitvariables within theStaging
1.2.2Initialization(I_STEP =1)
TheI_STEP=1 is used forinitializationofvariablesandexitis runseparatelyfor eachexit variable. In the first stagetheinput-readyvariablesandthennotready for inputvariables are processed, seeFigure1.7. (The order could be differ, depends on the release (here BW 7.31 SP06)!)
Figure1.3shows a typical exampleof initializingan input-readyvariables. The variable isinitialized withthecurrent monthof last year.
![Figure_1_3.jpg]()
Figure1.3: Initialization
1.2.3Derivationof variable values(I_STEP =2)
TheI_STEP=2is used toderive thevaluesfor the non-input-ready variablesExit. Again, thevariables areprocessedseparatelyanalogous toI_STEP=1. To derive thevalues for non-input-ready variablesExitall previouslydetectedvariable valuesin the parameterI_T_VAR_RANGEavailable. Insection 1.3,"Overriding values entered" I describeas well asinput-readyvariables can beprocessedhere.
Figure1.4 showshowthe currentvariable(examination of thevariable nameisnot shown here), the value is derived basedon thevalue of the variableZTKE_MONTH.
![Figure_1_4.jpg]()
Figure1.4: Derivation ofvariables
1.2.4validation(I_STEP = 3)
TheI_STEP=3is used to validateall recordedvariables.InI_STEP=3all previouslyrecorded valuesin the parameterI_T_VAR_RANGEaretesting and validation.
TheI_T_VAR_RANGEparameter containsonlythevariablesthat contain a value. That isherearetheonlyvariablesincluded:
- value set by default value or
- value set byan implementation(I_STEP =1orI_STEP=3) or
- user entereda value in thevariable dialog
InI_STEP=3cannotbechanged, the values of the individualvariables. It is possibleto generate messages which would be displaywith thereport-result or the variable dialog. In the eventthatthevalidation of thevariablesmeans thatit makes no sensetorun the reportby throwingan exception(RAISE EXCEPTION) to preventthe report is run. The exceptionmeans thattheuserre-enters the values in the variablesdialog.
Figure1.5 showsthevaluesfor the two variablesZYEARFROMandZYEARTOdetermined andthen comparedas inI_STEP=3. Ifthe FROMvaluegreater thanTOvalueofamessage is issued andusing the RAISEstatementwrong_valueprevents thereport is run. The userhasthe opportunityto correct the valuein the variabledialog.
![Figure_1_5.jpg]()
Figure1.5: Validation -CustomerExit
Figure1.6 showssimilar tothe exampleinFigure1.5, as in the object-orientedcontextto run thereportcan be prevented. The exceptionmustbethrownherein theobject-orientedcontext.
![Figure_1_6.jpg]()
Figure1.6: Validation -BAdI
1.3Execution OrderofI_STEP
Figure1.7 showsthesequence in which theindividual's I_STEPunder aBExreports.I distinguishthe twophases:
- Präparation(preparation phase) and
- Validierung(Validation Phase)
TheI_STEP's thepreparationphaseare runbefore the variabledialogue andI_STEP's validationphasewill onlygo throughifthe values of theinput-readyvariableschangein thevariablesdialog.
![Figure_1_7.jpg]()
Figure1.7: Processing ofexit variables(I_STEP's)
That isthe callingSAPstandardprocessing procedureinitially assumesthat the useraccepts thedefault values of thevariablesdialogwithout changing. In thiscase, the validationphaseis not runagain!
Theprocessstepsof thevalidationphasewill onlygo throughifthevaluesin thedialogvariableswerechanged by the user.
1.4ProcessingofprocessvariablesExit
WithBW7.3theBAdIRSROA_VARIABLES_EXIT_BADIwasintroducedandpresented to thecustomer exitEXIT_SAPLRRS0_001. The blog Coexistence of BAdI RSROA_VARIABLES_EXIT_BADI and Customer-Exit EXIT_SAPLRRS0_001showshowtheBAdIandthecustomer exitbehaveinaBW7.3system.
Figure1.8shows the individualprocessingblockswhich are executedas partof the variableprocessingofexitvariables.
![Figure_1_8.jpg]()
Figure1.8: Variables processing
Thestandardprocessingprocessfirst checkswhether an activeBAdIimplementationbyTypeRSROA_VARIABLES_EXIT_BADIisavailable. As afiltervaluehere, the technical name of theInfoObjectis usedontheexit variablebasedcurrently being processed. From a technicalperspective, thistest is performedwithin the function blockRRS_VAR_EXITvia GETBADI.
The blogNew BAdIRSROA_VARIABLES_EXIT_BADIdescribesthemanufacturing processof theBAdI's in the details.
1.5Overridinginputvalues
The basic principleforinput-readyvariableswasinitiallythatuser enteredvalues can notbeoverwritten. An input-readyvariable isnotprocessedbydefaultafter the variabledialogas a singlevariable.
InI_STEP=3, the variablecanindeedbe validatedbutnot be changed. If it is determinedduring validationthattheuser enteredvalueisnot meaningful, in the I_STEP=3 is amessagethatthe usergeneratedinformed. In addition,an exceptionwill bethrown. The exceptionensures thatthevariablesdialogappearsagain.
With the introductionof the parameterE_CHECK_AGAIN(see Note1272242-RenewedVariablenverprobunginI_STEP=2), the concept was canceled. The parameterallows thedeveloperto theuser-enteredvalue of aninput-readyvariablesafter the variabledialoginI_STEP=2to overwriteas needed.
As describedinSection 1.2"processing steps(I_STEP)" input-readyvariablesonlyinI_TEP=1andI_STEP = 3 processed, the value onlyinI_STEP=1 changes(initialiesiert) canbe. To ensurethatan input-readyvariablesinI_STEP= 2 isagainprocessedmust be inI_STEP=1forthis variable is theexportparametersE_CHECK_AGAIN(E_CHECK_AGAIN ='X') are set. If the parameter issetE_CHECK_AGAINsothisis ready for inputvariable isprocessed into anotready for inputvariablesinI_STEP=2analogoustothevariablesdialog.