Evaluating customer Ok-codes in screen exits

Customer Ok-codes should always be evaluated during PAI of the main-screen.

A screen exit is used to add pushbuttons and table controls to a screen in an R/3 application. Customer (Z*) Ok-codes are assigned to those pushbuttons in the Screen Painter.

Customer Ok-codes should always be evaluated during PAI of the main-screen. If this is not possible, e.g. the main-screen does not provide a user-exit for Ok-code processing, Customer Ok-codes will have to be evaluated during PAI of the Screen Exit. However, the OK_CODE field of the main-screen is usually not available in Screen Exits and the SY-UCOMM field cannot be used as it is not overwritten by blank Ok-codes, such as scrolling in table controls (the use of the SY-UCOMM field can result in repetitive execution of Customer Ok-codes). The actual Ok-code can be obtained by calling system-function 'DYNP_OKCODE_GET'.
DATA okcode LIKE sy-ucomm.

CALL 'DYNP_OKCODE_GET' ID 'FCODE' FIELD okcode.
IF okcode(1) EQ '='.
  SHIFT okcode.
ENDIF.
This was first published in May 2003

Dig deeper on SAPscript and Smart Forms

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close