Skip to Content
-2

Why save_ok = ok_code.

Oct 27, 2017 at 05:27 AM

47

avatar image
Former Member

Hi all,

foy any reasons - which I cannot remember - it is adviced to copy the OK_Code into save_ok.

e.g: BCALV_EDIT_04

Could anyboly pls. explain why this is advised?

Thx, Regards Mario

*---------------------------------------------------------------------*
*       MODULE PAI INPUT                                              *
*---------------------------------------------------------------------*
module pai input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
    when 'SAVE'.
      perform save_data.
    when 'BACK'.
* §10.Unlock your database table.
      perform unlock_sflight.
      leave to screen 0.
    when 'EXIT'.
      perform exit_program.
    when others.
*     do nothing
  endcase.
endmodule.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sandra Rossi Oct 27, 2017 at 06:12 AM
4

In the program BCALV_EDIT_04, duplicating the ok_code value is useless.

Generally speaking, when you press Enter (or a scroll key in a table ontrol), the ok code (and even sy-ucomm) is not reset, it's why it may be useful to clear the ok code before displaying the screen: the most convenient way is to do it at the beginning of the PAI (in case there's a warning/error message during the PAI, the PBO wouldn't be triggered).

More info here: SAP Library: Reading Function Codes

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 27, 2017 at 06:40 AM
0

Hi Sandra!

Thanks, it is clear now!

Regards Mario

Share
10 |10000 characters needed characters left characters exceeded