cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP code to delete the records

Former Member
0 Kudos

Hi all,

Could anyone give me the code to delete all the records which has zero Key figure values?

I have so many records where all Key figure values are zero and I need to reject those records before loading into the target.

Thanks & Regards,

Krishna

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi there,

What's your source? An infocube?

Diogo.

Former Member
0 Kudos

Hi,

We are extracting from a different BW system and the source is Infocube. We are loading it to a DSO. We need to reject all the records which has zero Key figure values before loading it to the DSO. We are extracting around 100 Key figures from the source.

Could you send me the code.

Krishna

Former Member
0 Kudos

Hi

Alternatively you can compress the requests in the cube with zero elimination. this will eliminate the records with KF values 0.

Hope it helps.

Regards

Sadeesh

Former Member
0 Kudos

Hi there,

Ok, that is very simple and you don't need any code.

Just go to manage of your source InfoCube and in tab "Collapse" just do the copression of all the requests "with zero Elimination" flag marked.

This will compress all of your requests and delete the zero records from the source InfoCube.

Diogo.

Former Member
0 Kudos

Hi

Any other option other than compression? By means of any code?

Krishna

Former Member
0 Kudos

Yes you can delete it by using abap code. it was already suggested by baskar. Just write that code into the start routine of the transforamtion and it will delete the records whose kf values are zero.

Regards

sadeesh

Former Member
0 Kudos

Hi

We have around 100 Key Figures. Do you mean to say I need to give the AND condition for 100 Key figures in the start routine? Is there any way to simplify the code?

Krishna

Former Member
0 Kudos

Yes,

compress the InfoCube...

Diogo.

Former Member
0 Kudos

As far as i know that is the best code to delete the records. In order to delete 100 key figures you have to read all the key figures and see it contains value zero or not. There might be another way of coding to delete the records but you will have to read all the KFs to delete. So somehow your code will contain 100 KFs.

Hope it helps.

Regards

Sadeesh

Former Member
0 Kudos

Hi Krishna,

Add a 101st KYF into your DSO which is the addition of the 100 first.

Then check only its value. You have a single KYF to check.

Regards

shanthi_bhaskar
Active Contributor
0 Kudos

DELETE SOURCE_PACKAGE WHERE KF1 = 0 and KF2 = 0.......

Former Member
0 Kudos

Hi,

We are extracting around 100 Keyfigures from the source. Is there any way to simplify the code?

Krishna