Checking and Changing Data Using PSA-APIs 
Use
To perform complex checks on data records, or to carry out particular changes to data records regularly, you can program for a PSA table with the help of the delivered function modules called PSA-APIs.
If you want to execute data validation with program support, select Tools ® ABAP Workbench ® Development ® ABAP Editor and
create a program. If you use
transfer routines or update routines it may be necessary to subsequently read data in the PSA table.
Employee bonuses are loaded into an InfoCube and sales figures for employees are loaded into a PSA table. If an employee’s bonus is to be calculated in the update routine and depending on his/her sales, the sales must be read from the PSA table.
Procedure
You must know the request ID, as the request ID is the key that makes managing data records in the PSA possible.
RSAR_ODS_API_GET
You can call up the function module RSAR_ODS_API_GET with the list of request IDs given by the function module RSSM_API_REQUEST_GET. The function module RSAR_ODS_API_GET no longer recognizes InfoSources on the interface, rather it recognizes the request IDs instead. With the parameter I_T_SELECTIONS, you can restrict reading data records in the PSA table with reference to the fields of the transfer structure. In your program, the selections are filled and transferred to the parameter I_T_SELECTIONS.
The import parameter causes the function module to output the data records in the parameter E_T_DATA. Data output is unstructured, since the function module RSAR_ODS_API_GET works generically, and therefore does not recognize the specific structure of the PSA. You can find information on the field in the PSA table using the parameter E_T_RSFIELDTXT.
RSAR_ODS_API_PUT
After merging or checking and subsequently changing the data, you can write the altered data records into the PSA table with the function module RSAR_ODS_API_PUT. To be able to write request data into the table with the help of this function module, you have to enter the corresponding request ID. The parameter E_T_DATA contains the changed data records.