How to Purge Y queries through custom program in BW system :
1) Create a ZProgram through transaction SE38 as per the following screen-shots:–>
2) Attribute of Main Program :
3) Create a new Custom table ZU001 with contains hardcode values to call dynamic hardcode value for the program:
4) Created a Table Maintenance Generator for this table as shown below:
5) Create a new entry in the hardcodes table (ZU001) for the program:
Program Name |
Data Type |
Level |
Secuence |
Value (Low) |
Action Type |
Description |
ZYQUERY_DELETE |
RP |
2 |
1 |
180 |
1 |
Y QUERIES |
6) Then Perform the Logic part to delete Y Queries as follows:
Inside FORM Get_Days , Calling custom Function Module “Z_GET_HARDCODES”.
5) Create a Custom Function Module “Z_GET_HARDCODES” to get all hardcode values :
(a) Create a Function Group from Tcode SE80:–>
(b) Function Module Attributes:–>
(c) Import Parameters :–>
(d) Tables Parameter:–>
(e) Source Code :–>
6)Come back to original Program:
Calculate the date from no. of days received from Function Module:
Concatenate Y* into variable lv_Search. Then do perform Batch data recording through TCode SHDB.
7) Testing of this program :–>
Y Queries:
Carried out the test for Y Queries deletion. Before that just check the entry of Y Queries in Table RSZCOMPDIR. And identified all the queries older than
180 days (5 entries).
Then finally executed program ZYQUERY_DELETE and see the results as follows:
We can see from the below screenshot that the 5 entries were deleted. (118 -113 = 5).
Helpful Document, Thanks For Sharing.
Useful information 🙂 .
Very good document, thank you.
Helpful document 🙂