Está en la página 1de 6
EQ” 42318 - Frequently asked questions about validations and substitutions Version 13. Validity: 12.11.2013 -actve Language Engish Header Data ReleasedOn —13.112013084927 Release Status Released for Customer Component —_F.SLVSR Validation, Svostiuton and Rues Other Components | MIV-AV-LIV Logistics invoice Ventication | Priority Recommendations / Additonal fo Category Faa ‘Symptom This note deals with frequently asked questions about validation and substitution maintenance. Solution I. Creating, activating and transporting validations and substitutions 1. which transactions are required to use validation or substitution functions? 6680 Validation Maintenance GGB1_ Substitution Maintenance ceV2 Rule Maintenance GcB4 Select action for validation/substitution, for example, activation of application areas, message usage or substituted Fields ov i GCX2 Definition of Includes for User Exits 0828 Activation of FI validations OBEH Activation of FI substitutions OBBZ Activation of cost of sales accounting substitution Cin the FT area) OKC? Activation of CO validations OKCO Activation oF CO substitutions GCT9 Transport: Validations GETO Transport: Substitutions 2. What must T take into account when using the formila editor? a) Validation co50 Tf you create the first validation for a callup point, for example ‘Financial counting - document header", you must define a message class. This is then valid for ALL validations for this callup point Not_all fields can be used for validations for certain callup points, for example ‘Complete document in FI’. this is because there are several rows and itis not clear on which row the check is to be Carried out. You can only use numeric fields here. (Note 413956) You should use a user exit if you need more checks on this callup point. b) Substitution Gost Tf you create a substitution, for example "Financial accounting - document Tine item”, only certain Fields are authorized for thé substitution. This is because it may lead to problems with the documents of inconsistencies between different applications - Tris possible to release more fields for substitution. However, this can be critical, as serious problems can occur asa result This is why you should regard the following change as a modification (Note 170183): The table GBOl contains Information about which table Fields can or cannot be substituted for which cal lup point. A field can be substituted if you change the field BEXCLUDE to ' *. For example: ‘Complete document’ callup point in FT AS standard, no field is released for substitution for this callup point. You can see this in the Following entries: BOOLCLASS CLASSTYPE @CLTAB BCLFIELD BEXCLUDE O15 $ BKPF * x 015 5 BSE * x SoOLCLASS_- specifies the Boolean class. this is determined in the application area and callup point 008°= Document header (1) O15 = Complete document (Fx) O16 = Cost of sales accounting 100 = Document header (co) CLASSTYPE - specifies if the field can be used for validations (6), substitutions (s) or both (a). BCLTAB ~ Table that 4s used BLCFIELD ~ Field of this table BEXCLUDE - Can be used " "or cannot be used ‘x' As mentioned above, you should regard this change as a modification. Problems that occur as a result of this change canhot be handled in ‘standard’ support. 3. what must I take into account when activating validations or substitutions? ‘You can activate validations and substitutions in two ways. aetvntevel: 1 - active 2'= "Active, except during batch input processing Because the activation in Financial accounting (FI) is company code-specific, you should activate the validations or substitutions in both company codes in the case of cross-Company code transactions. 4. what must T take into account when transporting validations or substitutions? usually, only table entries are transported when validations or substitutions are transported. the generated source code should not be transported, as this ean cause problems. After the import into the tanger systen, the source code 1s! generated autonatically when You start the report ROVGBROO ts started. If you want to delete a validation/substitution, and do not want to do this in each system individually, proceed as described in Note 840981. II. Using user exits in validations or substitutions 1. Where can I maintain user exits for validations and substitutions? The exits for validations and substitutions are stored in an include of your choice. The Following includes are delivered as examples by default: RGGBROOO Val/Sub: Exits for rules RGGBSO00 Val/Sub: Exits for substitutions You should ‘copy these into the customer namespace, for example ZGGR000, The length of the name you choose should not exceed 8 characters. This is because the name is also generated in the source code, and it may exceed a certain Tine length You can also create a separate include for each client, which can Improve performance. In transaction GOX2, you should then define where of your include as 4 FORM pool in the relevant app ur include is used. To do this, enter the name cation area, 2. How should I create a user exit? Define your user exit in the FORM routine GET_EXIT_TITLES with the correct exit type (EXITS-PARAM). You can’use the existing sample entries as a template for this The exit types required in the FORM routine GET_EXIT_TITLES are organized as follows: + C_EXTT_PARAM_NONE No parameter dation. Apart from the return value (G-TRUE or § FALSE), you do not need any paraneters fer the valid nly, donot want to substitute a field, use this parameter in the substitution (select ext However, you must then use a TABLE statement in the FORM pool (not in the actual form) to identify the relevant structure. + CLEXIT_PARAM_FIELD A field is transferred as a parameter You only use this type in the substitution. Exactly one field is substituted. Enter user exits of this type in the substitution maintenance instead of assigning a constant value. + CEXIT_PARAM_CLASS A complete type is transferred as a parameter Matrix validations/substitutions ("Only exit"). This exit type can only be used for callup points with complete documents, for example in FI and LC, You cannot use this exit type for_any other callup points. The transferred type contains all information about a class. An example ts the use of the document header and all corresponding Tine items in the Fl areas In the FORM routine GET_EXIT_TITLES, change the fields NAME and TEXT of the internal table EXITS to the values you want Use one of the sample routines as a template and copy these to the names you selected. You can now implement the functions you want in this FORM routine. After you have Finished Creating the user exit, you can use it in your validations or substitutions. 3. What must I take into account when implementing the user e Nopdialog boxes, warning messages, information of error messages must be issued in an exit, and a "COMMIT WORK" mist not be rejected. This would, for example, interrupt the batch processing or cause problens with the documents to be posted. If you tind a serious error in the field contents in the exit, senda termination message (A or X), which will ensure that the transaction is terminated. Do not use any ABAP commands that cause you to leave the exit directly, for example ‘LEAVE (To) SCREEN ...°, ‘SUBMIT ...°, “CALL TRANSACTION ...° or a call of the F4 help. an an exit, use only structure fields that belong to the Boolean class of the calling substitution, Validation’ or rule. the other structure Tields are not filled or are not filled properly for the callup point of the calls of the substitution, validation or rule. ‘You may make changes to field contents in a substitution exit only if this field can be substituted jn the Boolean class. You can display these Fields by choosing “Add entry” in the substitution maintenance. In the includes of the substitution exits, you must not use the commands MODIFY, INSERT, UPDATE or DELETE in internally used structures. such’as BSEG or BKPF. These structures are interpreted internally as database tables because they are defined by a TABLES statement. As a result, the system writes, deletes or changes database records if you use the commands mentioned above. This can cause serious inconsistencies and problems inthe document processing. Tf you want to change Field contents in the exit type < EXIT pawi_CLASS, you should make the changes in the internal table BOOL_DATA Cfor example BOLL_DATA-BSEG). TIT. Problem analysis 1. what must I take into account before I analyze the problem? Before you analyze a problem with, validatjons/substitutions, make sure that the generated source code is’up to date. You can use the report RGUGEROD to do this. Call this report in transaction SE38. You see the following selection screen: Application area * * Application callup point * Regenerate main program Generate table File Generate rules Generate validations Generate substi tutions Generate sets Generate rule use Generate validation use Generate Substitution usage * Generate substitution export routines Generate substitution routines in all clients “cenerate trace program calls Now update the source code for the application area and application callup point in which the Validation or substitution was created. To do this, enter the application area, for example FI, and the application callup point (0003/complete document), and set all indicators except for ‘Generate substitution routine in all clients" and “Generate trace program calls”. Then execute the report. The source code is now at its current status. 2. How can the validation and substitution trace be used? @ Validation trace You created and activated a validation. You can now activate the trace, for example in transaction GGBO. To do this, select the validation and choose "Extras -> Activate trace’ Example: You created an Fr validation for the callup point ‘Line item’. To test the validation, call transaction FOL, for example. The trace is displayed as soon ag the validation has rin. You can now see different things in the trace, for example the values contained in the fields of, the various Structures. From this, you can sed whether additional checks are required, or what the Cause of a problem is: b) Substitution trace activate the trace in the same way as you activate validations. exam You ereazed a substitution in the same way as you activated the trace for the validation described above, the trace. For zubsti tutions has an addi Cional funeion, in that you can view the Meld convents before and after the substitution. There, problems can be reproduced in the same way. 3. How can I use the Debugger to analyze a problen? a) General information A] includes for validations and substitutions are created in this form: fam stands for the two-digit client key. You can use the function module G-CLIENT_ENCODE to convert a three-digit client (greater than 099) toa two-digit client (for example, client 100 —-> Aa) client 800 => Ta ceTnnaad. fy SeaNIS FUE UNE APE ILALIOTE are, FOr exAM TE FL AHF PIMA yet ALCUUTILINNS Therefore, GTAAFIO 4s the include in client 100 for Fi validations and substi tutions. b) Structure of the includes and FORM routines for validations and substitutions and tips on how to debug The includes listed above are structured as follows (sample include in FI, Client 800) INCLUDE GRTTQFIA, INCLUDE GETTOFTe INCLUDE GETTOFIC INCLUDE GETTQFID| INCLUDE GETTOQFIE INCLUDE GETTOr IF: Rules Substitutions Substitution condi tions Validation Validation conditions Validation checks INCLUDE GETTQFIT. " Application rules INCLUDE GETTQFTI" " Subst. export routines INCLUDE GETTOr IV, ""Trace/similation INCLUDE GETTOrTS: " Subst. import routines ©) The FORM routines for validations have the following sample structure (sample validation with ‘the name VALOL): FORM _VAL_VALOL. GLBFOUND = 6 TRUE DATA: COND. LIKE DROOL, CHECK CTKE DUeO0L ; NVALSEVEREST LIKE SY-SUBRC VALUE ~ Guster = "001" PERFORM VALCOND_IVALO1##001 “CHANGING COND. IF COND = 8 TRUE . PERFORM VALCHCK”2VALOL##001 ‘CHANGING: CHECK. IF CHECK = B_FALSE PERFORM MESSAGE_OUTPUT USING wre. Nachrichtenparaneter CHANGING NVALSEVEREST. ENDIF. ENDIF. ENDFORI, VAL_VALOL ‘The statement G_STEP = "OOL’ indicates the step that is executed. the prerequisite of the step js defined in the FORM routine VALCOND_..., and the FORM routine VALCHCK_..- checks the validation step. To analyze this step, you should create breakpoints on these two PERFORM statenents and also on the code line ‘IF CHECK = FALSE". This allows you to determine whether your prerequisite or the check 4s causing the problem, for example if a field that is to be checked does not contain the value that you expect. ) The FORM routines for substitutions have the following sample structure (sample Substitution with the name SUSO1) FORM SUB_SUBOL. G_BFOUND = B_TRUE. DATA: COND. LIKE D_BOOL. GCLAssID = "000". G_SUBST_PERFORMED = 6_FALSE. IF G_TAB_FLAG-BSEG <> B_TRUE . PERFORM READ_MASTER_DATA USING. “BSEG" G_BFOUND. IF GBFOUND = B_FALSE - MESSAGE £083 WITH "BSEG" ENDIF. ENDIF. G_sTEP = "001". PERFORM SUBCON” 3SUBOL#FOOL CHANGING COND. TF COND = 8 TRUE BSEG-SGIXT = ‘This is a Test* ” Text G_SUBST_PERFORMED = 6_TRUE ENDIF ENDFORI * sue_sueoL As mentioned above for validations, 'G_STEP = 'O01' indicates the step, and the prerequisite of the Substitution iz defined in FORM routine SUBCON_.... The actual substitution is performed by the Statements in the structure IF COND = B TRUE —-> ENDIF. These statements vary depending on the type of substitution created (field allocation, constant value, user exit), In the substitutions, you should also set a breakpoint for the PERFORM on the prerequisite and the Statement "IF COND = B/TRUE"- 4. Function modules that call validations and substitutions Validations — Function module G_VSR_VALTDATION_CALL The different ctructures/tables, the name of the validation, callup point and application area are assigned to this function module Substitutions ~ Function module G_VSR_SUBSTITUTION CALL The paraneters transferred to validations are also transferred to this function module. However, this’ function module also returns the structures or tables that contain the changed vaiues- You could set a breakpoint to analyze both function modules. By doing this, you can see which data was transferred, which data the validation or substitution receives, and which values are returned. 5. what must I take inte account when using the set? When sets are used in validations or substitutions, the system generates source code from the values in the sets. Performance problems can occur if a set is of a certain size, since the generated source code causes Tonger runtimes. This can also cause a runtime error. To reduce the size of the source code of the sets used, proceed as follows Use a smaller set_in. the validation, substitution or rule, To do this, group single values in the Set into intervals (for example, instead of the single values 0001, 0008 and 6005, use the interval abb1'*Bo085* instead of “ IN SET2 )", where SETL and (ET2 ppeicher rnc lade tie values tyemieny “Cfor"exmevtec feubhjerarchies x ef highest hierarchy ‘The simplest way to determine the number of single values or intervals in a set hierarchy is to execute the program RGSEX000. Enter the name of the set and execute the program. All contained sets and values/intervals are Visted and the sequence number of the entries is contained in the first column. 6. why does a validation or substitution work in the development system, but not work in another system after a transport? ‘You should make sure that validations and substitutions are activated in the target system. You can also use the report RGUGEROO to regenerate the source code again. ‘There could be another cause in substitutions: You try to substitute a field that is not released by saP as standard. To substitute a field, you have adjusted the table GbOl in your development system. However, this table was not adjusted in the target system. The generated source code is correct and the value was changed in the substitution, but the change was not returned to the calling application using the export routines. Validity -FromRel ToRel. And Subsequent 450/458 Oo 46a [468 a 4c | 40C a 470/470 a 500 [500 a ‘600 | 600 a 002/02 a 003/603 a 04/604 a 605/605 o 606 | 606 a om at6 a of? lat? a References This document refers to: SAP Notes 11309674 ENJOVIEBO1: No substitution for evert 3 dunna simulation 1840981 Cross.systom deletion of validations or substtuions 419906 Complete document mato valdation_-supstmution 158739 Validation when parking documents in E] This documentis referenced by: SAP Notes (2) 1410838 Gomoleting the posing of documents wi clased pasting petiod 1999674 ENJOVIFBO1 No subsifution for event 3 during simulation

También podría gustarte