cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting certain records from DSO through ABAP logic

tek_ib
Explorer
0 Kudos
914

Hello,

I created a DSO and its source is infoset.

I like to delete certain rows of the data using certain condition while loading data from infoset into DSO. Can someone please help me write an ABAP syntax.

This is my scenario:

If Location is equal to Site then delete that records, please see below. (I want to delete the Record A highlighted in yellow)

How can I achieve this using ABAP routine in transformation (either Start routine or End routine) between infoset to DSO.

I would appreciate your help.

Thank You.

Sandra_Rossi
Active Contributor
0 Kudos

It seems a very basic question. What did you try? What didn't work well? Did you ask your peer developers?

tek_ib
Explorer
0 Kudos

I am trying to write the code myself as a user, no developer available to help.

Can you please let me know the syntax for this , I will appreciate.

Thanks

Sandra_Rossi
Active Contributor
0 Kudos

The forum is full of examples. This query seems to return interesting answers:

Delete records "DSO" "internal table" "start routine" "source_package" site:sap.com

matt
Active Contributor
0 Kudos

I am trying to write the code myself as a user, no developer available to help.

It is an extremely bad idea for a non-developer to write code. It will be inevitably badly written, prone to failure and inefficient.

Tell the person who asked you to do this task that it isn't in your skillset. It's the only sensible thing to do.

AlexGourdet
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

We've been alerted on this question thread; please consider encouraging the new member on their pursuit of learning as feedback for reinforcement.

Regards,

Alex

matt
Active Contributor
0 Kudos

OK, fair enough. As an alternative - ask your boss for you to go on an ABAP programming course, so you can have it on your skillset.

Sandra_Rossi
Active Contributor

LOL to see this kind of moderation message. Here in the forum the moderation often looks to me as a mean to refrain people saying "please search a little bit" rather than moderating people who ask to do it. A mindset to change. Hopefully, I leverage with Stack Overflow which is a nice space in this sense, except for people who don't want to search before posting.

matt
Active Contributor

Well, yes, when I was moderating, we adopted the other approach. But as a matter of taking responsibility for advice given, I'm not going to give people advice that if not used correctly could harm their system. If development needs doing, a developer should be brought in or trained. There are no shortcuts. Mind you, I made quite a bit of money fixing BW systems with routines written by non-programmers.

Anyway, I seem to recall there's a standard process for deleting records from a DSO - but it's years since I did BW, so can't remember the details.

tek_ib
Explorer
0 Kudos

Mathew, thanks for your response and I am glad that because of some users coding in the past you were able to retain your job to fix it otherwise American unemployment rate would have been in dire straits.

hasta la vista

Sandra_Rossi
Active Contributor
0 Kudos

I'm surprised that no BW expert currently in activity (in BW domain) can give an advice. I see 4 possible reasons: either no BW expert is around, or the question is not asked very well (not enough details on the mentioned objects/what was done), or people don't mind spending time on basic questions (no enough searching), or the question is very complex and nobody can answer. No idea what can be the right reason.

matt
Active Contributor

tek_ib I'm not American. I'm Swiss! 🙂

deepak_rai12
Explorer
0 Kudos

Hi,

Try out this.

LV_VAR type Location.

Loop at source_package.

LV_VAR = source_package-location.

delete source_package where source_package-site = LV_VAR.

Endloop.

Thanks.

Deepak

matt
Active Contributor

deepak.rai12

Not good. It's not syntactically correct and you appear to be using a table with a header line, which is so 1990s.

deepak_rai12
Explorer

Let's make it simple 🙂

outtab = select * from :intab WHERE Location <> Site

Cheers.

Accepted Solutions (0)

Answers (1)

Answers (1)

Anand71
Active Contributor
0 Kudos

Hi,

You can achive your requirement by ABAP code in end routine. Search for "How to write end routine", you will get lot of post. 

You can also try to post yout code so that one can check and give you a solution.

Thanks.

Regards,

Anand