Reading Function Codes
In each PAI event that a user triggers by choosing either a pushbutton on the screen or an element in a GUI status, the corresponding function code is placed into the system field SYST-UCOMM or SY-UCOMM and placed in the OK_CODE field (as long as the function code is not empty). Empty function codes are placed in neither the SY-UCOMM field nor the OK_CODE field.
In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
In your application programs, the first step in PAI processing should be to save the function code in an auxiliary variable and then initialize the OK_CODE field. You can then read the function code from the auxiliary variable (for example, using a CASE structure), and control the program flow from there.
The OK_CODE field can have a different name on each screen. However, common practice is to use the same name for the field on each screen of an ABAP program. You then only need one field in the ABAP program, with the same name, into which the function code is placed, and from which you can read it.
Global data declarations:
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM.
Your ABAP program must contain a field with the same name as the OK_CODE field on the screen. To specify the type, you should refer to the system field SY-UCOMM, since this always corresponds to the type of the OK_CODE field on the screen. At the same time, you should declare an appropriate auxiliary variable.
PAI module:
MODULE USER_COMMAND_100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN...
...
ENDCASE.
ENDMODULE.
In the first PAI module, you should assign the contents of the OK_FIELD to the auxiliary variable and then clear the OK_CODE field and carry on working with the auxiliary variable.
- 大小: 8.2 KB
分享到:
相关推荐
The manual emphasizes the importance of reading and referring to it throughout the development process. #### Print Area Calculation Before diving into specific commands, understanding how the print ...
Save your time from reading and understanding from text source codes. Code Visualizer provides various point of views from C/C++ source code files. Code Visualizer provides Macro View, Flow View, ...
4. **Reading Data**: Data can be read from the serial port using the `read()` function. 5. **Closing the Port**: Once all operations are completed, the port should be closed using the `close()` ...
Converting Between Characters and Numeric Codes Recipe 1.3. Testing Whether an Object Is String-like Recipe 1.4. Aligning Strings Recipe 1.5. Trimming Space from the Ends of a String Recipe ...
% Known encoding formats are the following FDSN codes: % 0: ASCII % 1: 16-bit integer % 2: 24-bit integer (untested) % 3: 32-bit integer % 4: IEEE float32 % 5: IEEE float64 % 10: Steim-1 % 11: Steim-2...
主要内容: l CPU's from the 8086/8088 to the Pentium III and Athlon l Real, protected and virtual models l Windows and plug&play devices l CPU Clones from all major manufacturers ...
// returning error codes for apparently successful conversions // between ASCII and UNICODE. Finally thanks to Brian Groose // for helping me fix compiler signed unsigned warnings in // ...
Key updates include corrections, new commands, and additions to the BASIC function set. #### Document Conventions and Object Position Calculation Before diving into the specific commands, it's ...
- Dropped ID3 reading and auto image search and load (causing App to freeze). v5.0.6a (Sept. 19, 2010) - Updated EXE/APP wrapper (using v4) v 5.0.6 (Nov. 17, 2009) - Fixed Mac browse for cover art ...
Full source codes in the report generator, which allows you to thoroughly understand the work logic and to make any necessary changes and minor adjustments. Enterprise Edition This edition goes ...
- Fix BIOS INT13 function 08 when the number of cylinders on the disk = 1 - I/O Devices - USB HP DeskJet 920C printer device emulation (Ben Lunt) - Misc - Updated Bochs TESTFORM to version 0.5 -...
PEP 471 - os.scandir() function – a better and faster directory iterator PEP 475: Retry system calls failing with EINTR PEP 479: Change StopIteration handling inside generators PEP 485: A function...
* modified WPT reading code to repair table width which were negative + improved image rendering code for transparent (PNG) images. They will be drawn transparently also when scaled and also in high...
* increase pin buffer size to allow longer pin codes. * Windows Make.rules.mak improved to work with and w/o openssl and zlib * Added --read-ssk-key option to pkcs15-tool (prints public key in ssh ...
MurMurHash: A non cryptographic hash function created by Austin Appleby in 2008 (http://en.wikipedia.org/wiki/MurmurHash). Features RaptorDB has the following features : Very fast performance ...
Recommended Reading Chapter 14 “Locking”, Inside SQL Server 2000 by Kalen Delaney SOX000821700049 – SQL 7.0 How to interpret lock resource Ids SOX000925700237 – TITLE: Lock escalation in...
function properly: - Core PCI and ISAPNP Services - PCIe Support - IDE/ATA33/ATA66/ATA100 Storage Support - SATA Storage Support - USB Support - Identification of Intel(R) Chipset Components in...
Contents Preface i 1 Introduction 1 1.1 Information isBits inContext . . . . . . ....1.2 Programs areTranslated byOtherPrograms intoDifferent Forms ....1.3 ItPays toUnderstandHowCompilation SystemsWork ....