cancel
Showing results for 
Search instead for 
Did you mean: 

To delete the duplicate entries in production DSO

ramesh_duraisamy
Active Participant
0 Kudos

 

Hi Experts,

We have few duplicate entries in Production DSO level ( PO line items) and we need your help to delete the duplicate entries. Have you encountered similar situation in your account?

Thanks and Regards,

Ramesh D

Accepted Solutions (1)

Accepted Solutions (1)

ramesh_duraisamy
Active Participant
0 Kudos

Hi Tibollo, 

1) Between 2 weeks of time ( 23rd April to 2nd May), get the volume of data.

2) Write an ABAP Program (run independently of any BI objects) will clear the duplicate entries only in DSO.

Logic of the program :

a. Program Input - Date field. Run the program based on the specified date.

b. fetch the records(PO #) from the DSO active table for the given date.

c. Sort the records based on recent date and time which will have the recent changes.

d. Delete all the entries other than latest change.

e. Update the same in DSO Active table.

3) Test the same scenario in DEV and QA which had duplicate entries already .

4) If its good to go , Proceed the same to next level of movement.

 

Note :

Change Log and PSA table will have duplicates since full load would not be advisable in PRD. only Delta records will be running by Process Chain.

Thanks and Regards,

Ramesh D

Former Member
0 Kudos

Hi Ramesh,

In u r code use this statement, with this u can delete duplicates in u r code it self  DELETE ADJACENT DUPLICATES FROM itab.

former_member186445
Active Contributor
0 Kudos

actually what you are trying to do is a standard feature of the dso if you set it to overwrite. you'll keep only the last record.  however if for some reason this is not possible, i forsee some issues with your approach. depending on the number of records in your dso, but i think there will be too many to handle with an itab.

if you change a record in the dso without corresponding changelog this can lead to issues.

the best approach would be to have a  second dso, and use your logic in a transformation. (use semantic grouping to be sure you have all the records of one PO in the same package).

so you load from dso1 to dso2. check dso2 to make sure everything is ok. delete contents of dso1. load from dso2 to dso1

Answers (6)

Answers (6)

shan1023
Explorer
0 Kudos

Dear Ramesh,

          For deleting duplicate entries in production level, we can check and do two ways.

When you using Write Optimized DSO:

If you are using a write-optimized DSO , then it will not ot allow duplicate records. You have to select the checkbox Do not check uniqueness of data. But in that case you will have duplicate entries in write optimized DSO .

When you using the Standard DSO:

If you are using a standard DSO, then i guess you have selected the check box for Uniqueness of Data in the settings of the DSO . This will not allow duplicate records to enter .

or

You may write routine to avoid duplicate entries. Like

// global declaration in start routine

Types: begin of tt_DSO

              Doc_no type /bic/****

             Date type ******

            Status1 type *****

           Status2 type ***

End of tt_DSO.

Data: it_DSO type standard table of tt_ DSO,

          wa_ DSO type tt_ DSO.

// end of global declaration

Start routine:

DATA: WA_SP type tyt_SC_1  (i.e. source_package),

             R_INDEX TYPE SY-TABIX.

REFRESH:it_DSO.

Select doc_no date status1 status 2 from active_table_dso into table it_DSO for all entries in source_package

where doc_no = source_package-doc_no and other keys if applicable

    LOOP AT SOURCE_PACKAGE INTO WA_SP.

      R_INDEX = SY-TABIX.

      READ TABLE it_DSO INTO wa_DSO WITH KEY

                 doc_no = WA_SP-doc_no.

             

      IF SY-SUBRC EQ 0.

        If wa_DSO-date < WA_SP-date

        DELETE SOURCE PACKAGE INDEX RINDEX.

        " delete the record.

      ELSE.

        MODIFY SOURCE PACKAGE FROM WASP INDEX R_INDEX.

        " keep the record.

       Endif.

      ENDIF.

    ENDLOOP.

Regards,

Shankar M.

ramesh_duraisamy
Active Participant
0 Kudos

Hi Tibollo/Chakri,

 

Thanks for sharing your thoughts on this.

Datasource : 2LIS_02_SCL. which is ABR delta type.

Keyfigures used in the DSO are combination of overwrite and summation type.(for example, sales , quantity etc)

Since the issue in PRD, just to correct few records(Only 10 days of data is redundant.) , this would not require any additional DSO from DSO to Infocube. Do correct me if I am wrong.

If I go for selective deletion, duplicate records only in Active table will be deleted, but not change log table. Is there any way to delete duplicates in change log table also?

Thanks and Regards,

Ramesh D

ramesh_duraisamy
Active Participant
0 Kudos

Thanks Tibollo and chakri, will check and revert you back.

former_member182470
Active Contributor
0 Kudos

Hi,

The key Figures of your DSO are of what update type? Is it Overwrite or Addition type?

If it is addition type, your datasource delta type should be ADD.http://scn.sap.com/docs/DOC-11501

If there is a requirement to delete the unwanted records, you have to do selective deletion.

Regards,

Suman

ramesh_duraisamy
Active Participant
0 Kudos

Hi Tibollo,

Its a Standard DSO.

Elobrated the problem,

Problem Overview:

 

1) Written ABAP code to fulfill the requirement of PO Amendment Report.. The Report should show the history of changes for the particular PO. The code was written in ECC which has to be keep track of all the changes made on PO. (This would not be achievable if the same code written in transformation level ).

2) While extracting data from Extractor in ECC, PO # gets redundant due to logic written for PO Amendment Report.

3) The same data was extracted to consecutive level of SAP BI with the help of Delta load through Process chain. Now duplicates entries exists in PSA and DSO.

4) The reports, which is being used ZPUR_OD1 as base, will show incorrect data.

Thanks and Regards,

Ramesh D

former_member186445
Active Contributor
0 Kudos

what's the key of your dso? it's not clear for me if you actually need the history of the po in your dso?

if there's always one specific record redundant, you can use a simple delete statement in the start routine.

M.

former_member186445
Active Contributor
0 Kudos

what type of a DSO?