Summary :
There are limitations to search records in PSA and mass modify the records. PSA search in BI is a difficult task as it shows Data by Packets. Search and Replace values for a particular column in PSA is not easy. This document tries to overcome the limitations of PSA by providing customized methods. This document is divided into two parts. 1. Searching for a particular record in PSA 2. Mass change for a value in PSA [ This can be used for any other table ]
PART 1: Searching for a particular record in PSA :
Follow the steps to search a particular record in PSA
Step 1: Identify the request number from the data load monitor

Step 2: Fetch the table name for the request using the table RSTSODSPART using the Tcode SE16

Step 3: Put the request number from the Step 1 and enter into the request field and execute. It will display the record which contain the record as below.

Step 4: Select the Technical ODS name from the above screen and display the records using table name as Technical ODS name [TCode SE16 ]. Fill the Request number field from Step 1.

Here you can use filter to get the desired records.
PART 2: Mass change for a value in PSA
The ABAP program is created that can be use to replace any value from any table. This program is a generic program. If you need to alter any value from PSA it would be easy to maintain. After data load failure you find that 100,000 records contain some wrong value this program can be used to alter the values which will overcome the limit of PSA maintenance tool. This program can be used in any other application other than PSA.
Please download the file and create an ABAP program to execute.
Step1: TCODE: SE38

Step 2: This is the sample Code.
DATA :
dref TYPE REF TO data,
dref TYPE REF TO data,
it_grid_fcat TYPE lvc_t_fcat,
struct_grid_lset TYPE lvc_s_layo,
tab_info LIKE TABLE OF dfies.
FIELD-SYMBOLS :
LIKE LINE OF tab_info,
**** Output Structure****
TYPE table.
struct_grid_lset TYPE lvc_s_layo,
tab_info LIKE TABLE OF dfies.
FIELD-SYMBOLS :
**** Output Structure****
PARAMETER:
p_itab TYPE tabname,
p_fname TYPE fieldname,
p_extval(30),
p_repval(30).
*Assign the input value to-tabname
ASSIGN p_itab TO-tabname .
*-tabname
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_itab
CHANGING
ct_fieldcat = it_grid_fcat.
*Static method - no need to create object (use => )
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_grid_fcat
IMPORTING
ep_table = dref.
ASSIGN dref->* TO.
* Fetch Data
DATA:
con_syn(50),
set_syn(50).
CONCATENATE p_fname '=' 'P_EXTVAL' INTO con_syn SEPARATED BY space.
CONCATENATE p_fname '=' 'P_REPVAL' INTO set_syn SEPARATED BY space.
UPDATE (p_itab) SET (set_syn) WHERE (con_syn).
IF sy-subrc <> 0.
WRITE: 'Mission Impossible.. Operation Failed'.
ELSE.
WRITE: 'Operation Sucess'.
p_itab TYPE tabname,
p_fname TYPE fieldname,
p_extval(30),
p_repval(30).
*Assign the input value to
ASSIGN p_itab TO
*
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_itab
CHANGING
ct_fieldcat = it_grid_fcat.
*Static method - no need to create object (use => )
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_grid_fcat
IMPORTING
ep_table = dref.
ASSIGN dref->* TO
* Fetch Data
DATA:
con_syn(50),
set_syn(50).
CONCATENATE p_fname '=' 'P_EXTVAL' INTO con_syn SEPARATED BY space.
CONCATENATE p_fname '=' 'P_REPVAL' INTO set_syn SEPARATED BY space.
UPDATE (p_itab) SET (set_syn) WHERE (con_syn).
IF sy-subrc <> 0.
WRITE: 'Mission Impossible.. Operation Failed'.
ELSE.
WRITE: 'Operation Sucess'.
ENDIF.
Step 3: Activate the program
Step 4: Run the program
Step 4: Run the program

- P_ITAB contain the table name to be modified. This can contain the table identified in Step 4.
- P_FNAME contain the field name to be modified
- P_EXTVAL old value to be replaced
- P_REPVAL new value.
After executing the program, if executes properly it will comes up with the following message.
If does not execute properly it will comes with error message.
No comments:
Post a Comment