Show TOC

Checking and Changing Data Using PSA-APIsLocate this document in the navigation structure

Use

To perform complex checks on data records, or to carry out specific changes to data records regularly, you can use delivered function modules (PSA-APIs) to program against a PSA table.

If you want to execute data validation with program support, select Tools → ABAP Workbench → Development → ABAP Editor andcreate a program.

When using transfer routines or update routines, it may be necessary to manually read data in the PSA table after the routine has finished.

Tip

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 a routine in the transformation - in accordance with his/her sales - the sales must be read from the PSA table.

Procedure
  1. Call up the function module RSSM_API_REQUEST_GET to get a list of requests with request ID for a particular InfoSource of a particular type. You have the option of restricting request output using a time restriction and/or the transfer method.

    You must know the request ID, as the request ID is the key that makes managing data records in the PSA possible.

  2. With the request information received so far, and with the help of the function module, you can

read RSAR_ODS_API_GET data records from the PSA table

write RSAR_ODS_API_PUT changed data records in the PSA table.

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.

Result

The corrected data is now available for continued updates.