`
skewen
  • 浏览: 74446 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Reading Function Codes

    博客分类:
  • ABAP
阅读更多

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
分享到:
评论

相关推荐

    SBPL Programming Reference for GL408e_GL412e

    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 ...

    Code Visualizer 4.57

    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, ...

    Serial Programming Guide for POSIX Operating Systems

    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()` ...

    Python Cookbook, 2nd Edition

    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 ...

    MATLAB seed文件读取生成程序

    % 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...

    The Indispensable PC Hardware Book - rar - part1. (1/7)

    主要内容: 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 ...

    一个跨平台的CString源码

    // 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 // ...

    TSPL_TSPL2 TSC指令编程

    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 ...

    Rave Player网页视频播放器

    - 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 ...

    FastReport.v4.8.36 for.Delphi.BCB.Full.Source中文修正版

    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 ...

    Bochs - The cross platform IA-32 (x86) emulator

    - 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 -...

    python3.6.5参考手册 chm

    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...

    WPTools.v6.29.1.Pro

    * 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...

    opensc-0.12.0.tar.gz

    * 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 ...

    BobBuilder_app

    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 ...

    微软内部资料-SQL性能优化3

    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...

    联想旭日420AXP系统芯片组驱动

    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 ....

Global site tag (gtag.js) - Google Analytics