cancel
Showing results for 
Search instead for 
Did you mean: 

BADI to delete data

former_member611118
Participant
0 Kudos

HI,

I have a question, but let me state ahead that i am not conversant with use of BADI in BPC so i might mix up the terms.

The client's requirement is to make use of dropdowns in the row axis. Through a few gymnastics, we are able to achieve a template that uses dropdowns. However, the problem is that when users decide to change a previously saved selection in a row, the new selection is saved to the database as a new record while the previous is kept which is not what is intended. So the solution we are left with is to find a way to delete users' record for the selected Cost Centre, Year and Version before the new set of data is saved.

My questions:

Is it possible to achieve this using BADI or any other means?

Which BADI (or enhancemnt spot) do we implement to first delete identified data set before the incoming data is saved to the data base?

Are there standard classes/function that can help?

We require the BADI to run without prompts when users save data and we need it to authomatically select the location to delete from the input sheet's context members. Is it possible and how?

I truly appreciate your helps

KR,

Seyi.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi,

To my mind it's a bad idea in general! It's not possible to define the universal logic how to select the record to be deleted - what combination of dimensions members is correct or incorrect.

Your client first asked you to create a template that will generate mistakes then asked you to add some AI to the system to find and correct mistakes

To avoid issues switch to 100% static input templates!

B.R. Vadim

former_member611118
Participant
0 Kudos

Thanks a lot Vadim,

This was my initial position and my recommendation. We actually went ahead with 100% static master-detail template (they require Account and Activity dimensions on the row axis), however, it's a little cumbersome as users will need to launch the detail sheet for every activity they want to budget on (which can be over 80 per Cost Centre). This will definitely affect user-adoption and that is why discussions have returned to the use of one template with dropdowns. And I need some really convincing reasons/evidence as to why this is not possible/advisable in order to discourage this approach.

Please note we are on BPC 10.0 and we have a team of ABAP developers I can leverage on. I only need to know the possibily and logic of how this can be achieved

Regards,

Seyi.

former_member186338
Active Contributor
0 Kudos

Hi Seyi,

I still have no idea how the system will distinguish between correct line and wrong line... Please, provide a detailed example with dimension members. May be it's possible to use property to enforce proper member selection.

Vadim

P.S. With screenshot!

former_member611118
Participant
0 Kudos

Hi,

The dimensions that determine data intercept are Cost Centre, Year and Version. Users will select the context member of these dimension from specific cell. What i need is for all data and comments attached to the CC-Year-Version intecept be deleted so the incoming data go into a "blank" tupleso to speak. See if the image below clarifies

Thanks for your help

Seyi.

former_member186338
Active Contributor
0 Kudos

You really don't need to delete anything, you have to prevent users to enter incorrect data.

Please explain, how users are able to enter incorrect info? What is the scenario?

Vadim

former_member611118
Participant
0 Kudos

Vadim,

Consider this scenerio, a user enters the data below and save:

B_Line   Activity               Account                          Jan     Feb     Mar

1           ABBX0001         22241004                          50       70       80

2           ABBX0003         22241004                          45       30       60

3           ADCX0012        22241224                          65       30       100

But after review by his manager he is told to change the account on line 2 to 23241004. He goes ahed to change by selecting the new account from the dropdown and saves it back. On the face of the template, line 2 have just one recored - the new corrected record. However, the database sees the new entries as a seperate record, not as a correction of the line 2 records so it keeps the data below:

B_Line   Activity               Account                          Jan     Feb     Mar

1           ABBX0001         22241004                          50       70       80

2           ABBX0003         22241004                          45       30       60

2           ABBX0003         23241004                          45       30       60

3           ADCX0012        22241224                          65       30       100

The need to change the account/activity selection can arise for various reasons: correction of wrong activity/account selection, reduction of budget reassignment of figures etc.

Seyi

former_member186338
Active Contributor
0 Kudos

Does it means, that for each Activity you have one and only one Account? Then it can be maintained as property of Activity with automatic selection...

And stop thinking about BPC cubes like tables in SQL databases. You are not correcting record changing some field, but you are creating different record! There is no relation between this records in general.

If multiple accounts per activity are allowed, then only static template with all accounts per activity.

B.R. Vadim

former_member611118
Participant
0 Kudos

No, users can budget for different Accounts under each Activity (see image in my earlier reply). So they have to be maintained as different dimesions.

