Posted: Sun Sep 02, 2007 5:41 pm Post subject: FAQ
Used to amend the sap standard transaction screens.
Global Field Values
Used to amend the sap standard fields (similar to field selection in the IMG).
1. The SAP system has to be configured for field-exits (see ABAP Team)
2. Run TCode CMOD and enter FCode PRFB
3. Create field-exit and function module
4. Ensure both FE and FM are active
5. Check TCode RZ11 for the profile parameter abap/fieldexit = 'YES' before system start.
More info: Activating ABAP Field Exits
Field exits (SMOD/CMOD) Questions and Answers
1. Field exit was created with CMOD, but is not processed when calling the screen.
Since the field exit is not processed until PAI, an action must be triggered on the screen (Return, Save, ...).
Set profile parameter abap/fieldexit to YES and restart the system.
After activating the function module FIELD_EXIT... and the field exit, leave the transaction on whose screen the field exit is to be executed. The screen is not generated until the transaction is started.
Do not work on different application servers since there may be some delay before the field exit is activated.
The profile parameter must be set on all or none of the application servers.
If the field exit is to only be active on specific screens, check whether you chose the correct program and the correct screen number (take care with subscreens).
Using SE51 -> Field list, check that the screen field does have a reference to a data element. In the name of the field exit use the name of the data element and not the field name.
After transport, field exits are marked as active but will not be processed. Tip: First try deactivating the field exit once more and then afterwards, activate it again.
2. How is performance affected by setting abap/fieldexit?
If a screen is generated and the profile parameter is set, a check is run on 2 tables (TDDIR, TDDIRS) to see whether a field exit must be generated for the respective field. In practice, the screen load is not generated until the screen is selected after an update. The user should not notice any difference because screen generation is very fast.
3. Can you read the contents of other screen fields in the field exit?
In principle, every field exit can store its value in the global variables of the function group (TOP) and hence make them available to other field exits. Note here that field exits are always called and not only if an entry is made in the field or if the field is empty. In addition, it is not possible to make any assumptions about the order in which the field exits will be called in the future.
4. How does the field exit behave on step loop fields ?
After the user has entered data, the field exit is called in PAI as often as there are visible fields in the step loop. The system variable SY-STEPL is incremented each time. If a new value is assigned to the field, it is displayed in the module between LOOP and ENDLOOP. This module is also called once for each visible step loop line.
5. Can field exits be debugged ?
No. Field exits must be tested separately in the ABAP/4 Development Workbench. For errors which only occur in the screen environment, it is helpful to write interesting variable to the file system using TRANSFER... . These can then be analysed there.
6. What can you do if the field contents are no longer transported to to ABAP/4.
Check whether a value is assigned to the field OUTPUT.
7. When is the field exit called if a conversion exit is attached to the data element ?
The field exit is called after the conversion exit. This means that the INPUT field receives the data in the same format as the ABAP/4 program also receives it.
8. Although a global field exit is inactive, a function module is called
which does not exist (for example FIELD_EXIT_PROGRAMM_@)
This is an error in the kernel which no longer occurs as of 3.0C. As a temporary measure, it is useful to assign a program and a screen which do not exist to the field exit and then activate the field exit.
9. Field exit is not visible in CMOD, although created.
If you want to create a field exit for a data element, a function module is proposed with the name FIELD_EXIT_. This function module must exist for the field exit to work. If you do not create this function module, but do create one with a suffix, the data element is not displayed in CMOD.
10.Field exit is not executed although it is active.
Fields which do not have the 'Input field' attribute usually do not trigger a field exit. The field exit is designed to allow an extended input check. It is therefore only called for input fields even if they are not ready for input at runtime of the application by LOOP AT SCREEN. This rule does not apply, however, if the field is located within a steploop. Here the field will be always activated, even if it is invisible.
Field exits can only be executed for fields that are directly related tothe dictionary. If the relation is indirect, i.e. via an ABAP declaration ( LIKE ), no field exit can be executed.
11. Field exits on check buttons do not work
Field exits are only intended for input fields. As check buttons count as graphical elements, you cannot install field exits on them.
12. Field exits do not work on selection screens
User-exits (Customer Function Exit)
Переименование (перевод) текста элемента данных
1. Нажимаем на поле F1, затем Техническая информация - определяем название элемента данных. Экран с техн.тнформацией оставляем открытым.
2. Запускаем SE63 -> Переводы -> Краткие тексты -> Abap словарь -> Элементы данных
3. Изменяем тексты и сохраняем
4. Возвращаемся на экран Техническая информация - дважды кликаем по элементу данных и нажимаем Сгенерить; возвращаемся на экран ТехИнфо и подобным же образом генерим таблицу(щелкнув по имени поля) и экран (щелкнув по номеру эрана)
в SE11 открыть элемент данных и Goto->Translation
Запрос на перенос переводов - программа RS_LXE_RECORD_TORDER.
Поиск: Тран. S_ALR_87101281
Business Add-Ins (BADIs) are the new generation user-exits and can be found via TCode SE18/SE19
Перед вызовом BADI вызывается метод: cl_exithandler=>get_instance.
Заходите в se24, выбираете класс cl_exithandler, ставите точку останова в методе get_instance, запускаете нужную вам транзакцию и ждете остановки. Можно посмотреть в SE30 (ABAP Objects Runtime Analysis) вызывается ли он вообще.
Для 7-го базиса - точка прерывания на операторе CALL BADI.
In SE80 in a client that you can run the transaction in, set a break-point in the class "CL_BADI_FLT_DATA_TRANS_AND_DB" in the method "ACT_IMPS_PER_FLT_VAL" just after the "SELECT" headed by the comment "read BADI attributes". Run the transaction. At each break-point in the debugger, examine the fields "exit_name" and "internal". The name of the BADI is in "exit_name" and the BADI is reserved for SAP use if "internal" has a value of "X".
To check whether a BADI is available you can do the following:
- go to transaction se80
- class CL_EXITHANDLER
- method get_instance
- put breakpoint after cl_exithandler->get_class_name_by
- the system will stop everytime a BADI is called. info on existing BADI's can by found in parameter exit_name.
Create customer specific ABAP programs e.g. front-end screens, reports, tables etc
Simple and intuitive transaction for creating customer specific reports without the need for specifc programming knowledge.
Create customer specific lists similar to SE16/SE17 format. You can also link multiple table together with this program (table joins).
Create customer specific ABAP programs to run periodically e.g. enter data overnight. These programs typically perform the same actions as a user would e.g. updating an equipment master record.
Business Transaction Events (Open FI) TCode: FIBF, BERE, SWU_EWBTE
Технология Open Fi - описание на русском http://www.sap-easy.net.ru/open_fi.htm Для поиска вызываемых событий нужно поставить точки останова в
ФМ BF_FUNCTIONS_READ (для событий) и PC_FUNCTIONS_READ (для процессов).
Available BTE Objects:
PM000010 Update notification
PM000020 Update equipment
PM000030 Update order
PM000040 Update measurement point/document
PM000050 Update confirmation
PM000060 Update order object list (inc serial number)
PM000070 Update functional location
Function modules BF_FUNCTIONS_READ or BF_FUNCTIONS_FIND can also be used for finding an appropriate BTE
1. Copy function module SAMPLE_INTERFACE_PM000020 to ZSAMPLE_INTERFACE_PM000020 and enter breakpoint.
2. TCode FIBF, Menu path: Settings->P/S Modules->of an Application
3. Create an entry: |PM000020|blank|PM|ZSAMPLE_INTERFACE_PM000020|
4. Create a new equipment and save. It now stops at the breakpoint in ZSAMPLE_INTERFACE_PM000020
I. Creating, activating and transporting validations and substitutions
* taken from OSS notes # 842318
Q. Which transactions are required to use validation or substitution functions?
GGB0 Validation Maintenance
GGB1 Substitution Maintenance (создание замещений)
GCVZ Rule Maintenance
GGB4 Action selection for validation/substitution, for example, activation of application areas, use of all messages or substituted fields
GCX2 Definition of the Includes for user exits (пул FORM для экзитов)
OB28 Activation of FI validations
OBBH Activation of FI substitutions ( ведение замещений для БЕ и момента )
OBBZ Activation of cost of sales accounting substitution (in the FI area)
OKC7 Activation of CO validations
OKC9 Activation of CO substitutions
Q. Как найти замещение?
При моделировании запускается ФМ
G_VSR_MULTI_SUBSTITUTION_CALL - RuleMan: Substitution Call for Complex Objects
При проводке документа материала
G_VSR_SUBSTITUTION_CALL - RuleMan: Substitution Call
Ставите внутри ФМ точку останова и получаете параметры замещения.
Далее ищите в spro (см. картинку)
См. ноту 386896
Q. What must I take into account when using the formula editor?
a) Validation GGB0
If you create the first validation for a callup point, for example 'financial accounting - document header', you have to define a message class. This is then valid for ALL validations for this callup point.
Not all fields can be used for validations on certain callup points, for example 'Complete document in FI'. This is because there are several rows there and it is 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 GGB1
If you create a substitution, for example 'financial accounting document line item', only certain fields are authorized for the substitution. This is because problems can occur with the documents or inconsistencies can occur between different applications.
You can release more fields for substitution but this can be critical as serious problems can occur as a result.
This is why you should regard the following change as a modification (Note 170183):
The GB01 table contains information about which table fields can or cannot be substituted for which callup point.
You can make a field substitutable by changing the BEXCLUDE field to ' '.
For example: 'Complete document' callup point in the FI
In accordance with the default, no field is released for substitution on this callup point. You can see this in the following entries:
BOOLCLASS CLASSTYPE BCLTAB BCLFIELD BEXCLUDE
015 S BKPF * X
015 S BSEG * X
BOOLCLASS - Specifies the Boolean class. This is determined in the application area and callup point in each case, for example:
008 - Document header (FI)
009 - Line item (FI)
015 - Complete document (FI)
016 - Cost of sales accounting
100 - Document header (CO)
CLASSTYPE Specifies if the field can be used in the case of validations (B), substitutions (S) or both
BCLTAB - Table that is used
BLCFIELD - Field of this table
BEXCLUDE - Can be used ' ' or cannot be used 'X'.
As mentioned above, you should equate this change with a modification. Problems that occur as a result of this change cannot be handled in the 'standard' support.
Q. What must I take into account when activating validations or substitutions?
You can activate validations and substitutions in two ways.
Activation level: 1 - Active
2 - Active, except during 'batch input' processing
Because the activation in the financial accounting (FI) is company-code-specific, the validations or substitutions should be activated in both company codes in the case of cross-company code transactions.
Q. What must I 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, since this can cause problems. After the import into the target system, the source code is generated automatically when the RGUGBR00 report is started.
If you would like 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
Q. 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:
RGGBR000 Val/Sub: Exits for rules
RGGBS000 Val/Sub: Exits for substitutions
You should copy these into the customer namespace, for example ZGGBR000.
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 so a certain line length may be exceeded as a result.
You can also create a separate Include per client as this can improve performance.
In Transaction GCX2, you should then define where your Include is used. To do this, enter the name of your Include as a form pool in the relevant application area.
Q. How should I create a user exit?
Define your user exit in the FORM Routine GET_EXIT_TITLES with the correct exit category (EXITS-PARAM). You can use the existing sample entries as a model for this.
The exit types required in the FORM Routine GET_EXIT_TITLES are organized as follows:
C_EXIT_PARAM_NONE No parameter
Apart from the return value (B_TRUE or B_FALSE), you do not need any parameters for the validation. If you do not want to substitute a field, use this parameter in the substitution (select "Only exit").
However, you must then use a TABLE statement in the formpool (not in the actual form) to identify the structure concerned.
C_EXIT_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.
C_EXIT_PARAM_CLASS A complete type is transferred as a parameter
Matrix validations/substitutions ("Only exit"). This exit type can only be used in the case of callup points with complete documents, for example in the FI and the LC. You cannot use this exit category on any other callup points. The transferred type contains all information of a class. An example is the use of the document header and all corresponding line items in the FI area.
In the FORM routine GET_EXIT_TITLES, change the NAME and TEXT field of the EXITS internal table to the values you want.
Use one of the sample routines as a model 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.
Q. What must I take into account when implementing the user exit?
No dialog boxes, warning messages, information messages and error messages can be issued in an exit nor can a "COMMIT WORK" be rejected. This would, for example, interrupt the batch processing or cause problems with the documents to be posted. If you find a serious error in the field contents in the exit, send a termination message (A or X), which will ensure that the transaction is terminated.
Do not use any ABAP commands that cause the exit to be left directly, for example 'LEAVE (TO) SCREEN ...' or 'SUBMIT ...' or 'CALL TRANSACTION ...'
In an exit, use only structure fields that belong to the Boolean class of the calling substitution, validation or rule. The other structure fields are not filled or are not filled properly on the callup point of the calls of the substitution, validation or rule.
Changes to field contents may only be made in a substitution exit if this field can be substituted in the Boolean class. You can display such fields by selecting the "Add entry" function in the substitution maintenance.
In the Includes of the substitution exits, you must not use the commands MODIFY, INSERT or DELETE in the 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, database records are written, deleted or changed when you use the commands mentioned above. This can cause serious inconsistencies and problems in the document processing.
If you want to change field contents in Exit Types C_EXIT_PARAM_CLASS, you should make the changes in the internal table BOOL_DATA (for example BOLL_DATA-BSEG).
III. Problem analysis
Q. What must I take into account before I analyze the problem?
Before you analyze a problem with validations/substitutions, make sure that the generated source code is up-to-date. You can use Report 'RGUGBR00' to do this.
Call this report in Transaction SE38. You receive the following selection screen:
Application area ' '
Application callup point ' '
' ' Regenerate main program
' ' Generate table file
' ' Generate rules
' ' Generate validations
' ' Generate substitutions
' ' Generate sets
' ' Generate rule use
' ' Generate validation use
' ' Generate substitution usage
' ' Generate substitution export routines
' ' Generate substitution routines in all clients
' ' Generate 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.
Q. How can the validation and substitution trace be used?
a) Validation trace
You created and activated a validation.
You can now activate the trace, for example in Transaction GGBO. To do this, place the cursor on the validation and select 'Extras -> Activate trace'.
You created an FI validation on the 'Line item' callup point. To test the validation, execute, for example, Transaction FB01. The trace is displayed as soon as the validation is run. 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 deduce whether additional checks are required, or tell what the cause of a problem is.
b) Substitution trace
Activate the trace in the same way as you activate validations.
You created a substitution in the same way as you activated the trace in the case of the validation. The trace for substitutions has an additional function, in that you can view the field contents before the substitution as well as after the substitution. There, problems can be reproduced in the same way.
Q. How can I use the DEBUGGER to analyze a problem?
a) Basic information
All Includes for validations and substitutions are created in this form: GBTmmaa0.
mm stands for two digit client key.
You can use the G_CLIENT_ENCODE function module to convert a three-digit client (>099) to a two-digit client, for example: client 100 --> AA
client 800 --> TQ
AA stands for the application area, for example FI --> Financial Accounting
CO --> Cost Accounting
You will find this abbreviation in the maintenance transaction.
Therefore, GBTAAFI0 is the Include in client 100 for FI validations and substitutions.
b) Structure of the Includes and form routines for validations and substitutions and tips on how to 'debug'
The above-mentioned Includes are structured in the following way (sample Include in FI, Client 800):
INCLUDE GBTTQFIA. " Rules
INCLUDE GBTTQFIB. " Substitutions
INCLUDE GBTTQFIC. " Substitution conditions
INCLUDE GBTTQFID. " Validations
INCLUDE GBTTQFIE. " Validation conditions
INCLUDE GBTTQFIF. " Validation checks
INCLUDE GBTTQFII. " Application rules
INCLUDE GBTTQFIJ. " Substitution export routines
INCLUDE GBTTQFIM. " Trace/simulation
INCLUDE GBTTQFIS. " Substitution import routines
c) The form routines for validations have the following sample structure (sample validation with the name VAL01):
G_BFOUND = B_TRUE.
DATA: COND LIKE D_BOOL,
CHECK LIKE D_BOOL,
NVALSEVEREST LIKE SY-SUBRC VALUE -1.
IF COND = B_TRUE .
IF CHECK = B_FALSE .
ENDFORM. " VAL_VAL01
Statement G_STEP = '001' indicates the step that is executed.
The prerequisite of the step is defined in Form Routine VALCOND_..., the form routine VALCHCK_... checks the validation step.
To analyze this step, you should create breakpoints on these two PERFORM statements and also on the code line 'IF CHECK = FALSE'. In doing so, you can determine whether your prerequisite or the check is causing the problem you have, for example a field that is to be checked does not contain the value that you expect.
d) The form routines for substitutions have the following sample structure (sample substitution with the name SUB01):
G_BFOUND = B_TRUE.
DATA: COND LIKE D_BOOL.
G_CLASSID = '009'.
G_SUBST_PERFORMED = B_FALSE.
IF G_TAB_FLAG-BSEG <> B_TRUE .
IF G_BFOUND = B_FALSE .
MESSAGE E083 WITH 'BSEG'.
IF COND = B_TRUE .
BSEG-SGTXT = 'This is a Test'. " Text
G_SUBST_PERFORMED = B_TRUE.
ENDFORM. " SUB_SUB01
As mentioned above for validations, 'G_STEP = '001' indicates the step, and the prerequisite of the substitution is defined in Form Routine SUBCON_.... The actual substitution is carried out by the statements in the 'IF COND = B_TRUE --> ENDIF' structure. 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 on the PERFORM on the prerequisite and the statement 'IF COND = B_TRUE'.
Q. Function modules that call validations and substitutions
Validations - Function module G_VSR_VALIDATION_CALL
The different structures/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 parameters transferred to validations are also transferred to this function module. However, structures/tables that contain the changed values are also returned.
You could set a breakpoint to analyze both function modules. In doing so, you could see which data was transferred, which data the validation or substitution attains, and which values are returned.
Q. What must I take into account during the set usage?
When sets are used in validations or substitutions, source code is generated from the values in the sets.
Performance problems can occur if a set is of a certain size, since the generated source code causes longer runtimes.
A runtime error can also occur.
To reduce the size of the source code of the sets used, you can proceed as follows:
Use a smaller set in the validation, substitution or rule. To do so, group single values in the set into intervals (for example, instead of the single values 0001, 0002 and 0003, use the interval 0001 - 0003)
Instead of " IN SET", use the rule "( IN SET1 OR IN SET2)" in which SET1 and SET2 contain the values from SET (for example, subhierarchies on the highest hierarchy level).
The simplest way to determine the number of single values or intervals in a set hierarchy is to execute Program RGSEX000.
Enter the name of the set and execute the program. All contained sets and values/intervals are listed and the sequential number of the entries is contained in the first column.
Q. 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 Report RGUGBR00 to execute the regeneration of the source code again.
There could be another cause in the case of substitutions:
You try to substitute a field that is not released as a default by SAP. To substitute a field, you have adjusted Table GB01 in your development system. However, this did not occur 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 via the export routines.
TCode: WEDI, SALE, BD87,WE60, WE19 for testing
Standard SAP format for electronic data interchange between systems (Intermediate Document).
IOAUPD01 Work order assignments IDOC
IORDER01 SM/PM order IDoc
IORUPD01 Order status update IDoc
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.