Because library modules are compiled independently of forms and menus, form bind variables (the values of form items, system and global variables, and parameters) are always outside the scope of library program units. Consequently, you cannot refer directly to form bind variables in a library program unit. For instance, a user-named procedure or function in a library cannot refer to the following objects:
Instead, use the NAME_IN subprogram function to indirectly reference the values of bind variables:
Use the COPY subprogram procedure to indirectly set the values of bind variables:
When COPY is used to set the value of a form item in a library routine, that item is marked as CHANGED. This behavior can affect subsequent validation and commit processing.
Whenever possible, you should write library program units that rely on IN and IN OUT parameters for passing data between the form or menu module and the library. You can also use function return values for this purpose. When you call a library procedure that uses parameters, you can pass bind variable references as actual parameters, as shown here:
my_library_procedure(:form_block.form_item,:System.Cursor_Block);