I perfectly undestand that BPC cubes are not relational. And yes that is what happens in the backend. But to a business user,he simply wants to correct a wrongly assigned Activity/Account. And that is why we need to get the records for the CC-Year-Version intercept deleted before the new set is written to the DB.

Seyi.

former_member186338
Active Contributor
0 Kudos

Then, add property to the Activity dimension - ACCT, fill it with proper ACCOUNT members and generate report having ACCOUNT column to be filled depending on the property of Activity column. No dropdowns, easy to maintain!

Vadim

former_member186338
Active Contributor
0 Kudos

In our system we have 2 dimensions: BE - legal entities and TITLES - magazine titles.

Dimension TITLES has property - PLANBE, filled with the BE member (legal entity the title belongs to).

For input schedule the BE is coming from PLANBE property of TITLES.

B.R. Vadim

former_member611118
Participant
0 Kudos

Vadim,

Is it totally impossible or difficult to achive my original intention of using BADI?

The issue is not about understanding the template options, trust me I've got a good hang on templates, and the property suggestion will not work as you cant restrict Accounts to specific Acitivties. Over 200 Account can be assignd to over 200 Activities. Moreover the client is adamant about the dropdown template requiement.

The issue (detailed in question) is about knowing how the BADI option is possible and if not to have a conclusive reason why not.

Regards,

Seyi.

former_member186338
Active Contributor
0 Kudos

1. It's possible to do it in Write Back badi only!

2. You have to somehow maintain the case when user will simultaneously send 2 or more accounts for one activity.

3. You will have to think about other data changes (not by input schedule but by DM...)

4. You have to think about situation when user will send data by mistake to the node member of account dimension

5. etc...

Implementing this requirement will create more issues then it solves! Somebody later will have to remove this code

B.R. Vadim

former_member611118
Participant
0 Kudos

Vadm,

Thanks.

Using a dimenion called Budget Lines (with members L0 and L1 to L400), uniqueness of each row is maintained even if users simultaneously send 2 or more accounts for one activity.

The dropdowns will only display base members and we do not plan on the node level at all.

The plan is to differentiate direct input data from that from DM, Logic Script using B_lines dimension where non direct input data are saved in L0. So this way we can delete on direct input data.

Please elaborate on the logic and how it might be possible using writeback badi.

Are there standard classes/function that can help?

We require the BADI to run without prompts when users save data and we need it to authomatically select the location to delete from the input sheet's context members. Is it possible and how

Once again thank you for helping

Seyi.

former_member186338
Active Contributor
0 Kudos

Hi Seyi,

Please read this document in How-to:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0309226-814f-2d10-61a6-ef8da29e3...

It's about 7.5 but the idea is the same.

Also, read this one about migration of 7.5 badi to 10:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/702bf959-c89a-3010-aeb0-b43a4bfd8...

B.R. Vadim

former_member611118
Participant
0 Kudos

Vadim,

Good! And thanks for the insightful tips and questions.

Regards,

Seyi.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Seyi,

Yes this is possible by using write back or custom logic badi but my question is how would you find the previous saved selection because there are millions of combination in CUBE.

Instead of that you can change the template to send the 0 record for previous selection automatically. See if user chnage any member from row axis and sends the data means you need to send that with previously saved combination with 0 value so it automatically zero out that value from CUBE.

Why I am saying is, If you need to zero out using BAdI means, In which basis you will find out the previosly selected combination. If you are able to findout previously selected combination means than why you need BAdI here you can do that through Excel itself.

Thanks,

Suresh

former_member181999
Contributor
0 Kudos

Hello Seyi,

Yes it is possible thru BADI.

Following is a suggestable solution:

1. Make sure that to be deleted data is coming in a fixed column in the Input schedule/report say field J5. So here selection start point is fixed. The end point can be dynamic (To acheive this you should utilized MS excel function/ev function) .

2. At the end inorder to trigger the deletion part. You should include the required code in Update all function (I think you are aware.).

Hope this is helpful.

Thank you.

former_member611118
Participant
0 Kudos

Hi Ashok,


Thanks for your reply. Am not sure i am clear on your suggestions.

1. Here is selection criteria fields I have set up:

Cost Centre is in cell E10
Year in E11
Version in E12

What we require is that all data for the selected Cost Centre, Year and Version combination be deleted. How does this play out?

2. Again, I am new to BADI, kindly expantiate on your point 2.


We are on SAP 10.0 NW


KR,
Seyi.