Hashed table for single read access
In this recipe, we will create a program that will use a hashed
table and a standard table for accessing and displaying employee data from two tables PA0003
and PA0006
. There may be many solutions to this requirement. We will use SELECT
clause and hashed
tables.
Getting ready
In this recipe, we create a program that will take as input personnel number and then print the last payroll run date of the employee (from PA0003
) and the permanent residence address (subtype 1) stored in the STRAS
field of the table PA0006
. For simplicity's sake, only one data field of each table has been shown.
How to do it...
For creating the program, proceed as follows:
We define
select-options
for taking input of personnel number.Next, we define a type
ty_payroll
based on payroll infotype fieldspernr
andabrdt
. A structure and a hashed table based on this type are also defined. The hashed table has a unique keypernr
.Similarly, an address type
ty_address
is defined, along with...