blog
akp mersin
emo
rock
mp3 dinle

Attention: open in a new window. PDFPrintE-mail

2008
05
Apr

Purpose of ok_code in Dialog Program

User Rating: / 4
PoorBest 

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.

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.

I hope it will be helpful for you.

Last Updated (Tuesday, 30 November 1999 00:00)
Please register or login to add your comments to this article.
blog
akp mersin
emo
rock
mp3 dinle
Banner