‎2017 Oct 27 6:27 AM
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.
‎2017 Oct 27 7:12 AM
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
‎2017 Oct 27 7:12 AM
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
‎2017 Oct 27 7:40 AM